[Home]

Summary:ASTERISK-10534: gosubif doesn't allow empty true condition label similar to gotoif
Reporter:David Van Ginneken (davevg)Labels:
Date Opened:2007-10-15 13:13:26Date Closed:2007-10-15 16:42:54
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Applications/app_stack
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) app_stack.diff
Description:The following case does not work:

exten => s,1,GoSubIf($["${somevar}"="0"]?:somesub)

GoToIf works fine

Patch attached.
Comments:By: Tilghman Lesher (tilghman) 2007-10-15 14:12:23

Okay, what does it do wrong, specifically?

By: David Van Ginneken (davevg) 2007-10-15 15:04:15

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)

By: Digium Subversion (svnbot) 2007-10-15 15:08:55

Repository: asterisk
Revision: 85687

U   branches/1.4/apps/app_stack.c

------------------------------------------------------------------------
r85687 | tilghman | 2007-10-15 15:08:55 -0500 (Mon, 15 Oct 2007) | 5 lines

Don't execute a gosub if the arguments is zero-len (not just NULL)
Reported by davevg
Fixed by me
Closes issue ASTERISK-10534

------------------------------------------------------------------------

By: Digium Subversion (svnbot) 2007-10-15 16:42:54

Repository: asterisk
Revision: 85751

_U  trunk/

------------------------------------------------------------------------
r85751 | tilghman | 2007-10-15 16:42:53 -0500 (Mon, 15 Oct 2007) | 12 lines

Blocked revisions 85687 via svnmerge

........
r85687 | tilghman | 2007-10-15 15:29:35 -0500 (Mon, 15 Oct 2007) | 5 lines

Don't execute a gosub if the arguments is zero-len (not just NULL)
Reported by davevg
Fixed by me
Closes issue ASTERISK-10534

........

------------------------------------------------------------------------