[asterisk-users] if function when the true value has a colon in it?

Stefan Tichy asterisk3 at pi4tel.de
Wed Feb 20 13:34:09 CST 2019


On Wed, Feb 20, 2019 at 12:08:14PM -0500, Brian J. Murrell wrote:

> exten => s,n,Set(EXT=${IF($[${SIP}=PJSIP]?${PJSIP_DIAL_CONTACTS(${STRREPLACE(ARG2,PJSIP/,)})}:${ARG2})})
> 
> But that ${IF expression?tval:fval} doesn't work because tval has a :
> in it which the if function is taking as the terminator for the tval.

As workaround you could use ExecIf:

   ExecIF($[${SIP}=PJSIP]?Set(EXT=.....):Set(EXT=...))




-- 
Stefan Tichy  ( asterisk3 at pi4tel dot de )



More information about the asterisk-users mailing list