Fair enough, I'll check it.<br><br>Thx Andrew!<font color="#888888"></font><br><br><div class="gmail_quote">On Wed, Oct 6, 2010 at 2:58 PM, Andrew Pogrebennyk <span dir="ltr"><<a href="mailto:andrew.pogrebennyk@portaone.com">andrew.pogrebennyk@portaone.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">David,<br>
Also if rewriting Contact with the opensips address is what you want to<br>
achieve, you should look no further than b2b_logic "top hiding"<br>
scenario: <a href="http://www.opensips.org/Resources/B2buaTutorial16#toc12" target="_blank">http://www.opensips.org/Resources/B2buaTutorial16#toc12</a><br>
<div><div></div><div class="h5"><br>
On 06.10.2010 14:15, Bogdan-Andrei Iancu wrote:<br>
> Hi David,<br>
><br>
> take when using such regexps as the contact hdr may have multiple syntaxes:<br>
> Contact: sip:user@domain<br>
> Contact: sip:user@domain;hdr_params<br>
> Contact:<sip:user@domain>;hdr_params<br>
> Contact:<sip:user@domain;uri_params>;hdr_params<br>
> Contact: "display"<sip:user@domain>;hdr_params<br>
> Contact: display<sip:user@domain>;hdr_params<br>
><br>
> etc....<br>
><br>
> So having a regexp to match all case may be difficult....better try to<br>
> focus only on the domain part, like matching the "@IP" part...., like<br>
> (Contact: .*@)[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}<br>
><br>
> Regards,<br>
> Bogdan<br>
><br>
> David Santiago wrote:<br>
>> Solved!<br>
>><br>
>> Adding a \r did the thing...<br>
>><br>
>> if ( subst('/^Contact:<sip:([0-9]+)@(.*)$/Contact:<br>
>> <sip:\1@NEW_IP_ADDRESS_HERE>\r/ig') ) {<br>
>> xlog("contact modified!");<br>
>> };<br>
>><br>
>> On Tue, Oct 5, 2010 at 6:34 PM, David Santiago<br>
>> <<a href="mailto:david.santiago@almiralabs.com">david.santiago@almiralabs.com</a><mailto:<a href="mailto:david.santiago@almiralabs.com">david.santiago@almiralabs.com</a>>><br>
>> wrote:<br>
>><br>
>> Hi all,<br>
>><br>
>> I need to modify the host part of a contact header. I'm trying<br>
>> something like:<br>
>><br>
>> if ( subst('/^Contact:<sip:([0-9]+)@(.*)$/Contact:<br>
>> <sip:\1@NEW_IP_ADDRESS_HERE>/ig') ) {<br>
>> xlog("contact modified!");<br>
>> };<br>
>><br>
>> but the resulting Contact header is wrong and cannot be processed.<br>
>><br>
>> Having a look at the header with wireshark shows that the "Contact<br>
>> Binding" entry is missing the ending ">", but the "Contact", "URI" or<br>
>> "SIP contact address" have the ">" at the end :L<br>
>><br>
>> May be this is not the right way to modify a Contact header...<br>
>><br>
>><br>
>> Thanks in advance,<br>
>> David<br>
<br>
--<br>
</div></div>Sincerely,<br>
<font color="#888888">Andrew Pogrebennyk<br>
</font><div><div></div><div class="h5"><br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
</div></div></blockquote></div><br>