On 08.10.2020 16:40, Jeff Pyle wrote:

This loads the registered contacts as branches, which allows me to iterate through each and compare 1) the base URI from the inbound INVITE with the base URI of the registered contact, 2) the received IP and 3) the received port.  Assuming one matches, that's enough to satisfy me that we've received a message from a registered endpoint.  I'm calling this route on initial INVITEs and so far, so good.  There are optimizations that could occur, such as exiting the while loop once we've found a match, but at least this works.

Interesting use case!  Maybe we can formalize this into one or more extensions, so you can just call the appropriate functions.  Here are your current problems which must be addressed:

* is_ip_registered() is too imprecise, as it only takes the IP as input, while you'd want to match the URI and port as well. * is_contact_registered() is too precise, as it matches _everything_, including URI parameters which you'd like to skip.

I've put this problem on the bucket list for 3.2 :)  Cheers!

--
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