[OpenSIPS-Users] media-proxy invalid IP in sdp

Pasan Meemaduma pasandev at ymail.com
Thu Jul 21 09:26:45 CEST 2011


HI Saul,

Thanks for confirming. :)


So Shall I use  fix_nated_sdp("1"); or comment out use of   fix_nated_sdp("3"); to fix the problem.

This wont affect anything I guess since it's a incorrect configuration .

Thanks



________________________________
From: Saúl Ibarra Corretgé <saul at ag-projects.com>
To: Pasan Meemaduma <pasandev at ymail.com>
Cc: OpenSIPS users mailling list <users at lists.opensips.org>
Sent: Thursday, July 21, 2011 12:29 PM
Subject: Re: [OpenSIPS-Users] media-proxy invalid IP in sdp

Hi,

On Jul 21, 2011, at 8:50 AM, Pasan Meemaduma wrote:

> HI Saul,
> 
> Further I have below in my config , Is this cause the problem ?
> 
> 
>    if (loose_route()) {
>         if(!has_totag()) {
>             sl_send_reply("403", "Initial loose-routing rejected");
>             exit;
>         }
> 
>         if(nat_uac_test("19") || search("^Route:.*;nat=yes")) {
>             if(!search("^Content-Length:[ ]*0")) {
>                 fix_nated_sdp("3");
>                 setbflag(2);
>             }
>         }
>         append_hf("P-hint: rr-enforced\r\n");
>         route(1);
>     }
> 
> Is fix_nated_sdp() cause source address being append to sdp and media proxy ip 58.96.1.2 is append by use_media_proxy() ?
> 

Yes, indeed. Using both fix_nated_sdp and use_media_proxy will modify the same SDP field and because of how modifications are applied to messages by OpenSIPS, you'll end up with a mess.

When a function modifies a message it doesn't really apply the modification right away, it appends a 'lump', imagine its a modification marker, and later, when the message is about to be sent out, all modifications are applied. Because you are calling fix_nated_sdp *and* use_media_proxy, two lumps will be added and both modify the c line in the SDP -> bad thing.

> If this is the case how can I fix the config. Will commenting out  fix_nated_sdp("3"); fix the problem.
> 

If you use MediaProxy stick to the functions provided by the MediaProxy module, when it comes to modifying the SDP. You may also use the engage_mediaproxy function, which uses the dialog module to internally call use_media_proxy and end_media_session so you don't need to call them manually.


Regards,

--
Saúl Ibarra Corretgé
AG Projects
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20110721/efbcd4f1/attachment.htm>


More information about the Users mailing list