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

Iñaki Baz Castillo ibc at aliax.net
Fri Nov 7 14:18:42 CET 2008


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>


More information about the Users mailing list