[SR-Users] RTPproxy in bridge mode question

Ovidiu Sas osas at voipembedded.com
Fri Apr 30 22:26:46 CEST 2010


It sucks to deal with broken SIP implementation on the carrier side.
Here's one thing that you can try.  You can encode the contact:
http://kamailio.org/docs/modules/stable/modules_k/siputils.html#id2596873
Like this you will have the public IP in the Contact header.  Then,
for all subsequent in-dialog request, you check if the RURI is encoded
and you decode and then route normally.
http://kamailio.org/docs/modules/stable/modules_k/siputils.html#id2587362
I was using this method with success with several switches.
Hope this helps.

Regards,
Ovidiu Sas


On Fri, Apr 30, 2010 at 4:10 PM, Uriel Rozenbaum
<uriel.rozenbaum at gmail.com> wrote:
> Daniel,
>
> Maybe my question is silly, but in this case the contact should remain
> intact? (I mean in bridge mode).
> I understand the destination UA should read the Record-route Headers and
> ignore the contents of the Contact Header, but I think this is not what´s
> happening.
>
> I'm not using force_socket because the gateway already knows how to route
> the calls and I'm detecting the outgoing interface before calling
> force_rtp_proxy with flags.
>
> Should I replace the contact using REGEX?
>
> Thanks,
> Uriel
>
> On Fri, Apr 30, 2010 at 3:03 PM, Daniel-Constantin Mierla
> <miconda at gmail.com> wrote:
>>
>> Hello,
>>
>> it might not be the solution, because they should route based on
>> Record-Route headers, not on Contact header. Anyhow changing the Contact
>> will break the routing, so you will need to store somehow the original
>> contact.
>>
>> You can do manual detection in case you do bridging, by checking the
>> receiving interface, $Ri is the local IP where the request was received,
>> therfore you will be sending on the other interface. Are you doing force
>> send socket to select outgoing interface? If yes, then is where you know the
>> local ip for sending.
>>
>> Cheers,
>> Daniel
>>
>>
>> On 4/30/10 6:32 PM, Uriel Rozenbaum wrote:
>>
>> Guys,
>>
>> I'm successfully using a Kamailio + RTPproxy setup in bridge mode with
>> most of my Gateways. My setup includes two different interfaces one with a
>> public IP and teh other with the private IP.
>>
>> Now I'm facing some slight issue. Some providers won't accept my calls (or
>> calls will have some strange behavior) if the Contact header has an IP out
>> of immediate range.
>>
>> I tried to use fix_nated_contact() function but as per my topology, this
>> function will not change the contact header because the IP is already the
>> one on the interface.
>>
>> Example:
>> U 192.168.200.X:5060 -> 192.168.200.Y:5060
>> INVITE sip:111160911097 at 192.168.200.Y SIP/2.0.
>> Via: SIP/2.0/UDP 192.168.200.X:5060;branch=z9hG4bK096baacc;rport.
>> From: "Uriel Rozenbaum" <sip:60911100 at 192.168.200.X>;tag=as32794d5e.
>> To: <sip:111160911097 at 192.168.200.Y>.
>> Contact: <sip:60911100 at 192.168.200.X>.
>>
>> U 200.A.A.A:5060 -> 200.B.B.B:5060
>> INVITE sip:898960911097 at 200.B.B.B SIP/2.0.
>> Record-Route: <sip:200.A.A.A;r2=on;lr=on;ftag=as32794d5e>.
>> Record-Route: <sip:192.168.200.Y;r2=on;lr=on;ftag=as32794d5e>.
>> Via: SIP/2.0/UDP 200.A.A.A;branch=z9hG4bK5222.14fbf4f7.0.
>> Via: SIP/2.0/UDP
>> 192.168.200.X:5060;received=192.168.200.X;branch=z9hG4bK096baacc;rport=5060.
>> From: "Uriel Rozenbaum" <sip:60911100 at 192.168.200.X>;tag=as32794d5e.
>> To: <sip:111160911097 at 192.168.200.Y>.
>> Contact: <sip:60911100 at 192.168.200.X>.
>>
>> Is there any way to let know Kamailio the outgoing IP I'll be using and
>> fix the contact accordingly?
>> I can trigger this change after I know the destination IP.
>>
>> Thanks!
>> Uriel
>>
>>
>> _______________________________________________
>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
>> sr-users at lists.sip-router.org
>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>
>>
>> --
>> Daniel-Constantin Mierla
>> * http://www.asipto.com/
>> * http://twitter.com/miconda
>> * http://www.linkedin.com/in/danielconstantinmierla
>
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
>




More information about the sr-users mailing list