Quantcast

Re: Broken Loose Routing?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Broken Loose Routing?

Brett Nemeroff
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@64.174.184.141:5060;maddr=\2>/ig');

That mostly worked, but produced a header that looks like this:
Contact: <sip:5122033884@64.174.184.141:5060;maddr=10.10.67.190>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: [hidden email].
CSeq: 1 INVITE.
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 <[hidden email]> 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@privIP> -> Contact: <sip:user@server_pub_IP;maddr=privIP>

BYE: RURI= sip:user@server_pub_IP;maddr=privIP  -> RURI=sip:user@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 <[hidden email] <mailto:[hidden email]>> wrote:

   On Thursday 30 October 2008, Iñaki Baz Castillo wrote:
   > 2008/10/30 Brett Nemeroff <[hidden email]
   <mailto:[hidden email]>>:

   > > 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> ->
   195.62.163.131:5060 <http://195.62.163.131:5060>

   > INVITE sip:17475551212@195.62.163.131:5060;transport=udp SIP/2.0.
   > Contact: <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@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
   [hidden email] <mailto:[hidden email]> ------------------------------------------------------------------------


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
 



_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Broken Loose Routing?

Bogdan-Andrei Iancu
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@64.174.184.141:5060;maddr=\2>/ig');
>
> That mostly worked, but produced a header that looks like this:
> Contact: <sip:5122033884@64.174.184.141:5060;maddr=10.10.67.190
> <http://10.10.67.190>>sip:5125551212@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@10.10.67.190
> <mailto:19380521914112008222455@10.10.67.190>.
> CSeq: 1 INVITE.
> sip:5125551212@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
> <[hidden email] <mailto:[hidden email]>> 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@privIP> -> Contact:
>     <sip:user@server_pub_IP;maddr=privIP>
>
>     BYE: RURI= sip:user@server_pub_IP;maddr=privIP  ->
>     RURI=sip:user@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
>         <[hidden email] <mailto:[hidden email]>
>         <mailto:[hidden email] <mailto:[hidden email]>>> wrote:
>
>            On Thursday 30 October 2008, Iñaki Baz Castillo wrote:
>            > 2008/10/30 Brett Nemeroff <[hidden email]
>         <mailto:[hidden email]>
>            <mailto:[hidden email] <mailto:[hidden email]>>>:
>
>            > > 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@195.62.163.131:5060;transport=udp
>         SIP/2.0.
>            > Contact: <sip:15125551234@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@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
>            [hidden email] <mailto:[hidden email]>
>         <mailto:[hidden email]
>         <mailto:[hidden email]>>
>
>            http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
>         ------------------------------------------------------------------------
>
>
>
>         _______________________________________________
>         Users mailing list
>         [hidden email] <mailto:[hidden email]>
>         http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>          
>
>
>


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Broken Loose Routing?

Brett Nemeroff
No, I'm not.  I'm not sure what to do to completely remove the contact. Am I doing something wrong?

In a related problem... if I use remove_hf and insert_hf, it leaves the partial header without the "Contact" bit and angle brackets, and inserts a properly formatted Contact header. The call still completes. However, the 200 OK that comes back never seems to "work". The call never sets up. I'm not sure there is any point in troubleshooting without the headers being right. Right now I'm only doing this fix on INVITEs coming from the inside network.


On Wed, Nov 5, 2008 at 2:24 AM, Bogdan-Andrei Iancu <[hidden email]> wrote:
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@64.174.184.141:5060;maddr=\2>/ig');

That mostly worked, but produced a header that looks like this:
Contact: <sip:5122033884@64.174.184.141:5060;maddr=10.10.67.190 <http://10.10.67.190>>sip:5125551212@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: [hidden email] <mailto:[hidden email]>.
CSeq: 1 INVITE.
sip:5125551212@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 <[hidden email] <mailto:[hidden email]>> 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@privIP> -> Contact:
   <sip:user@server_pub_IP;maddr=privIP>

   BYE: RURI= sip:user@server_pub_IP;maddr=privIP  ->
   RURI=sip:user@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
       <[hidden email] <mailto:[hidden email]>
       <mailto:[hidden email] <mailto:[hidden email]>>> wrote:

          On Thursday 30 October 2008, Iñaki Baz Castillo wrote:
          > 2008/10/30 Brett Nemeroff <[hidden email]
       <mailto:[hidden email]>
          <mailto:[hidden email] <mailto:[hidden email]>>>:


          > > 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@195.62.163.131:5060;transport=udp
       SIP/2.0.
          > Contact: <sip:15125551234@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@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
          [hidden email] <mailto:[hidden email]>
       <mailto:[hidden email]
       <mailto:[hidden email]>>

          http://lists.opensips.org/cgi-bin/mailman/listinfo/users


       ------------------------------------------------------------------------



       _______________________________________________
       Users mailing list
       [hidden email] <mailto:[hidden email]>
       http://lists.opensips.org/cgi-bin/mailman/listinfo/users
       





_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Loading...