简体   繁体   English

安卓 SIP DTMF

[英]Android SIP DTMF

I have set up my asterisk sip server in such a way where I would transfer a call by first dialling "*2",then the server would prompt me asking for the number to which I want to transfer the call and then I could dial the number.我已经设置了我的星号 sip 服务器,我首先拨打“*2”来转接电话,然后服务器会提示我询问我想转接电话的号码,然后我可以拨打数字。 I want to make a JAVA function using the native android library.我想使用原生android库制作一个JAVA函数。 In the code below base_call is the instance of SipAudioCall that hold the instance of the ongoing call.在 base_call 下面的代码中是 SipAudioCall 的实例,它保存了正在进行的呼叫的实例。

 public void transferCall() {
    base_call.sendDtmf(10);
    base_call.sendDtmf(2);
    try {
        TimeUnit.SECONDS.sleep(3);
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
    base_call.sendDtmf(7);
    base_call.sendDtmf(0);
    base_call.sendDtmf(0);
    base_call.sendDtmf(3);
}

Here I am trying to transfer the call to 7003.The "*2" works and the server is prompting me to dial a number but the dialling of numbers does not work.在这里,我试图将呼叫转移到 7003。“*2”有效,服务器提示我拨打号码,但拨号无效。

这是通过在发送 dtmf 代码之间设置适当的时间延迟来实现的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM