[asterisk-users] branching in extensions.conf?

Brian J. Murrell brian at interlinx.bc.ca
Wed Feb 20 13:13:00 CST 2019


On Wed, 2019-02-20 at 11:46 -0700, John Kiniston wrote:
> Use the IF function to evaluate and change the dial command directly.

Thanks for taking the time, but that doesn't actually answer the
question I asked.  It in fact answers the caveat I specifically
mentioned:

> Granted the particular above example could probably be better
> written to simply modify $ARG2 based on ${SIP} rather than having two
> Dial() branches

But I also stated that I was just using it as example of a need to
branch and how cumbersome using Goto[If] makes it.

Again, appreciate that you took the time, but really looking for an
answer to the "better way to branch" question.

> My braces and parens may be off in this example sorry if it doesn't
> work
> out of the box.
> exten => s,n,Dial(${IF($["${SIP}" = "PJSIP"]?
> ${PJSIP_DIAL_CONTACTS(${STRREPLACE(ARG2,"PJSIP/","")})}{ARG2})},20,Tt
> Ww)

Hah.  This won't work either, for the reason I asked about in my
followup question about where the "true" value of an ${IF ...}has a
colon in it and is taken to be the end of the true value and the start
of the false value.

And your ${IF ...} is missing the colon between the true and false
values but I still understood what you were getting at.

Cheers,
b.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20190220/eeaf8670/attachment.sig>


More information about the asterisk-users mailing list