简体   繁体   English

Android Native SIP DTMF

[英]Android Native SIP DTMF

I am using android SIP(android.net.sip) for VOIP calling. 我使用android SIP(android.net.sip)进行VOIP调用。 Trying to send DTMF. 试图发送DTMF。 In SipAudioCall Class of android two method has been given SipAudioCall类的android中已经给出了两个方法

void sendDtmf(int code, Message result)
Sends a DTMF code.

void sendDtmf(int code)
Sends a DTMF code.

I am thinking to use sendDtmf(int code) method to send DMTF. 我想用sendDtmf(int code)方法发送DMTF。 but I dont know how can I varify whether It is actually sent or not. 但我不知道如何改变它是否实际发送。 After implementing this, I am not getting any tone at reciever/sender side. 执行此操作后,我在收件人/发件人方面没有任何语气。 Calling to this giving me no effect (As its background processing is not visible ). 打电话给我没有效果(因为它的后台处理不可见)。 Can anyone please let me know how can I varify the same? 任何人都可以让我知道我怎样才能改变它? Also please explain me usage of second method sendDtmf(int code, Message result) . 另请解释我使用第二种方法sendDtmf(int code, Message result)

There are three main methods for sending DTMF with sip: 使用sip发送DTMF有三种主要方法:

  1. in-band RTP payloads 带内RTP有效载荷
  2. generated DTMF tones 生成DTMF音调
  3. sip info messages (outdated and most likely not used) sip信息消息(过时且很可能不使用)

Most likely it's using the in-band RTP payload packets. 最有可能的是它使用带内RTP有效载荷数据包。 Altho most sip stacks I know have some sort of option to select the type of DTMF to send. 虽然我知道大多数sip堆栈都有某种选择来选择要发送的DTMF类型。

Sorry I don't know anything about the inbuilt Android SIP stack, so I can't answer questions directly about there implementation. 对不起我对内置的Android SIP堆栈一无所知,所以我无法直接回答有关实现的问题。

What I would do to check that the DTMF is sent correctly is use something like WireShark to capture the RTP audio stream. 我要做的是检查DTMF是否正确发送是使用类似WireShark来捕获RTP音频流。 You can then use the wiresharks voip call graph analysis option which will display the DTMF events in the RTP! 然后,您可以使用wiresharks voip调用图分析选项,它将在RTP中显示DTMF事件!

VOIP调用图分析输出

The android.net.sip has support only for dtmf mode RFC 2883. You can easily see these messages with a software like wireshark and/or from your server side logs (or other peer logs). android.net.sip仅支持dtmf模式RFC 2883.您可以使用wireshark等软件和/或服务器端日志(或其他对等日志)轻松查看这些消息。 Just make sure that the other party has support for this kind of dtmf (RFC 2883 support). 只需确保对方支持这种dtmf(RFC 2883支持)。

I use Counterpath X-Lite V4.9.8 to help develop an Android OS SIP app using the native SIP library. 我使用Counterpath X-Lite V4.9.8来帮助使用本机SIP库开发Android OS SIP应用程序。 The X-Lite Softphone/Preferences/Calls should be set to "Send via RFC 2833". X-Lite Softphone / Preferences / Calls应设置为“通过RFC 2833发送”。

Once you have an active SIP call with bi-directional audio, and you use yourcall.sendDtmf(5), as an example, during that call, you can hear the DTMF tones via the X-Lite app, with the tones lasting about 1/2 second each. 一旦你有一个带有双向音频的有效SIP呼叫,并且你使用你的call.sendDtmf(5),作为一个例子,在那个呼叫期间,你可以通过X-Lite应用程序听到DTMF音调,音调持续约1 /每秒2秒。

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

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