[OpenSIPS-Users] can't get is_contact_registered() to return true
liviu at opensips.org
Thu Oct 8 13:46:21 EST 2020
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!
www.twitter.com/liviuchircu | www.opensips-solutions.com
More information about the Users