From 073e4056422ab82efd23fa18362a230609bcfa47 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 4 May 2012 19:48:31 -0500 Subject: [PATCH] do same as last patch with sched_hangup app --- src/mod/applications/mod_dptools/mod_dptools.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/mod/applications/mod_dptools/mod_dptools.c b/src/mod/applications/mod_dptools/mod_dptools.c index 4adfca6611..d5430cf1df 100755 --- a/src/mod/applications/mod_dptools/mod_dptools.c +++ b/src/mod/applications/mod_dptools/mod_dptools.c @@ -1029,9 +1029,10 @@ SWITCH_STANDARD_APP(sched_hangup_function) time_t when; switch_call_cause_t cause = SWITCH_CAUSE_ALLOTTED_TIMEOUT; switch_bool_t bleg = SWITCH_FALSE; + int sec = atol(argv[0] + 1); if (*argv[0] == '+') { - when = switch_epoch_time_now(NULL) + atol(argv[0] + 1); + when = switch_epoch_time_now(NULL) + sec; } else { when = atol(argv[0]); } @@ -1044,7 +1045,11 @@ SWITCH_STANDARD_APP(sched_hangup_function) bleg = SWITCH_TRUE; } - switch_ivr_schedule_hangup(when, switch_core_session_get_uuid(session), cause, bleg); + if (sec == 0) { + switch_channel_hangup(switch_core_session_get_channel(session), cause); + } else { + switch_ivr_schedule_hangup(when, switch_core_session_get_uuid(session), cause, bleg); + } } else { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "No time specified.\n"); }