[OpenSIPS-Users] Broken Loose Routing?

Bogdan-Andrei Iancu bogdan at voice-system.ro
Wed Nov 5 09:24:59 CET 2008


Hi Brett,

are you doing any other changes on Contact hdr? like calling 
fix_nated_contact() or other function that might change the contact?

Regards,
Bogdan

Brett Nemeroff wrote:
> Ok, I feel really silly. I've tried a dozen ways to rewrite the 
> contact header.. Over and over it doesn't work. 
> First I tried to replace the contact header (which is how I wanted to 
> do it):
> subst('/^Contact: <sip:([0-9]+)@(.*)$/Contact: 
> <sip:\1 at 64.174.184.141:5060;maddr=\2>/ig');
>
> That mostly worked, but produced a header that looks like this:
> Contact: <sip:5122033884 at 64.174.184.141:5060;maddr=10.10.67.190 
> <http://10.10.67.190>>sip:5125551212 at 10.10.67.190:5060 
> <http://sip:5125551212@10.10.67.190:5060>
>
> In other words, it removed the angle braces from the original header, 
> and put the substituted text before it. But it didn't remove the 
> header, which matches the pattern
>
> I've even tried doing: 
> subst('/^Contact:.*$//');
> and
> remove_hf("Contact");
>
> Both just removed the header field, but left the contents, WITHOUT the 
> angle braces (see the line without a header FIELD):
> Call-ID: 19380521914112008222455 at 10.10.67.190 
> <mailto:19380521914112008222455 at 10.10.67.190>.
> CSeq: 1 INVITE.
> sip:5125551212 at 10.10.67.190:5060 <http://sip:5125551212@10.10.67.190:5060>
> Supported: em,100rel,timer,replaces,path,early-session,resource-priority.
> Allow: 
> REGISTER,OPTIONS,INVITE,ACK,CANCEL,BYE,NOTIFY,PRACK,REFER,INFO,SUBSCRIBE,UPDATE.
>
> I'm sure I must be doing something wrong. Is there a "right way" to 
> change the contact header? Perhaps it's not something I can change 
> with the standard toolset?
>
> -Brett
>
> On Thu, Oct 30, 2008 at 10:22 AM, Bogdan-Andrei Iancu 
> <bogdan at voice-system.ro <mailto:bogdan at voice-system.ro>> wrote:
>
>     Hi Brett,
>
>     Not sure you can do anything about - they detect you as behind nat
>     because of the private IP in Contact....
>
>     What you can do is to try  (before sending the INVITE to the
>     provider) to save the current contact IP in a uri param and to
>     replace the contact IP with your own....Something like maddr
>
>     When you get a sequential request , before loose_route(), replace
>     the RURI IP with the value from param.
>
>     Something like:
>
>     INVITE  :    Contact: <sip:user at privIP> -> Contact:
>     <sip:user at server_pub_IP;maddr=privIP>
>
>     BYE: RURI= sip:user at server_pub_IP;maddr=privIP  ->
>     RURI=sip:user at privIP
>
>
>     Regards,
>     Bogdan
>
>     Brett Nemeroff wrote:
>
>         We're actually getting this problem sending calls to multiple
>         providers.. is there possibly anything I'm dong that could be
>         causing this?
>         Thanks all,
>         Brett
>
>
>
>         On Thu, Oct 30, 2008 at 11:08 AM, Alex Hermann
>         <alex at speakup.nl <mailto:alex at speakup.nl>
>         <mailto:alex at speakup.nl <mailto:alex at speakup.nl>>> wrote:
>
>            On Thursday 30 October 2008, Iñaki Baz Castillo wrote:
>            > 2008/10/30 Brett Nemeroff <brett at nemeroff.com
>         <mailto:brett at nemeroff.com>
>            <mailto:brett at nemeroff.com <mailto:brett at nemeroff.com>>>:
>
>            > > Please note, the provider isn't sending the BYE to the
>            internal address.
>            > > The provider sends it to OpenSIPs Public address. Which is
>            correct..
>            >
>            > No, that's not correct, the RURI of the BYE from provider
>         *MUST* be
>            > the same as the RURI in the INVITE Contact the provider
>         received.
>            > The BYE is sent back to the public IP, of course, but
>         it's routed
>            > thanks to "Route" header (loose route).
>            >
>            > This is the INVITE OpenSIPS sends to the provider:
>            >
>            > U 62.175.182.141:5060 <http://62.175.182.141:5060>
>         <http://62.175.182.141:5060> ->
>            195.62.163.131:5060 <http://195.62.163.131:5060>
>         <http://195.62.163.131:5060>
>
>            > INVITE sip:17475551212 at 195.62.163.131:5060;transport=udp
>         SIP/2.0.
>            > Contact: <sip:15125551234 at 10.10.67.190:5060
>         <http://sip:15125551234@10.10.67.190:5060>
>            <http://sip:15125551234@10.10.67.190:5060>>.
>
>            >
>            > And this is the BYE the provider sends to OpenSIPS:
>            >
>            > BYE sip:15125551234 at 62.175.182.141:5060
>         <http://sip:15125551234@62.175.182.141:5060>
>            <http://sip:15125551234@62.175.182.141:5060> SIP/2.0.
>
>
>            Most probably the provider does wrong NAT detection. ie it does
>            the equivalent
>            of:
>
>            if (nat_uac_test("1")) {
>                   fix_nated_contact();
>            }
>            t_relay();
>
>
>            --
>            Met vriendelijke groet,
>
>
>            Alex Hermann
>            SpeakUp
>            T: 088-SPEAKUP (088-7732587)
>            F: 088-7732588
>
>            _______________________________________________
>            Users mailing list
>            Users at lists.opensips.org <mailto:Users at lists.opensips.org>
>         <mailto:Users at lists.opensips.org
>         <mailto:Users at lists.opensips.org>>
>
>            http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
>         ------------------------------------------------------------------------
>
>
>
>         _______________________________________________
>         Users mailing list
>         Users at lists.opensips.org <mailto:Users at lists.opensips.org>
>         http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>          
>
>
>




More information about the Users mailing list