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