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

2019-09-13 Thread Brian J. Murrell
On Fri, 2019-09-13 at 14:21 +0200, Administrator TOOTAI wrote:
> 
> Escape it with \

Tried that.  It doesn't work.

Cheers,
b.



signature.asc
Description: This is a digitally signed message part
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

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

2019-09-13 Thread Administrator TOOTAI

Le 13/09/2019 à 14:03, Brian J. Murrell a écrit :

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?


Escape it with \

--
Daniel

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
 https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users

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

2019-09-13 Thread Brian J. Murrell
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.



signature.asc
Description: This is a digitally signed message part
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users