<div dir="ltr"><div dir="ltr">Use the IF function to evaluate and change the dial command directly.<br><br>My braces and parens may be off in this example sorry if it doesn't work out of the box.<br>exten => s,n,Dial(${IF($["${SIP}" = "PJSIP"]?
${PJSIP_DIAL_CONTACTS(${STRREPLACE(ARG2,"PJSIP/","")})}{ARG2})},20,TtWw)<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Feb 20, 2019 at 9:42 AM Brian J. Murrell <<a href="mailto:brian@interlinx.bc.ca">brian@interlinx.bc.ca</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Is there any less cumbersome way of doing conditionalized/branching in<br>
extensions.conf other than something like:<br>
<br>
exten => s,n,GotoIf($["${SIP}" = "PJSIP" ]?pjsip)<br>
exten => s,n,Dial(${ARG2},20,TtWw)<br>
exten => s,n,Goto(afterdial)<br>
exten => s,n(pjsip),Dial(${PJSIP_DIAL_CONTACTS(${STRREPLACE(ARG2,"PJSIP/","")})},20,TtWw)<br>
exten => s,n(afterdial),Goto(s-${DIALSTATUS},1)<br>
<br>
Granted the particular above example could probably be better written<br>
to simply modify $ARG2 based on ${SIP} rather than having two Dial()<br>
branches, but using the above as just an example for wanting to have<br>
branches, is there a less cumbersome way?<br>
<br>
Cheers,<br>
b.<br>
-- <br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" rel="noreferrer" target="_blank">http://www.api-digital.com</a> --<br>
<br>
Check out the new Asterisk community forum at: <a href="https://community.asterisk.org/" rel="noreferrer" target="_blank">https://community.asterisk.org/</a><br>
<br>
New to Asterisk? Start here:<br>
<a href="https://wiki.asterisk.org/wiki/display/AST/Getting+Started" rel="noreferrer" target="_blank">https://wiki.asterisk.org/wiki/display/AST/Getting+Started</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-users" rel="noreferrer" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a></blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature">A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects.<br>---Heinlein</div>