PJSIP regcontext not working with realtime endpoints

Hi,

I am testing PJSIP (MariaDB) with DUNDi in our lab. I set regcontext in pjsip.conf:

[global]
;  SYNOPSIS: Options that apply globally to all SIP communications
;max_forwards=70        ; Value used in Max Forwards header for SIP requests
                        ; (default: "70")
type=global  ; Must be of type global (default: "")
regcontext=dolsipreg

But when I look up the context:

tempast1*CLI> dialplan show dolsipreg
There is no existence of 'dolsipreg' context
Command 'dialplan show dolsipreg' failed.

This is a lab setup with realtime via ODBC / MariaDB.
The endpoints have usernames, not numbers. This should not realy be a problem, as it is working fine in the dialplan(?).

Have the endpoints registered? Do they show up as being reachable in the console?

I think it is:

tempast1*CLI> core set verbose 99
Console verbose was OFF and is now 99.

[Login at client]

    -- Removed contact 'sip:sip102873@192.168.81.18:5060' from AOR 'sip102873' due to request
  == Contact sip102873/sip:sip102873@192.168.81.18:5060 has been deleted
  == Endpoint sip102873 is now Unreachable
    -- Added contact 'sip:sip102873@192.168.81.18:5060' to AOR 'sip102873' with expiration of 600 seconds
  == Contact sip102873/sip:sip102873@192.168.81.18:5060 has been created
  == Endpoint sip102873 is now Reachable
    -- Contact sip102873/sip:sip102873@192.168.81.18:5060 is now Unknown.  RTT: 0.000 msec

pjsip show endpoints:

 Endpoint:  sip102873                                            Not in use    0 of inf
     InAuth:  sip102873/sip102873
        Aor:  sip102873                                          1
      Contact:  sip102873/sip:sip102873@192.168.81.18:5060 643f58fd0a Unknown         nan
  Transport:  transport-udp             udp      0      0  0.0.0.0:5060

And what version of Asterisk are you using?

It is Asterisk 13.17.2 on Debian 9 Stretch.

Looking at the code I believe you have to create the context yourself. It won’t get created automatically.

Just checked and it works when I add
[dolsipreg]
to extensions.conf

I read that adding this context is not recommended, reading the docs for chan_sip also notes that it will be created by the channel module. In this case, PJSIP is no drop-in replacement for SIP.

We will now proceed with our tests but DUNDi lookup also shows a connection / mapping via IAX2 to the second server.

Thanks for your help!