From 566a005512e49539f5400868ac98717b833201b6 Mon Sep 17 00:00:00 2001 From: Mark Michelson Date: Fri, 15 Feb 2008 23:07:12 +0000 Subject: Add proper "false" case behavior to GotoIfTime (closes issue #11719) Reported by: kshumard Patches: gotoiftime.twobranches.patch uploaded by kshumard (license 92) Tested by: kshumard git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@103738 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- main/pbx.c | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) (limited to 'main/pbx.c') diff --git a/main/pbx.c b/main/pbx.c index 0638333a3..2df20327e 100644 --- a/main/pbx.c +++ b/main/pbx.c @@ -529,12 +529,17 @@ static struct pbx_builtin { { "GotoIfTime", pbx_builtin_gotoiftime, "Conditional Goto based on the current time", - " GotoIfTime(,,,?[[context,]exten,]priority):\n" + " GotoIfTime(,,,?[labeliftrue]:[labeliffalse]):\n" "This application will set the context, extension, and priority in the channel structure\n" - "if the current time matches the given time specification. Otherwise, nothing is done.\n" + "based on the evaluation of the given time specification. After this application completes,\n" + "the pbx engine will continue dialplan execution at the specified location in the dialplan.\n" + "If the current time is within the given time specification, the channel will continue at\n" + "'labeliftrue'. Otherwise the channel will continue at 'labeliffalse'. If the label chosen\n" + "by the condition is omitted, no jump is performed, and execution passes to the next\n" + "instruction. If the target jump location is bogus, the same actions would be taken as for\n" + "Goto.\n" "Further information on the time specification can be found in examples\n" - "illustrating how to do time-based context includes in the dialplan.\n" - "If the target jump location is bogus, the same actions would be taken as for Goto.\n" + "illustrating how to do time-based context includes in the dialplan.\n" }, { "ImportVar", pbx_builtin_importvar, @@ -6903,12 +6908,11 @@ static int pbx_builtin_hangup(struct ast_channel *chan, void *data) */ static int pbx_builtin_gotoiftime(struct ast_channel *chan, void *data) { - int res = 0; - char *s, *ts; + char *s, *ts, *branch1, *branch2, *branch; struct ast_timing timing; if (ast_strlen_zero(data)) { - ast_log(LOG_WARNING, "GotoIfTime requires an argument:\n