[OpenSIPS-Users] force_rtp_proxy content-length error

Bogdan-Andrei Iancu bogdan at voice-system.ro
Wed Sep 22 11:17:02 CEST 2010


Hi Paul,

Could you capture (ngrep,tcpdump) the INVITE that is causing this issue? 
Just to take a look at it. Be sure the capture does not loose the 
nonprintable chars (like ngpre use . (dot) char for that).

Regards,
Bogdan

Paul Smith wrote:
> Hi,
> I am struggling with a particular scenario using rtpproxy, nathelper and 
> opensips 1.6.3
>
> I have a Snom phone on a LAN behind a adsl router, connecting across the 
> internet to a public ip on an OpenSIPS server, and then routing through 
> rtpproxy bridge to an asterisk server inside a different LAN. 
>
>
> Snom phone ------- ADSL router ------ WWW -------- pub IP---- opensips & 
> rtpproxy bridge ------- asterisk on LAN
>
> Registration is to the OpenSIPs server and works fine.  Asterisk is 
> providing an echo service... the setup is closely based on "Building 
> Telephony Systems with OpenSIPs 1.6" with the additional constraint that 
> I do not want the media server to be publically accessible.
>
> It works fine if I turn off stun on the Snom, and use nathelper to 
> mangle the contact address. 
>
> If I turn on stun and then try to force_rtp_proxy I get the following error:
> Sep 14 16:52:25 echo /sbin/opensips[30442]: ERROR:core:get_all_bodies: 
> Message is shorter than indicated by content length: got 474 expected 476
> Sep 14 16:52:25 echo /sbin/opensips[30442]: 
> ERROR:nathelper:force_rtp_proxy: Unable to parse body
>
> I added a couple of xlog lines to my opensips.cfg to see what 
> conent-length is passed in the header, and also to see what length the 
> original received body was:
> relevant opensips.cfg
> route[6] {
>         xlog("L_INFO", "RTPPRoxy handling...\n");
>         # -- RTP Proxy Handling --#
>         if (is_method("BYE|CANCEL")){
>                 xlog("L_INFO", "Turn off RTPProxy...\n");
>                 unforce_rtp_proxy();
>         }
>         else if (is_method("INVITE")){
>                 #-- Activates the RTP Proxy for the CALLEE ---#
>                 xlog("L_INFO", "Turn on RTPProxy ...\n");
>                 if($avp(s:dest)=="media") {
>                         xlog ("routing rtp from external device to 
> internal server");
>                         #this works with stun off, but not stun on...
>                         #force_rtp_proxy("FAEI");
> *                        xlog("got message body $(rb{s.len}) with length 
> $cl");
>                         xlog("length $cl");*
>                         force_rtp_proxy("FAEI");
>
>                         t_on_reply("1");
>
>                 } else {
>                         xlog("routing rtp in and out on external 
> interface");
>                         xlog("got body $rb ");
>                         force_rtp_proxy("EE");
>                 }
>                 t_on_failure("1");
>         }
> }
>
>
> Log lines:
> Sep 14 16:52:25 echo /sbin/opensips[30442]: got message body 476 with 
> length 476
> Sep 14 16:52:25 echo /sbin/opensips[30442]: length 476
>
> I am obviously wrong but the way I read it the opensips server is 
> receiving an invite with content-length of 476.  476 is recorded in the 
> header, and 476 is the length of the received body $rb string....how did 
> core:get_all_bodies see a length of 474?
>
> Where should I look next?
>
> I am learning slowly how to debug opensips using ngrep, xlog etc but I 
> am definitely missing something here...
>
>
>
>   


-- 
Bogdan-Andrei Iancu
OpenSIPS Bootcamp
15 - 19 November 2010, Edison, New Jersey, USA
www.voice-system.ro




More information about the Users mailing list