[asterisk-users] if statement with true value that contains a colon

Brian J. Murrell brian at interlinx.bc.ca
Fri Sep 13 07:03:39 CDT 2019


How can I use an IF statement with a true value being a variable that
has a colon in it?  The colon in the true value variable is being taken
as the delimiter for the false value.

The only solution I came up with was some hackery to use STRREPLACE to
replace the : with a % before the IF statement and then use STRREPLACE
again after to change the % back to a :.

i.e.:

    Set(dialexts=${STRREPLACE(dialexts,:,%)});
    Set(dialexts=${IFTIME(8:00-22:00?${dialexts}&${MBDR}:${dialexts})});
    Set(dialexts=${STRREPLACE(dialexts,%,:)});


Is there no better alternative?

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/20190913/da7ac522/attachment.sig>


More information about the asterisk-users mailing list