Pjsip send notify to a uri

asterisk
Tags: #<Tag:0x00007f702813e648>

(Jared Busch) #1

This is actually an Asterisk question. I had posted over on that community 2 years ago, and received an answer.

But I just got around to trying to implement that answer and it is not working. I added on to my thread over there, but as this community gets more action, I thought I would ask here also.

Asterisk is supposed to support sending a sip notify to a specific URI. But I cannot get it to work.

Has anyone else tried this? When I issue the command, I see nothing in sngrep.

image

The syntax that was posted seems valid as it gives no error.

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

(Joshua C. Colp) #2

That’s an asynchronous operation. If you open the Asterisk console and do it, does it present you a message with further detail?


(Jared Busch) #3

Bad testing is bad :frowning:

I’m so used to doing things with rasterisk -x that I didn’t even think about that.

image

With the port, just in case :slight_smile:
image


(Joshua C. Colp) #4

The “default_outbound_endpoint” option has to be set in the global section[1] to an endpoint to be used for them.

[1] wiki.asterisk.org/wiki/display/AST/Asterisk+12+Configuration_res_pjsip


(Simon Telephonics) #5

Looks like freepbx doesn’t have a setting for this, but you could do it by enabling the anonymous endpoint (enable SIP Guests in Asterisk SIP Settings) and then putting default_outbound_endpoint=anonymous into /etc/asterisk/pjsip_custom_post.conf.


(Jared Busch) #6

So that fixed it by choosing a random endpoint as the default. Obviously, I do not want it in pjsip_custom.conf long term. this was a quick test.

image

Is there a better good practice to use for that?


(Jared Busch) #7

Not particularly fond of having that enabled.


(Simon Telephonics) #8

I find it useful for purposes like this or calling to various SIP URIs from the dialplan.

For inbound traffic that hits it, I got tired of seeing the noise of internet scanners and gave it a dead-end context. I’m using it for outbound purposes only.


(Jared Busch) #9

Unless more discussion follows on, for now, I have just added the first extension on the PBX as the default endpoint.
image


#10

I just tried this setup and got

Unable to find notify type ‘reboot’

&

Unable to find notify type ‘restart-yealink’


(Jared Busch) #11

because restart-yealink is my own custom notify command to not conflict with the built in EPM ones.

image