[OpenSIPS-Users] NAT: Why replacing "Contact" with thereceivedpublic IP:port instead of adding a parameter with it?

Schumann Sebastian Sebastian.Schumann at t-com.sk
Fri Nov 7 14:24:31 CET 2008


Hi Inaki

Yes, you are right. Seems my changes work where they should (all same type of phones where modification has to take place, Contact header somehow "well-defined") but are not universal.

I will take your inputs to improve my used functions. Thanks!

Best regards
Sebastian

> -----Original Message-----
> From: users-bounces at lists.opensips.org 
> [mailto:users-bounces at lists.opensips.org] On Behalf Of Iñaki 
> Baz Castillo
> Sent: Friday, 07. November 2008 14:19
> Cc: users at lists.opensips.org
> Subject: Re: [OpenSIPS-Users] NAT: Why replacing "Contact" 
> with thereceivedpublic IP:port instead of adding a parameter with it?
> 
> 2008/11/7 Schumann Sebastian <Sebastian.Schumann at t-com.sk>:
> > Hi Inaki
> >
> > I have to change the IP in the contact field, using avps 
> and textops functions.
> >
> > $avp(s:contact) = $ct;
> > avp_subst("$avp(s:contact)", "/(.*)@.*(>.*)/\1 at 10.0.0.1:5060\2/");
> > remove_hf("Contact");
> > append_hf("Contact: $avp(s:contact)\r\n");
> >
> > Similarly, the regexp could check for the point to include 
> your parameter and put it there.
> >
> > Not so elegant though, but works fine for me.
> 
> Thanks, but I wonder if it works with valid Contact as follow:
> 
> Contact: sip:user at domain
> Contact: <sip:user at domain>
> Contact: "<<<HI at HI>>>" <sip:user at domain>
> 
> Also note that if Contact is:
>   Contact: sip:user at domain
> and you want to add a parameter to Contact URI (not Contact 
> header) then it must be converted to:
>   Contact: <sip:user at domain;new_param=xxx>
> 
> If it would be:
>   Contact: sip:user at domain;new_param=xxx then that param is a 
> HEADER param (not a URI param) and it wouldn't be include in 
> the RURI when generating an indialog request.
> 
> --
> Iñaki Baz Castillo
> <ibc at aliax.net>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
> 


More information about the Users mailing list