[asterisk-bugs] [Asterisk 0011719]: [patch] GotoIfTime currently only handles the 'true' case. This patch adds proper Goto behavior for the 'false' case as well.

noreply at bugs.digium.com noreply at bugs.digium.com
Thu Jan 10 13:01:53 CST 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=11719 
====================================================================== 
Reported By:                kshumard
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   11719
Category:                   Applications/*
Reproducibility:            always
Severity:                   feature
Priority:                   normal
Status:                     new
Asterisk Version:           SVN 
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!): 97634 
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             01-09-2008 17:06 CST
Last Modified:              01-10-2008 13:01 CST
====================================================================== 
Summary:                    [patch] GotoIfTime currently only handles the 'true'
case. This patch adds proper Goto behavior for the 'false' case as well.
Description: 
The principle of least surprise says that GotoIfTime should function like
GotoIf, and branch properly down either the 'true' or the 'false' path.
However, when (e.g.) exten => 1,1,GotoIfTime(15:00-15:02,*,*,*?true:false)
is evaluated, the current behavior is that if true the label "true:false"
is used and if false processing continues to the next priority. This patch
implements the typical GotoIf behavior, by properly handling labels for
both "true" and "false" evaluations of the current time against the
specified time. Thus, true evaluation of the condition Goto's the "true"
label, and false evaluation of the condition Goto's the "false" label.

The idea of a label "true:false" makes me shudder, but this is valid with
the current behavior of GotoIfTime.
====================================================================== 

---------------------------------------------------------------------- 
 kshumard - 01-10-08 13:01  
---------------------------------------------------------------------- 
Corydon76: Do you mean "label" instead of "application"? What will happen
if there's a ':' in the label is that Asterisk won't behave as expected.
With an invocation like

exten => 1,1,GotoIfTime(15:00-15:02,*,*,*?tr:ue:false),

the true condition will branch to label "tr" and the false condition will
branch to "ue:false". Not exactly pretty, but this makes it consistent with
GotoIf which already behaves this way. I copied much of the logic for this
patch straight out of pbx_builtin_gotoif. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
01-10-08 13:01  kshumard       Note Added: 0076678                          
======================================================================




More information about the asterisk-bugs mailing list