Wish I could send pjsip notify to specific contact

So one of the great features of pjsip is the ability to have multiple contacts.

I make use of this for at least a couple extensions on every single deployment.

But now I am needing some granularity with notify commands.

It would be great to be able to specify a specific contact to send a pjsip send notify reboot endpoint 103-2 to only reboot the device on contact 2.

Of course this also means I need a way to know which device Asterisk thinks is contact 2.

Sending to a uri is supported. I believe something like the following should work:

pjsip send notify reboot uri sip:103@<ip addr>
3 Likes

That does work, and is probably the only real answer. because nothing ties a contact 1 to IP A and contact 2 to IP B.

So I just got around to trying this. It does not seem to be doing anything.

But nothing seems to be getting sent as the device never restarts.

The site I was testing this at is on Asterisk 17.7.0. I’ll switch them to 18 after hours. But I would assume this should work regardless.

It is a FreePBX 15 based system. This is the in the sip_notify_custom
image

If I issue the command with endpoint instead of uri both devices immediately reboot.
image

Of course, I do not want both devices rebooting. Hence this original question.

This works. I had to add a default_outbound_endpoint to my system as FreePBX does not set anything by default.

For FreePBX, I added this to /etc/asterisk/pjsip_custom_post.conf

default_outbound_endpoint=5100 ; first extension in this PBX

It was also suggested to enable SIP Guests and then set the above to anonymous as another option.