Le 09/06/2019 à 13:19, Benoit Panizzon a écrit :
Dear List

Hello


It's probably been more than a year now I switched from chan_sip to
pjsip. pjsip works much cleaner than chan_sip.

But!

I have come across a Problem I was not able to solve with Asterisk
Dialplan Logic.

With pjsip an endpoint can have multiple AOR, so you need to expand
them with ${PJSIP_DIAL_CONTACTS()} to be able to Dial() all of them
simultaneously.

But there are also situation where you need to Dial() not only one
endpoint, but multiple ones, even mixing technologies like IAX and SIP.

You can specify those multiple endpoints with the & separator in the
Dial() function.

Unfortunately if an pjsip endpoint has NO registered AORs,
${PJSIP_DIAL_CONTACTS()} returns an empty sting.

So consider:

same => n,Dial(IAX2/gu...@pbx.digium.com/s@default &
${PJSIP_DIAL_CONTACTS(Guest)})

If there is no Guest registered, the resulting string to dial passed to
Dial() is: "IAX2/gu...@pbx.digium.com/s@default &" which Dial complains
is not valid, because of a missing second line to dial after the &.

What about to put eveything in a variable and the remove the last character if it equal &

Something like

same = n,Set(toDial=IAX2/gu...@pbx.digium.com/s@default&${PJSIP_DIAL_CONTACTS(Guest)})
same = n,ExecIf($["${toDial:-1}"=="&"]?Set(toDial=${toDial:0:-1}))
same = n,Dial(${toDial})

[...]
--
Daniel

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
     https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to