Android pjsip DTMF代码不发送

时间:2014-06-23 13:39:35

标签: android sip pjsip dtmf

从这里找到的示例开始:https://trac.pjsip.org/repos/wiki/Getting-Started/Android,我设法构建并运行pjsua2示例应用程序。

问题在于我无法发送DTMF代码,它们出现在logcat中,但它们根本没有发送(我使用wireshark检查过)。一旦呼叫状态得到确认,我就会尝试发送DTMF代码,如下所示:

currentCall.dialDtmf("123#");

currentCall.dialDtmf("1");
currentCall.dialDtmf("2");
currentCall.dialDtmf("3");
currentCall.dialDtmf("#");

如果我发送这些代码,服务器应该开始播放声音,所以我有一些反馈说明代码是正确发送的。问题不在服务器端,因为我已经测试了其他第三方应用程序。

我也试过以下但没有运气:

OnDtmfDigitParam dtmfDigitParam = new OnDtmfDigitParam();
dtmfDigitParam.setDigit("1");
currentCall.onDtmfDigit(prm);

还有其他想法吗?

编辑:我认为它与RTP有关?该库似乎没有响应服务器的消息(RTP g711A - 这是在ACK @call建立/确认之后发送的)它发送到Android应用程序。

谢谢!

2 个答案:

答案 0 :(得分:1)

检查您的服务器接受哪种类型的DTMF。

Pjsua2 dialDtmf方法将使用RFC 2833有效载荷格式将DTMF数字发送到远程。

您可以在wireshark中将DTMF数据包视为RTP事件。

请参阅以下链接以供参考......

http://www.pjsip.org/docs/book-latest/html/call.html

答案 1 :(得分:0)

基于pjsip doc

PJSIP will only send RFC 2833 DTMF to remote if remote has indicated its capability to accept RFC 2833 events in its SDP. This is done by putting this line in the SDP:

a=rtpmap:101 telephone-event/8000

因此,您需要确保被叫方具有RFC 2833功能并在SDP中附加电话事件。