[Home]

Summary:ASTERISK-04288: [patch] New Function IFTIME
Reporter:Anthony Minessale (anthm)Labels:
Date Opened:2005-05-26 17:04:26Date Closed:2008-01-15 15:37:03.000-0600
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Functions/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) iftimefunc_rev1.diff
Description:  -= Info about function 'IFTIME' =-

[Syntax]
IFTIME(<timespec>?<true>:<false>)

[Synopsis]
Temporal Conditional: Returns the data following '?' if true else the data following ':'



****** ADDITIONAL INFORMATION ******

Disclamier on file
anthmct@yahoo.com
Comments:By: Kevin P. Fleming (kpfleming) 2005-06-02 22:29:54

There are some formatting problems here, like this:

+ }
+ if(!(res = ast_build_timing(&timing, expr))) {
+            ast_log(LOG_WARNING, "Invalid Time Spec.\n");
+        } else {
+ if (expr && iftrue) {

Also, what is this conditional supposed to do?

+ if((expr = mydata)) {
+ expr = ast_strip_quoted(expr, "\"", "\"");
+ } else {
+ ast_log(LOG_WARNING, "Invalid Time Spec.\n");
+ return NULL;
+ }

The only way that this code can be executed is if mydata != NULL, in which case expr will also be != NULL, since it's just a simple assignment. As best I can tell, the ast_log() call will never happen.

By: Anthony Minessale (anthm) 2005-06-03 10:12:22

good point, here you go.

By: Kevin P. Fleming (kpfleming) 2005-06-03 17:01:23

Committed to CVS HEAD with mods. Thanks!

By: Digium Subversion (svnbot) 2008-01-15 15:37:03.000-0600

Repository: asterisk
Revision: 5836

U   trunk/funcs/func_logic.c

------------------------------------------------------------------------
r5836 | kpfleming | 2008-01-15 15:37:03 -0600 (Tue, 15 Jan 2008) | 3 lines

clean up logic functions code and help texts
add IFTIME function (bug ASTERISK-4288, with mods)

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

http://svn.digium.com/view/asterisk?view=rev&revision=5836