[OpenSIPS-Users] force_rtp_proxy content-length error

Paul Smith Paul.Smith at ClarityTele.com
Tue Sep 14 18:16:18 CEST 2010


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...



-- 
*Paul Smith | Technical Director | Clarity Telecom*
Number One, Lanyon Quay, Belfast, BT1 3LG
Phone: 	0800 91 21 000 | 1800 855 111
FAX: 	0800 91 21 999 | 1800 855 112
Email: 	Paul.Smith at ClarityTele.com
Web: 	http://www.ClarityTele.com




More information about the Users mailing list