On 07.10.2020 21:15, Jeff Pyle wrote:
At call time:

  $ct = <sip:[email protected] <mailto:sip%3A%[email protected]>>
  $ct.fields(uri) = sip:+12162450000@[PUBLIC_IP]:8490

Am I expecting the wrong thing?

Absolutely not.  You actually discovered an interesting, wacky effect of fix_nated_contact(), which does an in-place replacement of the private Contact with the public IP that has sourced the INVITE.  However, the original header pointers and data still stay unchanged (!!), hence why each variable now returns different pieces of data...

To mitigate this effect, just make a backup of that $ct.fields(uri) value earlier in the INVITE processing, before calling fix_nated_contact().


The only difference between $ct and the registered Contact is that $ct is wrapped in <>.  I wrote a nasty regex to strip the <> characters and it works with is_contact_registered(), at least from this phone.

Probably $(ct{nameaddr.uri}) would have gotten the job done as well, however I'm not so sure it's equipped to ignore Contact header field parameters -- which makes the regexp-based approach more solid.

--
Liviu Chircu
www.twitter.com/liviuchircu | www.opensips-solutions.com

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

Reply via email to