[asterisk-users] [1.4] Comparing value of string with spaces?

Andrew Thomas andy at datavox.co.uk
Wed Mar 2 07:37:57 CST 2011


Changing 

exten => start,n,While($[${MYVAR} != "Some string"])

to

exten => start,n,While($["${MYVAR}" != "Some string"])

does the trick for me. 	 	



-----Original Message-----
From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Gilles
Sent: 02 March 2011 13:25
To: asterisk-users at lists.digium.com
Subject: [asterisk-users] [1.4] Comparing value of string with spaces?


Hello

	I haven't found an example on how to compare the value of a
string variable with spaces in it, and the While loop below never exits:

========== extensions.conf
exten => start,n,Set(MYVAR="Dummy value")

exten => start,n,NoOp(${MYVAR})

;BAD TOO
;exten => start,n,While(!$[${MYVAR} : "Some string"])

exten => start,n,While($[${MYVAR} != "Some string"])

exten => start,n,Set(MYVAR="Some string")

exten => start,n,EndWhile()
========== 

Thank you.


-- _____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

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


 If you have received this communication in error we would appreciate
you advising us either by telephone or return of e-mail. The contents
of this message, and any attachments, are the property of DataVox,
and are intended for the confidential use of the named recipient only.
If you are not the intended recipient, employee or agent responsible
for delivery of this message to the intended recipient, take note that
any dissemination, distribution or copying of this communication and
its attachments is strictly prohibited, and may be subject to civil or
criminal action for which you may be liable.
Every effort has been made to ensure that this e-mail or any attachments
are free from viruses. While the company has taken every reasonable
precaution to minimise this risk, neither company, nor the sender can
accept liability for any damage which you sustain as a result of viruses.
It is recommended that you should carry out your own virus checks
before opening any attachments. 

Registered in England. No. 27459085.





More information about the asterisk-users mailing list