129445 [2024-02-15 17:42:19] ERROR[4515] chan_pjsip.c: Unable to create PJSIP channel - endpoint 'mydomain:5060' was not found
129446 [2024-02-15 17:42:19] NOTICE[31165][C-0000079c] app_dial.c: Unable to create channel of type 'PJSIP' (cause 3 - No route to destination)
Questions:
I know I have the @ wrong on my dial what do I need to change it to so it will go to my outbound routes?
Maybe @david55 will know but how can I amend my set diversion header to include: reason=unconditional;privacy=off
Not only is the dial string wrong, unlike chan_sip, you need to add that header on the outgoing channel. Doing it how you have puts the header on the current channel. You need to use the b option (pre-dial) in the dial string to hit a gosub to add the header to the newly created channel.
Your dial string should be PJSIP/endpoint/sip:[email protected]:5060
You’re still missing an endpoint. Chan_pjsip requires two things that chan_sip does not in regards to “default trunking”. If you want to accept anonymous calling in chan_pjsip, you need a special anonymous endpoint. If you want to do pure SIP URI outbound dialing, there is a default outbound endpoint you can enable in the [global] section or you can use an existing endpoint to go through.
From the [global] section, not enabled by default. You can even set the endpoint to use. ;default_outbound_endpoint=default_outbound_endpoint
Needs to be this, where *endpoint* is the name of the trunk endpoint to send calls out over. exten => s,1,Dial(PJSIP/*endpoint*/sip:[email protected]:5060,300,b(outgoing-call^addheader^1))
You call on it by the name, which it the name you give it in the GUI. If you do asterisk -rx "pjsip show endpoints" you’ll see it listed there too with the endpoint name.
Got it you need to delimit with a \ to add the options.
After all that it still doesn’t work.
Does anyone have any ideas on how to do what I am looking to do:
I have a DID, lets say 555.555.5555
When people call that DID, I dont want to take the call, instead I want to divert it to an 800 number I own, lets say 888.888.8888, using the FROM_DID as the calling party.
111.111.1111 calls my pbx at 555.555.5555
The call is immediately diverted to 888.888.8888 looking like its coming from 555.555.5555
111.111.1111 is connected to 888.888.8888 to complete the call transaction, but 888.888.8888 behaves as though the call has come from 555.555.5555
I suggest that you start out by doing “nothing special”, sending the Inbound Route to a Misc Destination that dials your toll free number, and setting in Advanced Settings, Generate Diversion Headers to Yes.
With luck, this might be adequate. If it’s not, make a copy of [sub-diversion-header] from /etc/asterisk/extensions_additional.conf, edit it as desired and put it in /etc/asterisk/extensions_override_freepbx.conf
then do fwconsole reload
and test.
If the caller ID is wrong (other than 111.111.1111), that’s a separate issue unrelated to Diversion (trunk settings, provider requirements / restrictions, etc.)
This looks way better than what I have been getting, I am getting unauthorized. So it might be a permissions issue with my carrier to use that ID. Thanks again!