Hi,
I’m trying to send NOTIFYs from Dialplan using PJSIPNotify (Asterisk 20.12.0). The NOTIFY is not in-dialog. I created a new endpoint, added it to pjsip.conf’s [global] context - it is used as default_outbound_endpoint now while sending the NOTIFY.
I’m getting the endpoint’s URI in the following way:
same => n, Set(AOR_CONTACT=${PJSIP_AOR(${EXTENSION_NUMBER},contact)})
same => n, Set(NOTIFY_CONTACT=${PJSIP_CONTACT(${AOR_CONTACT},uri)})
same => n, Set(NOTIFY_URI=${CUT(NOTIFY_CONTACT,\;,1)})
same => n, PJSIPNotify(${NOTIFY_URI},endpoint_test_notify)
where endpoint_test_notify is a context defined in pjsip_notify.conf.
It sends the NOTIFY properly if the default_outbound_endpoint and recipient endpoint’s transport types are matching, e.g. TLS and TLS.
Not every endpoint is connected through TLS and if I change default_outbound_endpoint’s transport to TCP for example, the PJSIPSendNotify fails with error:
[2025-03-13 11:01:57.0436] ERROR[704258]: res_pjsip.c:1769 endpt_send_request: Error 171064 'Unsuitable transport selected (PJSIP_ETPNOTSUITABLE)' sending NOTIFY request to endpoint default_outbound_endpoint
[2025-03-13 11:01:57.0436] ERROR[704258]: res_pjsip_notify.c:780 notify_uri: SIP NOTIFY - Unable to send request for uri sips:<endpoint>@<ip>:<port>
Based on the documentation , there is no way to send the NOTIFY targeting an endpoint like it can be done from CLI (which can find the appropriate transport type):
pjsip send notify endpoint_test_notify endpoint <endpointID>
As default_outbound_endpoint is a global setting, it can’t be just changed from dialplan as far as I know without completely reloading the pjsip module itself.
How can I make it work to send NOTIFYs using PJSIPNotify (from dialplan) to endpoints connecting using different transport types?