From 574884bd45890376e546059c70e8d8953874c950 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 9 Apr 2008 18:15:15 +0000 Subject: [PATCH] add soft_hold git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8065 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/include/switch_ivr.h | 1 + .../applications/mod_dptools/mod_dptools.c | 16 ++++ src/mod/applications/mod_fifo/mod_fifo.c | 32 ++++++-- src/switch_ivr_async.c | 4 +- src/switch_ivr_bridge.c | 2 +- src/switch_ivr_play_say.c | 82 +++++++++++++++++++ 6 files changed, 128 insertions(+), 9 deletions(-) diff --git a/src/include/switch_ivr.h b/src/include/switch_ivr.h index e7c4a45ff0..fb48133783 100644 --- a/src/include/switch_ivr.h +++ b/src/include/switch_ivr.h @@ -750,6 +750,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_read(switch_core_session_t *session, SWITCH_DECLARE(switch_status_t) switch_ivr_bind_dtmf_meta_session(switch_core_session_t *session, uint32_t key, switch_bool_t dial_b, switch_bool_t exec_b, const char *app); SWITCH_DECLARE(switch_status_t) switch_ivr_unbind_dtmf_meta_session(switch_core_session_t *session); +SWITCH_DECLARE(switch_status_t) switch_ivr_soft_hold(switch_core_session_t *session, const char *unhold_key, const char *moh_a, const char *moh_b); /** @} */ diff --git a/src/mod/applications/mod_dptools/mod_dptools.c b/src/mod/applications/mod_dptools/mod_dptools.c index d2cb470085..75a347da38 100644 --- a/src/mod/applications/mod_dptools/mod_dptools.c +++ b/src/mod/applications/mod_dptools/mod_dptools.c @@ -79,6 +79,21 @@ SWITCH_STANDARD_APP(exe_function) } } +#define SOFT_HOLD_SYNTAX " [] []" +SWITCH_STANDARD_APP(soft_hold_function) +{ + char *argv[3] = { 0 }; + int argc; + char *lbuf = NULL; + + if (!switch_strlen_zero(data) && (lbuf = switch_core_session_strdup(session, data)) + && (argc = switch_separate_string(lbuf, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) >= 1) { + switch_ivr_soft_hold(session, argv[0], argv[1], argv[2]); + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Usage: %s\n", SOFT_HOLD_SYNTAX); + } +} + #define BIND_SYNTAX " [a|b] [a|b] " SWITCH_STANDARD_APP(dtmf_bind_function) { @@ -1816,6 +1831,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_dptools_load) SWITCH_ADD_APP(app_interface, "sched_broadcast", SCHED_BROADCAST_DESCR, SCHED_BROADCAST_DESCR, sched_broadcast_function, "[+]