[OpenSIPS-Users] Push Notification - lookup not returning 2

John Quick john.quick at smartvox.co.uk
Wed Jul 28 16:35:31 EST 2021

Using version 3.1.3. OpenSIPS is acting as a mid-registrar proxy.
The WebRTC client app registers okay and I'm sure it is being detected as a
PN enabled device during registration because the value of Flags is 4
(viewed from the CLI using "mi ul_dump") and the Feature-Caps header is
added to the 200 OK when it registers.
However, when I make a call towards the WebRTC device and
mid_registrar_lookup() is called, I was expecting it to return 2, but it
does not. It returns 1.
There is only one device registered on this test server.

This is the code in my script where the lookup is done:
    $log_level = 4;
    $var(rc) = $retcode;
    if ($var(rc) == 1) {
        # Destination is a registered user and at least one contact is not
PN enabled
        xlog("L_WARN", "     [$var(sectname)] Standard User
$var(myuser)@$var(mydom) was found in location table  Src=$pr:$si:$sp
    } else if ($var(rc) == 2) {
        # Destination is a registered user and all contacts are PN enabled
        xlog("L_WARN", "     [$var(sectname)] PN User
$var(myuser)@$var(mydom) was found in location table  Src=$pr:$si:$sp

It always reports "Standard User" in my log file.

...and this is what I get in the debug log:
2021-07-28 17:16:35  DBG:registrar:parse_lookup_flags: final flags: 1
2021-07-28 17:16:35  DBG:mid_registrar:mid_reg_lookup: getting ucontact from
contact_id 286330420458939875
2021-07-28 17:16:35  DBG:mid_registrar:pn_remove_uri_params: trimmed URI:
'sip:xzxfze2l at ncuz14613i0n.invalid;transport=wss'
2021-07-28 17:16:35  DBG:registrar:push_branch: setting msg R-URI
<sip:xzxfze2l at ncuz14613i0n.invalid;transport=wss>
2021-07-28 17:16:35  DBG:core:comp_scriptvar: int 20 : 1 / 1

One thought I had: Should mid_registrar_lookup() always return 2 for a
device that has Flags = 4? Or does it depend on whether the TCP network
connection to the device is still active?

John Quick
Smartvox Limited

More information about the Users mailing list