PJSIP trunk with outbound auth without registration

Hi all,

My box; Debian 8.10, Asterisk 13.6-cert, PJSIP stack.

I’m trying to configure a trunk to do outbound calls only, with INVITE authentification, but without registration.

My config (Realtime tables):

ps_auths
id,          auth_type,  password,  realm,             username
trunkXXXXXX, userpass,   XXXXXXXXX, sip.XXXXXXXXX.com, XXXXXXXXX

ps_aors
id,          contact,                              authenticate_qualify
trunkXXXXXX, sip:XXXXXXXXX@sip.XXXXXXXXX.com:5060, no

ps_endpoints
id,          transport,     aors,        context,     disallow, allow, direct_media, outbound_auth, from_domain, accountcode
trunkXXXXXX, transport-udp, trunkXXXXXX, trunkXXXXXX, all,      alaw,  no,           trunkXXXXXX,   sip.XXXXXXXXX.com, XXXXXX

No ps_registrations and no ps_contacts.

Asterisk log:

[Jun 19 18:49:02] ERROR[46233] res_pjsip.c: Endpoint 'trunkXXXXXX': Could not create dialog to invalid URI '349XXXXXXXX'.  Is endpoint registered and reachable?
[Jun 19 18:49:02] ERROR[46233] chan_pjsip.c: Failed to create outgoing session to endpoint 'trunkXXXXXX'

You need to provide the actual further console output including Dial string. You may not be using it correctly. For example in PJSIP you’d want to use PJSIP/number@endpoint and not PJSIP/endpoint/number

1 Like

I just ran call from Asterisk CLI;

originate PJSIP/trunkXXXXXX/349XXXXXXXX application MusicOnHold ,30

And the output it’s first post of this thread.

That is not the correct Dial string for a PJSIP channel. See my previous post for the correct dial string.

I known, but you request me more info.

Lesson learned!

thx @jcolp

The above syntaxt work on SIP, but it wont work using psip and originate command, an if the answer yes , why ?

Everything after the first / is parsed by the channel driver, so they can choose to accept different syntaxes. chan_sip should accept the @ syntax, as well as the / one.

On sip we know both methods works but I reading the @jcolp post

And it seems this is different on psip channel driver

Indeed, the parser for chan_pjsip is greatly simplified. It supports Dial strings in specific ways[1]. Trying to support all different kinds of strings was not done.

[1] https://wiki.asterisk.org/wiki/display/AST/Dialing+PJSIP+Channels