[asterisk-bugs] [Asterisk 0010985]: gosubif doesn't allow empty true condition label similar to gotoif
noreply at bugs.digium.com
noreply at bugs.digium.com
Mon Oct 15 15:04:15 CDT 2007
A NOTE has been added to this issue.
======================================================================
http://bugs.digium.com/view.php?id=10985
======================================================================
Reported By: davevg
Assigned To: Corydon76
======================================================================
Project: Asterisk
Issue ID: 10985
Category: Applications/app_stack
Reproducibility: always
Severity: minor
Priority: normal
Status: assigned
Asterisk Version: 1.4.13
SVN Branch (only for SVN checkouts, not tarball releases): 1.4
SVN Revision (number only!): 85635
Disclaimer on File?: N/A
Request Review:
======================================================================
Date Submitted: 10-15-2007 13:13 CDT
Last Modified: 10-15-2007 15:04 CDT
======================================================================
Summary: gosubif doesn't allow empty true condition label
similar to gotoif
Description:
The following case does not work:
exten => s,1,GoSubIf($["${somevar}"="0"]?:somesub)
GoToIf works fine
Patch attached.
======================================================================
----------------------------------------------------------------------
davevg - 10-15-07 15:04
----------------------------------------------------------------------
The way it works currently, if you use this
exten => s,1,Set(somevar=1)
exten => s,n,GoSubIf($["${somevar}"="0"]?pass:fail)
exten => s,n,Hangup
exten => s,n(pass),Noop(pass)
exten => s,n,Return
exten => s,n(fail),Noop(fail)
exten => s,n,Return
It will noop the fail. If you change somevar to 0 it will noop the pass.
If you change the line to be
exten => s,n,GoSubIf($["${somevar}"="0"]?:fail)
Whereas you only want to go to the sub when it fails it gives you an
error
[Oct 15 16:23:04] ERROR[25645]: app_stack.c:103 gosub_exec: Gosub requires
an argument: Gosub([[context|]exten|]priority)
Issue History
Date Modified Username Field Change
======================================================================
10-15-07 15:04 davevg Note Added: 0072038
======================================================================
More information about the asterisk-bugs
mailing list