Esteban Guana-Jarrin
2006-Oct-26 22:11 UTC
[asterisk-users] dialplan issue - 1& 0 should be evaluated false
Helo List,
Sorry I missed the rest of my email in my previous post. Please see below.
I'm having an issue using the AND (&) operator evaluation in the code of
my
dialplan. The dial plan is coded to detect inbound DTMF digits from callers.
key "1" is equivalent to "yes" and key "2" is
equivalent to "no" in two
diferent contexts in the dial plan. When a caller presses 1, yes is passed
as a value in a varialble and same when 2 is pressed a "no" is passed.
When the values are both set to "yes" from previous contexts in the
dialplan; the evaluation of the AND operation in the following expression is
true and works fine jumping to the correct priority within the context,
exten => s,3,Gotoif($[${test11} = yes]& $[${test12} = yes]?7:4)
Debug output
-- Goto (test-check,s,1)
-- Executing NoOp("SIP/123-e131", "yes") in new stack
-- Executing NoOp("SIP/123-e131", "yes") in new stack
-- Executing GotoIf("SIP/123-e131", "1& 1?7:4") in
new stack
-- Goto (test-check,s,7)
-- Executing System("SIP/123-e131", "mail -s
"Test=Yes"
egua5261@hotmail.com") in new stack
-- Executing Goto("SIP/123-e131", "14") in new stack
-- Goto (test-check,s,14)
-- Executing Playback("SIP/123-e131", "end") in new
stack
The issue occurs when the values are passed with different values. For
instance when the variables test11 and test12, shown below, are set with
values yes and no respectively. The AND operation is evaluated as true, as
seen in the debug output below, it jumps to priority 7 within the context
instead of jumping to priority 4 as it should be the case when evaluated as
false as it should,
exten => s,3,Gotoif($[${test11} = yes]& $[${test12} = yes]?7:4)
exten => s,4,Gotoif($[${test11} = yes] & $[${test12} = no]?9:5)
Debug output:
-- Executing NoOp("SIP/123-1c20", "yes") in new stack
-- Executing NoOp("SIP/123-1c20", "no") in new stack
-- Executing GotoIf("SIP/123-1c20", "1& 0?7:4") in
new stack
-- Goto (test-check,s,7)
-- Executing System("SIP/123-1c20", "mail -s
"Test=Yes"
egua5261@hotmail.com") in new stack
-- Executing Goto("SIP/123-1c20", "14") in new stack
-- Goto (test-check,s,14)
-- Executing Playback("SIP/123-1c20", "end") in new
stack
Following is the rest of code for the context processing the AND operations,
[test-check]
exten => s,1,NoOp(${test11})
exten => s,2,NoOp(${test12})
exten => s,3,Gotoif($[${test11} = yes]& $[${test12} = yes]?7:4)
exten => s,4,Gotoif($[${test11} = yes] & $[${test12} = no]?9:5)
exten => s,5,Gotoif($[${test11} = no] & $[${test12} = no]?11:6)
exten => s,6,Gotoif($[${test11} = yes] & $[${test12} = yes]?13:15)
exten => s,7,System(mail -s "Test=Yes" estebang@exetel.com.au)
exten => s,8,Goto(14)
exten => s,9,System(mail -s "Test=yes,no" estebang@exetel.com.au)
exten => s,10,Goto(14)
exten => s,11,System(mail -s "Test=no" estebang@exetel.com.au)
exten => s,12,Goto(14)
exten => s,13,System(mail -s "Test=no,yes" estebang@exetel.com.au)
exten => s,14,Playback(ExetelIVR/end)
exten => s,15,Goto(ack-message,s,1)
exten => t,1,Playback(vm-goodbye)
exten => t,2,Hangup
Can someone please assist and explain how the AND operation works in
Asterisk?
Regards,
Paul
_________________________________________________________________
See Jet live in LA. Download music for a chance to win!
http://ninemsn.com.au/share/redir/adTrack.asp?mode=click&clientID=721&referral=hotmailtagline&URL=http://music.ninemsn.com.au/section.aspx?sectionid=2465§ionname=artistfeature&subsectionid=5692&subsectionname=jet
Melcon Moraes
2006-Oct-26 23:03 UTC
[asterisk-users] dialplan issue - 1& 0 should be evaluated false
Maybe a missing space between expr1 and the & sign on extension s
priority 3 ?
[]'s
MM
-----Original Message-----
From: "Esteban Guana-Jarrin" <egua5261@hotmail.com>
To: asterisk-users@lists.digium.com
Cc:
Sent: Fri, 27 Oct 2006 15:11:33 +1000
Delivered: Fri, 27 Oct 2006 01:51:20
Subject:[asterisk-users] dialplan issue - 1& 0 should be evaluated false
Helo List,
Sorry I missed the rest of my email in my previous post. Please see below.
I'm having an issue using the AND (&) operator evaluation in the code of
my
dialplan. The dial plan is coded to detect inbound DTMF digits from callers.
key "1" is equivalent to "yes" and key "2" is
equivalent to "no" in two
diferent contexts in the dial plan. When a caller presses 1, yes is passed
as a value in a varialble and same when 2 is pressed a "no" is passed.
When the values are both set to "yes" from previous contexts in the
dialplan; the evaluation of the AND operation in the following expression is
true and works fine jumping to the correct priority within the context,
exten => s,3,Gotoif($[${test11} = yes]& $[${test12} = yes]?7:4)
Debug output
-- Goto (test-check,s,1)
-- Executing NoOp("SIP/123-e131", "yes") in new stack
-- Executing NoOp("SIP/123-e131", "yes") in new stack
-- Executing GotoIf("SIP/123-e131", "1& 1?7:4") in
new stack
-- Goto (test-check,s,7)
-- Executing System("SIP/123-e131", "mail -s
"Test=Yes"
egua5261@hotmail.com") in new stack
-- Executing Goto("SIP/123-e131", "14") in new stack
-- Goto (test-check,s,14)
-- Executing Playback("SIP/123-e131", "end") in new
stack
The issue occurs when the values are passed with different values. For
instance when the variables test11 and test12, shown below, are set with
values yes and no respectively. The AND operation is evaluated as true, as
seen in the debug output below, it jumps to priority 7 within the context
instead of jumping to priority 4 as it should be the case when evaluated as
false as it should,
exten => s,3,Gotoif($[${test11} = yes]& $[${test12} = yes]?7:4)
exten => s,4,Gotoif($[${test11} = yes] & $[${test12} = no]?9:5)
Debug output:
-- Executing NoOp("SIP/123-1c20", "yes") in new stack
-- Executing NoOp("SIP/123-1c20", "no") in new stack
-- Executing GotoIf("SIP/123-1c20", "1& 0?7:4") in
new stack
-- Goto (test-check,s,7)
-- Executing System("SIP/123-1c20", "mail -s
"Test=Yes"
egua5261@hotmail.com") in new stack
-- Executing Goto("SIP/123-1c20", "14") in new stack
-- Goto (test-check,s,14)
-- Executing Playback("SIP/123-1c20", "end") in new
stack
Following is the rest of code for the context processing the AND operations,
[test-check]
exten => s,1,NoOp(${test11})
exten => s,2,NoOp(${test12})
exten => s,3,Gotoif($[${test11} = yes]& $[${test12} = yes]?7:4)
exten => s,4,Gotoif($[${test11} = yes] & $[${test12} = no]?9:5)
exten => s,5,Gotoif($[${test11} = no] & $[${test12} = no]?11:6)
exten => s,6,Gotoif($[${test11} = yes] & $[${test12} = yes]?13:15)
exten => s,7,System(mail -s "Test=Yes" estebang@exetel.com.au)
exten => s,8,Goto(14)
exten => s,9,System(mail -s "Test=yes,no" estebang@exetel.com.au)
exten => s,10,Goto(14)
exten => s,11,System(mail -s "Test=no" estebang@exetel.com.au)
exten => s,12,Goto(14)
exten => s,13,System(mail -s "Test=no,yes" estebang@exetel.com.au)
exten => s,14,Playback(ExetelIVR/end)
exten => s,15,Goto(ack-message,s,1)
exten => t,1,Playback(vm-goodbye)
exten => t,2,Hangup
Can someone please assist and explain how the AND operation works in
Asterisk?
Regards,
Paul
_________________________________________________________________
See Jet live in LA. Download music for a chance to win!
http://ninemsn.com.au/share/redir/adTrack.asp?mode=click&clientID=721&referral=hotmailtagline&URL=http://music.ninemsn.com.au/section.aspx?sectionid=2465§ionname=artistfeature&subsectionid=5692&subsectionname=jet
_______________________________________________
--Bandwidth and Colocation provided by Easynews.com --
asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
E-mail classificado pelo Identificador de Spam Inteligente Terra.
Para alterar a categoria classificada, visite
http://mail.terra.com.br/protected_email/imail/imail.cgi?+_u=levelz&_l=1,1161926110.740128.31141.ambrose.hst.terra.com.br,6820,Des15,Des15
--Original Message Ends--
--
Melcon Moraes <melcon.moraes@terra.com.br>
Melcon Moraes
2006-Oct-26 23:14 UTC
[asterisk-users] dialplan issue - 1& 0 should be evaluated false
Try this:
exten => s,3,Gotoif($[$[${test11} = yes]& $[${test12} = yes]]?7:4)
exten => s,4,Gotoif($[$[${test11} = yes] & $[${test12} = no]]?9:5)
exten => s,5,Gotoif($[$[${test11} = no] & $[${test12} = no]]?11:6)
exten => s,6,Gotoif($[$[${test11} = yes] & $[${test12} = yes]]?13:15)
A $[] for the entire stuff.
[]'s
MM
-----Original Message-----
From: "Esteban Guana-Jarrin" <egua5261@hotmail.com>
To: asterisk-users@lists.digium.com
Cc:
Sent: Fri, 27 Oct 2006 15:11:33 +1000
Delivered: Fri, 27 Oct 2006 01:51:20
Subject:[asterisk-users] dialplan issue - 1& 0 should be evaluated false
Helo List,
Sorry I missed the rest of my email in my previous post. Please see below.
I'm having an issue using the AND (&) operator evaluation in the code of
my
dialplan. The dial plan is coded to detect inbound DTMF digits from callers.
key "1" is equivalent to "yes" and key "2" is
equivalent to "no" in two
diferent contexts in the dial plan. When a caller presses 1, yes is passed
as a value in a varialble and same when 2 is pressed a "no" is passed.
When the values are both set to "yes" from previous contexts in the
dialplan; the evaluation of the AND operation in the following expression is
true and works fine jumping to the correct priority within the context,
exten => s,3,Gotoif($[${test11} = yes]& $[${test12} = yes]?7:4)
Debug output
-- Goto (test-check,s,1)
-- Executing NoOp("SIP/123-e131", "yes") in new stack
-- Executing NoOp("SIP/123-e131", "yes") in new stack
-- Executing GotoIf("SIP/123-e131", "1& 1?7:4") in
new stack
-- Goto (test-check,s,7)
-- Executing System("SIP/123-e131", "mail -s
"Test=Yes"
egua5261@hotmail.com") in new stack
-- Executing Goto("SIP/123-e131", "14") in new stack
-- Goto (test-check,s,14)
-- Executing Playback("SIP/123-e131", "end") in new
stack
The issue occurs when the values are passed with different values. For
instance when the variables test11 and test12, shown below, are set with
values yes and no respectively. The AND operation is evaluated as true, as
seen in the debug output below, it jumps to priority 7 within the context
instead of jumping to priority 4 as it should be the case when evaluated as
false as it should,
exten => s,3,Gotoif($[${test11} = yes]& $[${test12} = yes]?7:4)
exten => s,4,Gotoif($[${test11} = yes] & $[${test12} = no]?9:5)
Debug output:
-- Executing NoOp("SIP/123-1c20", "yes") in new stack
-- Executing NoOp("SIP/123-1c20", "no") in new stack
-- Executing GotoIf("SIP/123-1c20", "1& 0?7:4") in
new stack
-- Goto (test-check,s,7)
-- Executing System("SIP/123-1c20", "mail -s
"Test=Yes"
egua5261@hotmail.com") in new stack
-- Executing Goto("SIP/123-1c20", "14") in new stack
-- Goto (test-check,s,14)
-- Executing Playback("SIP/123-1c20", "end") in new
stack
Following is the rest of code for the context processing the AND operations,
[test-check]
exten => s,1,NoOp(${test11})
exten => s,2,NoOp(${test12})
exten => s,3,Gotoif($[${test11} = yes]& $[${test12} = yes]?7:4)
exten => s,4,Gotoif($[${test11} = yes] & $[${test12} = no]?9:5)
exten => s,5,Gotoif($[${test11} = no] & $[${test12} = no]?11:6)
exten => s,6,Gotoif($[${test11} = yes] & $[${test12} = yes]?13:15)
exten => s,7,System(mail -s "Test=Yes" estebang@exetel.com.au)
exten => s,8,Goto(14)
exten => s,9,System(mail -s "Test=yes,no" estebang@exetel.com.au)
exten => s,10,Goto(14)
exten => s,11,System(mail -s "Test=no" estebang@exetel.com.au)
exten => s,12,Goto(14)
exten => s,13,System(mail -s "Test=no,yes" estebang@exetel.com.au)
exten => s,14,Playback(ExetelIVR/end)
exten => s,15,Goto(ack-message,s,1)
exten => t,1,Playback(vm-goodbye)
exten => t,2,Hangup
Can someone please assist and explain how the AND operation works in
Asterisk?
Regards,
Paul
_________________________________________________________________
See Jet live in LA. Download music for a chance to win!
http://ninemsn.com.au/share/redir/adTrack.asp?mode=click&clientID=721&referral=hotmailtagline&URL=http://music.ninemsn.com.au/section.aspx?sectionid=2465§ionname=artistfeature&subsectionid=5692&subsectionname=jet
_______________________________________________
--Bandwidth and Colocation provided by Easynews.com --
asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
E-mail classificado pelo Identificador de Spam Inteligente Terra.
Para alterar a categoria classificada, visite
http://mail.terra.com.br/protected_email/imail/imail.cgi?+_u=levelz&_l=1,1161926110.740128.31141.ambrose.hst.terra.com.br,6820,Des15,Des15
--Original Message Ends--
--
Melcon Moraes <melcon.moraes@terra.com.br>
Esteban Guana-Jarrin
2006-Oct-26 23:52 UTC
[asterisk-users] dialplan issue - 1& 0 should be evaluated false
MM,
The $[] made it work. Thanks a lot for your assistance.
obligado :)
See the debug output below.
-- Executing NoOp("SIP/123-d14f", "no") in new stack
-- Executing NoOp("SIP/123-d14f", "yes") in new stack
-- Executing GotoIf("SIP/123-d14f", "0?7:4") in new
stack
-- Goto (test-check,s,4)
-- Executing GotoIf("SIP/123-d14f", "0?9:5") in new
stack
-- Goto (test-check,s,5)
-- Executing GotoIf("SIP/123-d14f", "0?11:6") in new
stack
-- Goto (test-check,s,6)
-- Executing GotoIf("SIP/123-d14f", "1?13:15") in new
stack
-- Goto (test-check,s,13)
-- Executing System("SIP/123-d14f", "mail -s
"Test=no|yes"
egua5261@hotmail.com") in new stack
-- Executing Playback("SIP/123-d14f", "end") in new
stack
-- Executing NoOp("SIP/123-9fb1", "yes") in new stack
-- Executing NoOp("SIP/123-9fb1", "no") in new stack
-- Executing GotoIf("SIP/123-9fb1", "0?7:4") in new
stack
-- Goto (test-check,s,4)
-- Executing GotoIf("SIP/123-9fb1", "1?9:5") in new
stack
-- Goto (test-check,s,9)
-- Executing System("SIP/123-9fb1", "mail -s
"Test=yes|no"
egua5261@hotmail.com") in new stack
-- Executing Goto("SIP/123-9fb1", "14") in new stack
-- Goto (test-check,s,14)
-- Executing Playback("SIP/123-9fb1", "end") in new
stack
>>Try this:
>>exten => s,3,Gotoif($[$[${test11} = yes]& $[${test12} =
yes]]?7:4)
>>exten => s,4,Gotoif($[$[${test11} = yes] & $[${test12} =
no]]?9:5)
>>exten => s,5,Gotoif($[$[${test11} = no] & $[${test12} =
no]]?11:6)
>>exten => s,6,Gotoif($[$[${test11} = yes] & $[${test12} =
yes]]?13:15)
>>A $[] for the entire stuff.
>>[]'s
>>MM
_________________________________________________________________
See The Killers in the UK. Download mobile stuff to win!
http://ninemsn.com.au/share/redir/adTrack.asp?mode=click&clientID=723&referral=hotmailtagline&URL=http://ninemsn.blueskyfrog.com/index.cfm?dir=promos&page=killers