PJSIP - Dial cmd to another Asterisk Server

Hello - we are (finally) migrating from chan_sip to PJSIP. I’m struggling a little bit with the PJSIP configuration.

Asterisk Server A accepts a call at extension 1. Extension 1 prompts for a meeting id. That meeting id is bounced off of one of our application servers and it returns the ip address of another Asterisk server (let’s call this Asterisk Server B) where the conference is being held.

Asterisk Server A has been using this (with chan_sip):

same => n,Dial(SIP/98${CONFCODE}@111.222.333.444:5060)

111.222.333.444 is the address of the Asterisk server where the conference is being held. Depending on the entry from the user, the conference could be on one of an unknown number of Asterisk servers.

With PJSIP - I attempted to do something like this for the Dial cmd:

same => n,Dial(PJSIP/tooja/98${CONFCODE}@111.222.333.444:5060,ge)

I then configured pjsip.conf with this:




When I attempt to run the new PJSIP Dial cmd… I get the following errors:

[2020-07-13 20:41:13] ERROR[12687]: res_pjsip.c:3237 ast_sip_create_dialog_uac: Endpoint ‘tooja’: Could not create dialog to invalid URI ‘98111@111.222.333.444:5060’. Is endpoint registered and reachable?
[2020-07-13 20:41:13] ERROR[12687]: chan_pjsip.c:2487 request: Failed to create outgoing session to endpoint ‘tooja’
[2020-07-13 20:41:13] WARNING[12722][C-00000001]: app_dial.c:2512 dial_exec_full: Unable to create channel of type ‘PJSIP’ (cause 3 - No route to destination)

So based on this it feels like I need a registration section in my pjsip.conf? However, I won’t know the address of the destination Asterisk server until the user enters their conference code and I look it up against our application server.

Sorry if that is confusing - still learning PJSIP (and doing a terrible job of it haha). Can someone point me in the direction of how I might be able to use Dial to any Asterisk address using PJSIP?

Thanks in advance for any help!

Followup question: Or in my situation am I better just sticking with:

same => n,Dial(SIP/98${CONFCODE}@111.222.333.444:5060)

And not trying to using the PJSIP prefix here?

PJSIP speaks SIP URIs, so the above would be:

same => n,Dial(PJSIP/tooja/sip:98${CONFCODE}@111.222.333.444,ge)

1 Like

It is no longer yelling at me - so it seems to like that format. Thank you - that part was giving me all sorts of trouble. I appreciate you taking the time!!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.