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

Brian J. Murrell brian at interlinx.bc.ca
Wed Feb 20 11:08:14 CST 2019


Following up on my previously asked question if I rewrite the branching
example (not that it negates the more general branching question) I was
using as such:

exten => s,n,Set(EXT=${IF($[${SIP}=PJSIP]?${PJSIP_DIAL_CONTACTS(${STRREPLACE(ARG2,PJSIP/,)})}:${ARG2})})
exten => s,n,Dial(${EXT},20,TtWw)
exten => s,n,Goto(s-${DIALSTATUS},1)

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.

How can I deal with that?  Double quoting the tval doesn't seem to work
as it introduces an unwanted close-double-quote into EXT which Dial()
barfs 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/50c0df24/attachment.sig>


More information about the asterisk-users mailing list