[置顶] Csipsimple Or Imsdroid :invite message too long for 3g - it gets fragmented

     在研究voip方面时,有些人发现切换到某些网络情况下,语音视频通话会有问题,Invite包对方无法接收,无法正常建立通话,但是可以正常注册,这时候我们应该考虑下是不是Invite包没有发送出去,获取发送出去对方无法正常接收?首先查看服务器Sip报文消息,发现几乎同一时刻有很多个Invite包,但是就是始终没返回100 Trying或者180 Ring、200 OK数据包回来,是不是觉得很奇怪!我们这时候就需要看下为什么Sip客户端会发送如此多的Invite包?如果确认代码没问题,这时候应该抓包看看,我们抓下包看看:

[置顶] Csipsimple Or Imsdroid :invite message too long for 3g - it gets fragmented_第1张图片

我了勒个去,什么情况!看到关键字木有:Fragmented。google之:


问题原因找到了。Sip的Invite包太大了,超过路由器的MTU大小,被路由Fragmented。接收端根本无法识别到!我们搜索下开源项目的issues,发现这个问题大有人在。

https://code.google.com/p/imsdroid/issues/detail?id=101


Reported by  [email protected]Nov 11, 2010
What steps will reproduce the problem?
1. start video call on 3g network
2. invite message gets fragmented on Dell Streak 3g interface
3. if only voice call is started, invite message is short and doesnot get fragmented

What is the expected output? What do you see instead?

invite message gets fragmented on Dell Streak 3g interface

What version of the product are you using? On what operating system?

latest version. Android 2.2

Please provide any additional information below.

if  we can shorten the invite message , packet will not be bigger than MTU and won't be fragmented.

Nov 12, 2010
#1 [email protected]
Is TCP support under consideration?
Nov 12, 2010
Project Member #2 [email protected]
(No comment was entered for this change.)
Status: Accepted 
Nov 12, 2010
#3 [email protected]
extra notes:

I tried decreasing packet size by only adding 1 video 1 audio codec.
Also disabled all QoS options.
Unfortunately packet size is still big.

TCP is not supported on my proxy server.


Nov 18, 2010
#4 [email protected]
Hi,

Any news on this ?

Btw, I am willing to change my 3g interface MTU settings. But  I don't know how.
How can I see the current mtu setting and change it ?

May 3, 2011
#5 [email protected]
hi there,

any update about this ?

May 4, 2011
#6 [email protected]
maybe we could have better chance in Imsdroid 2.
But is there a compiled version of Imsdroid 2 with codec g729 ?

Dec 28, 2011
#7 [email protected]
I also found this problem! the invite message is too long to transfer to ims client is 3G network. you can solve this problem by reduce the length of invite packets through removing of the useless infomation added by imsdroid. The other resolution is using sip message compression to make message not exceed MTU or using the two methos at the same time. I have tried and successed, good luck to you! 
Dec 7, 2012
#8 [email protected]
hi qiufei230

can you guide us how did you reduce the length of the INVITE message.
As we dont have access to the ngn stack related code we are unable to reduce the INVITE length for imsdroid.
Will appreciate any help on this

 

我们可以总结出解决方法1、路由器MTU大小设置:不切实际

                                            2、限制Invite包大小,尽量减少不必要的参数传递,特别是SDP部分,我做Csipsimple就是简单的去掉其他编码,只保留一个语音编码Silk,去掉不必要的头部,减少SDP包。而IMSDroid通过去掉Header部分不需要的东西,但是发现这样还不够的,IMSdroid的SDP包太大了,仅仅去掉Invite的头部行不通,还需要编译Doubango源码,修改SDP包信息传递,去掉不必要的东西。

[置顶] Csipsimple Or Imsdroid :invite message too long for 3g - it gets fragmented_第2张图片



[置顶] Csipsimple Or Imsdroid :invite message too long for 3g - it gets fragmented_第3张图片
重新编译成so,

编译IMSDroid重新发起邀请,截包看Invite大小:
[置顶] Csipsimple Or Imsdroid :invite message too long for 3g - it gets fragmented_第4张图片
包明显减少很多,并且正常接通。
看过Linphone,接口比较多,有一个设置MTU的接口,不需要编译底层既可成功解决。
                3、改用TCP传输或者使用SipComp(信令压缩技术),SipComp这个IMSDroid有这个功能选项,但是貌似用不了,有问题,各位尝试下。

你可能感兴趣的:(android,voip,MTU,SDP,Imsdroid)