Add the TESTTIME() dialplan function, which permits testing GotoIfTime.

Specifically, by setting TESTTIME() to a particular date and time, you
can test whether a dialplan correctly branches as was intended.  This was
developed after recent questions on the -users list on how to test their
holiday dialplan logic.
(closes issue #16464)
 Reported by: tilghman
 Patches: 
       20100112__issue16464.diff.txt uploaded by tilghman (license 14)
 
Review: https://reviewboard.asterisk.org/r/458/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@239957 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Tilghman Lesher
2010-01-13 21:27:34 +00:00
parent 919437428e
commit ecbe7eff7a
2 changed files with 90 additions and 5 deletions

View File

@@ -146,6 +146,14 @@ int ast_build_timing(struct ast_timing *i, const char *info);
*/
int ast_check_timing(const struct ast_timing *i);
/*!
* \brief Evaluate a pre-constructed bitmap as to whether a particular time falls within the range specified.
* \param i Pointer to an ast_timing structure.
* \param tv Specified time
* \retval Returns 1, if the time matches or 0, if the time falls outside of the specified range.
*/
int ast_check_timing2(const struct ast_timing *i, const struct timeval tv);
/*!
* \brief Deallocates memory structures associated with a timing bitmap.
* \param i Pointer to an ast_timing structure.