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

Saúl Ibarra Corretgé saul at ag-projects.com
Thu Jul 21 08:59:01 CEST 2011


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






More information about the Users mailing list