PJSIP send notify

Having an issue with sending a notify to an extension. PJSIP extension 119, sending the below command:

pjsip send notify polycom-check-cfg uri sip:[email protected]_WAN_IP:16594;x-ast-orig-host=PHONE_LAN_IP:5060

The response in the asterisk CLI that I get is:

Sending NOTIFY of type 'polycom-check-cfg' to 'sip:[email protected]_WAN_IP:16594;x-ast-orig-host=PHONE_LAN_IP:5060'
[2022-07-12 16:18:13] ERROR[9627]: res_pjsip_outbound_authenticator_digest.c:447 digest_create_request_with_auth: Host: 'PHONE_WAN_IP:16594': There were no auth ids available

The polycom-check-cfg context is in /etc/asterisk/sip_notify_custom.conf:

[polycom-check-cfg]
Event=>check-sync

I get the same error message if I try to send the notify to an endpoint instead of a uri.

Your structure looks right. I have this in mine.

If you are going to use the URI, you need a default endpoint specified also. See this thread:

Finally, if you are using the URI, you need the full URI. It can be more than just the IP address and port, depending.

sip:[email protected]:35120
sip:[email protected]:12049;transport=TLS;x-ast-orig-host=10.254.103.215:12049

Default endpoint is specified. I’ve received the error mentioned in your post so I did that just in case, even though the error is different.

Also I believe the uri is complete. I get the same error if I try to send the notify to the endpoint instead so I don’t think it’s related to the use of the uri.

The endpoint is challenging for authentication, and there is no configuration in PJSIP for outbound authentication. You can confirm the challenge by looking at “pjsip set logger on”.

So are you saying there isn’t a way in PJSIP to fix what I’m trying to do? Pastebin attached of command after enabling pjsip logger

https://pastebin.freepbx.org/view/83af3141

Without looking at the logs, he is saying that there is way of doing so in chan_pjsip, but either you haven’t invoked it at your end, or it shouldn’t have been invoked at the other.

No, I meant the specific configuration in use doesn’t have authentication for outbound. If an endpoint is used instead, and outbound authentication is configured, then I believe it would authenticate. How that is done in FreePBX, and what credentials the phone wants (I assume the credentials we challenge it for) I don’t know.

Alright so how would this be done in a purely asterisk sense? Or perhaps I am going about this the wrong way.

Configured PJSIP endpoints in Asterisk have an “outbound_auth” option. When set the given authentication section is used when challenged by the remote side for credentials.

There may be a phone configuration option to not challenge NOTIFY for auth, or not challenge for registered source IP. I know this is a setting in GS GXP devices as it came up in EPM years ago.

I see this on the endpoint but it’s blank.

I tried adding the below context to /etc/asterisk/pjsip.aor_custom.conf and I can see it added what I wanted when I run asterisk -x "pjsip show endpoint 119" but I still get the same error when sending the notify.

[119](+)
outbound_auth=extension_secret

I’m not even sure if the extension secret is the right auth but I would have thought that at least with that parameter filled in I wouldn’t have received the same error message, right?

It should have produced an error for type=auth section not found, as the parameter is the name of such a section.

Ok that makes sense I think. So I’ve changed it the be:

[119](+)
outbound_auth=119-auth

and [119-auth] is in /etc/asterisk/pjsip.auth.conf and looks like:

[119-auth]
type=auth
auth_type=userpass
password=extension_secret
username=119

yet I still see the same error message in the CLI when sending the notify:

[2022-07-13 10:34:34] ERROR[27019]: res_pjsip_outbound_authenticator_digest.c:447 digest_create_request_with_auth: Host: 'PHONE_WAN_IP:16613': There were no auth ids available