[SR-Users] [REGISTRAR] Registered. How to match $sut to usrloc received ?

Richard Edmands thesirdmz at gmail.com
Wed Jul 27 15:03:28 CEST 2022


Hey Kamailio Users,

So the scenario is we get the registers. Load them, slightly oddly as
we also fill in the received section, not something I usually do.

Then when they send an invite, the To and From headers are real phone
numbers and for some reason the contact header isn't their username.
So to compensate for that I'm trying to match their connection ($sut)
using registered, but after a couple of hours I haven't been able to
get it to match up. Not sure what I'm missing.

ul.dump gets me
Received: sip:sipclientpublicip:2353;transport=udp
so we know that part is loading $sut correctly into the user location data.

modparam("usrloc", "matching_mode", 2)
modparam("registrar", "xavp_rcd", "ulrcd")
modparam("registrar", "received_avp", "$avp(i:42)")

                $xavp(regcfg=>match_received) = $sut;
                if (registered("location","$sut", 2, 1)) {

After that block of code $sut is sip:
sipclientpublicip:2353;transport=udp which is what's in usrloc for
received, but it's not match.

There's probably a much smarter way of doing this that I've completely
missed, if so then that'd be excellent. But if I'm on the right path
somewhat then it would be great to get this working.



More information about the sr-users mailing list