[Home]

Summary:ASTERISK-25194: Incorrect GotoIf Behavoir
Reporter:newborn (newborn838)Labels:
Date Opened:2015-06-24 04:18:44Date Closed:2015-06-24 04:38:44
Priority:MajorRegression?
Status:Closed/CompleteComponents:. I did not set the category correctly.
Versions:1.8.32.1 Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:Seems that application GotoIf does not work correctly.

The dialplan:

NoOp(-- Current calls on ${GLOBAL(OUTBOUND_TRUNK2)} is ${MATH(${GROUP_COUNT(pstn_trunk_in)}+${GROUP_COUNT(pstn_trunk_out)},int)});
   GotoIf($["${MATH(${GROUP_COUNT(pstn_trunk_in)}+${GROUP_COUNT(pstn_trunk_out)},int)}">="${GLOBAL(MAXCALLS_TRUNK2)}"]?msk02);

Output:

[Jun 24 19:03:31]     -- Executing [74952325217@outbound-dial-external:1] NoOp("SIP/lyncserver-0000005f", "-- Current calls on SIP/provider is 3") in new stack
[Jun 24 19:03:31]     -- Executing [74952325217@outbound-dial-external:2] GotoIf("SIP/lyncserver-0000005f", "1?msk02") in new stack
[Jun 24 19:03:31]     -- Goto (outbound-dial-external,74952325217,7)


dialplan show globals

...
MAXCALLS_TRUNK2=30
...

So Asterisk think that 30 is greater or equal than 3. Is this correct?
Comments:By: newborn (newborn838) 2015-06-24 04:38:44.878-0500

Resolved, corrected GotoIf syntax:

exten => _XX.,1,GotoIf($["${calledid}" != ""]?3)

exten => _XX.,1,GotoIf($[foo${calledid} != foo]?3)

exten => _XX.,1,GotoIf($[${LEN(${calledid})} > 0]?3)

exten => _XX.,1,GotoIf($[${LEN(${calledid})} >= 0]?3)