Asterisk PJSIP Realtime ps_contacts gets deleted automatically

I need to have redundancy for asterisk and to achieve that I am using Asterisk Pjsip Realtime. I have deployed 3 asterisk behind Nginx. All using same database. I have created endpoints (1724540484) in ps_endpoints with respective auth and aor in ps_auths & ps_aors respectively.

So any endpoint can register on any of the asterisk.
If my endpoint is connected to Asterisk 1 (let’s assume), the endpoint contact is populated in ps_contacts table and able to take calls normally.

If I kill the Asterisk 1 manually and then the endpoint (1724540484) automatically send register request to other asterisk (say ASTERISK 2) and makes a webSocket connection and OPTIONS Packet are also being exchanged normally.
Now if I call this endpoint, the DIAL app fails and show
No devices or endpoints to dial (technology/resource)
Also, there is no entry in ps_contacts for endpoint (1724540484)


exten => _XXXXXXXXXX,1,Log(DEBUG, Caller ID: ${CALLERID(all)}, Agent STATE: ${DEVICE_STATE(PJSIP/${EXTEN})})
 same => n(NOT_INUSE),Set(CALLERID(name)==${PJSIP_HEADER(read,P-Asserted-Identity):4})
 same => n,Dial(${PJSIP_DIAL_CONTACTS(${EXTEN})}, 15)
 same => n,Goto(${DIALSTATUS})


[2024-02-13 16:07:23.713] VERBOSE[3692965][C-00000001] pbx.c: Executing [1724540484@OBD_Context:1] Log("PJSIP/1512101-00000000", "DEBUG, Caller ID: "" <1512101>, STATE: NOT_INUSE") in new stack
[2024-02-13 16:07:23.713] DEBUG[3692965][C-00000001] Ext. 1724540484:  Caller ID: "" <1512101>, STATE: NOT_INUSE
[2024-02-13 16:07:23.713] VERBOSE[3692965][C-00000001] pbx.c: Executing [1724540484@OBD_Context:2] GotoIf("PJSIP/1512101-00000000", "1?NOT_INUSE:NOT_INUSE") in new stack
[2024-02-13 16:07:23.714] VERBOSE[3692965][C-00000001] pbx_builtins.c: Goto (OBD_Context,1724540484,3)
[2024-02-13 16:07:23.714] VERBOSE[3692965][C-00000001] pbx.c: Executing [1724540484@OBD_Context:3] Set("PJSIP/1512101-00000000", "CALLERID(name)==1204450214") in new stack
[2024-02-13 16:07:23.722] VERBOSE[3692965][C-00000001] pbx.c: Executing [1724540484@OBD_Context:4] Dial("PJSIP/1512101-00000000", ", 15") in new stack
[2024-02-13 16:07:23.722] VERBOSE[3692965][C-00000001] app_dial.c: **No devices or endpoints to dial (technology/resource)**
[2024-02-13 16:07:23.722] VERBOSE[3692965][C-00000001] pbx.c: Executing [1724540484@OBD_Context:5] Goto("PJSIP/1512101-00000000", "CHANUNAVAIL") in new stack
[2024-02-13 16:07:23.722] VERBOSE[3692965][C-00000001] pbx_builtins.c: Goto (OBD_Context,1724540484,7)
[2024-02-13 16:07:23.722] VERBOSE[3692965][C-00000001] pbx.c: Executing [1724540484@OBD_Context:7] Log("PJSIP/1512101-00000000", "DEBUG, Channel Unavailable") in new stack
[2024-02-13 16:07:23.722] DEBUG[3692965][C-00000001] Ext. 1724540484:  Channel Unavailable
[2024-02-13 16:07:23.722] VERBOSE[3692965][C-00000001] pbx.c: Executing [1724540484@OBD_Context:8] Hangup("PJSIP/1512101-00000000", "34") in new stack
[2024-02-13 16:07:23.722] VERBOSE[3692965][C-00000001] pbx.c: Spawn extension (OBD_Context, 1724540484, 8) exited non-zero on 'PJSIP/1512101-00000000'

I would suggest enabling debug[1] and looking at the decisions being made.

[1] Collecting Debug Information - Asterisk Documentation

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.