Pjsip notify with asterisk 13

I’m having problems getting the pjsip send notify to work. Sip notify was working for me in asterisk 11.

Here is what I send in CLI:

The response from asterisk:

Usage: pjsip send notify {endpoint|uri} […]
Send a NOTIFY request to an endpoint
Message types are defined in sip_notify.conf

Here is my pjsip_notify.conf and sip_notify.conf

[i][cisco-check-cfg]
Event=>check-sync

[cisco-reboot]
Event=>restart_now[/i]

Am I missing something?

Yup.

Try:

pjsip send notify cisco-reboot endpoint U_8399

Hum it does send the command but with a warning and the phone does not reboot:

Sending NOTIFY of type ‘cisco-reboot’ to ‘U_8399’
[Feb 27 15:51:31] WARNING[28289]: res_pjsip_outbound_authenticator_digest.c:125 digest_create_request_with_auth: Unable to create request with auth.No auth credentials for any realms in challenge.

Seems like when Asterisk is trying to send out the request, it’s getting back from PJSIP:

PJSIP_ENOCREDENTIAL - No suitable credential is found to authenticate the request against the received authentication challenge in 401/407 response. This often is caused by different realm supplied in the credential than the realm found in the challenge.

Do you have anything going on with realms?

Well not that I am aware of… I am just starting to convert my dialplan from asterisk 11 to 13 with the new channel driver. I am using realtime. So far it is going well except for this part.

I did a sip trace, so if anyone has any idea of what could be wrong in my settings…
Please let me know.
Could it be something missing in my database?

[code]-- Executing [*76@garneau-interne:1] NoOp(“PJSIP/U_9172-0000008b”, “”) in new stack
[Mar 2 14:43:46] – Executing [*76@garneau-interne:2] System(“PJSIP/U_9172-0000008b”, “asterisk -x ‘pjsip send notify cisco-reboot endpoint U_9172’”) in new stack
[Mar 2 14:43:46] <— Transmitting SIP request (491 bytes) to UDP:XX.XXX.X.XX:5061 —>
[Mar 2 14:43:46] NOTIFY sip:U_9172@XX.XXX.X.XX:5061 SIP/2.0
[Mar 2 14:43:46] Via: SIP/2.0/UDP XXX.XXX.XXX.XXX:5060;rport;branch=z9hG4bKPj1e8c1018-7f5c-4c88-bb7f-861104257c3f
[Mar 2 14:43:46] From: sip:82a3c7e5-0023-4a86-9bfb-585b755cee8e@XXX.XXX.XXX.XXX;tag=7d669434-ae90-42ac-8769-8e9c7554bd97
[Mar 2 14:43:46] To: sip:U_9172@XX.XXX.X.XX
[Mar 2 14:43:46] Contact: sip:82a3c7e5-0023-4a86-9bfb-585b755cee8e@XXX.XXX.XXX.XXX:5060
[Mar 2 14:43:46] Call-ID: ebccc9eb-78ba-4048-894d-32be25962544
[Mar 2 14:43:46] CSeq: 45560 NOTIFY
[Mar 2 14:43:46] Subscription-State: terminated
[Mar 2 14:43:46] Event: restart_now
[Mar 2 14:43:46] Content-Length: 0

<— Received SIP response (487 bytes) from UDP:XX.XXX.X.XX:5061 —>
[Mar 2 14:43:46] SIP/2.0 401 Unauthorized
[Mar 2 14:43:46] To: sip:U_9172@XX.XXX.X.XX;tag=1082aec96fecb6e0i0
[Mar 2 14:43:46] From: sip:82a3c7e5-0023-4a86-9bfb-585b755cee8e@XXX.XXX.XXX.XXX;tag=7d669434-ae90-42ac-8769-8e9c7554bd97
[Mar 2 14:43:46] Call-ID: ebccc9eb-78ba-4048-894d-32be25962544
[Mar 2 14:43:46] CSeq: 45560 NOTIFY
[Mar 2 14:43:46] Via: SIP/2.0/UDP XXX.XXX.XXX.XXX:5060;branch=z9hG4bKPj1e8c1018-7f5c-4c88-bb7f-861104257c3f
[Mar 2 14:43:46] Server: Cisco/SPA514G-7.5.6a
[Mar 2 14:43:46] WWW-Authenticate: Digest realm=“XXX.XXX.XXX.XXX”, nonce=“d7502b9”, qop=“auth”, algorithm=md5
[Mar 2 14:43:46] Content-Length: 0
[Mar 2 14:43:46]
[Mar 2 14:43:46]
[Mar 2 14:43:46] WARNING[10050]: res_pjsip_outbound_authenticator_digest.c:125 digest_create_request_with_auth: Unable to create request with auth.No auth credentials for any realms in challenge.
[Mar 2 14:43:46] > 0x7fe150019830 – Probation passed - setting RTP source address to XX.XXX.X.XX:16410
[Mar 2 14:43:46] – <PJSIP/U_9172-0000008b> Playing ‘Tele_Redemarera.slin’ (language ‘fr’)
[Mar 2 14:43:46] <— Received SIP request (655 bytes) from UDP:XX.XXX.X.XX:5061 —>
[Mar 2 14:43:46] ACK sip:XXX.XXX.XXX.XXX:5060 SIP/2.0
[Mar 2 14:43:46] Via: SIP/2.0/UDP XX.XXX.X.XX:5061;branch=z9hG4bK-5d61ce29
[Mar 2 14:43:46] From: sip:U_9172@XXX.XXX.XXX.XXX;tag=f75812daf7789474o0
[Mar 2 14:43:46] To: sip:*76@XXX.XXX.XXX.XXX;tag=9fb58def-e7f2-4cb2-801e-fbfc5dad28cd
[Mar 2 14:43:46] Call-ID: b592c752-1dccaa5c@XX.XXX.X.XX
[Mar 2 14:43:46] CSeq: 102 ACK
[Mar 2 14:43:46] Max-Forwards: 70
[Mar 2 14:43:46] Authorization: Digest username=“U_9172”,realm=“asterisk”,nonce=“1425325426/627e491e8202999347af9bf68754216b”,uri=“sip:*76@XXX.XXX.XXX.XXX”,algorithm=MD5,response=“112cd1b599f5b1b0066e7c85d1bd339a”,opaque=“2932fedc4e54fe5a”,qop=auth,nc=00000001,cnonce=“f7b774f4”
[Mar 2 14:43:46] Contact: sip:U_9172@XX.XXX.X.XX:5061
[Mar 2 14:43:46] User-Agent: Cisco/SPA514G-7.5.6a
[Mar 2 14:43:46] Content-Length: 0[/code]

I ran into this when the "Digest realm=“xxxxxxx” part was not in my identity for my endpoint. My problem is going to be I need 4 realms but PJSIP only seems to handle one.

It was a bug in asterisk, that was fixed later on.