From 2974734479aa2f1e0a26f5a4096e3b4f72848bce Mon Sep 17 00:00:00 2001 From: Nathan Neulinger Date: Mon, 9 Jun 2014 12:29:47 -0500 Subject: [PATCH] FS-477 mod_skinny: re-add ability to set digit timeout in patterns, update example configs --- conf/vanilla/dialplan/skinny-patterns.xml | 6 +++--- conf/vanilla/skinny_profiles/internal.xml | 3 +++ .../mod_skinny/conf/dialplan/skinny-patterns.xml | 6 +++--- .../mod_skinny/conf/skinny_profiles/internal.xml | 1 + src/mod/endpoints/mod_skinny/mod_skinny.c | 11 ++++++++++- 5 files changed, 20 insertions(+), 7 deletions(-) diff --git a/conf/vanilla/dialplan/skinny-patterns.xml b/conf/vanilla/dialplan/skinny-patterns.xml index b37d8eed82..a6571b792e 100644 --- a/conf/vanilla/dialplan/skinny-patterns.xml +++ b/conf/vanilla/dialplan/skinny-patterns.xml @@ -7,17 +7,17 @@ The special applications: - skinny-process tells skinny to process the call (route, set call forwarding, ...) - skinny-drop tells skinny to drop the call - - skinny-wait tells skinny to wait for more digits + - skinny-wait tells skinny to wait 'data' seconds for more numbers before drop --> - + diff --git a/conf/vanilla/skinny_profiles/internal.xml b/conf/vanilla/skinny_profiles/internal.xml index 0ca4ed0c46..cf93f4a065 100644 --- a/conf/vanilla/skinny_profiles/internal.xml +++ b/conf/vanilla/skinny_profiles/internal.xml @@ -12,6 +12,9 @@ + + + diff --git a/src/mod/endpoints/mod_skinny/conf/dialplan/skinny-patterns.xml b/src/mod/endpoints/mod_skinny/conf/dialplan/skinny-patterns.xml index 69419f36c2..abc81a43cb 100644 --- a/src/mod/endpoints/mod_skinny/conf/dialplan/skinny-patterns.xml +++ b/src/mod/endpoints/mod_skinny/conf/dialplan/skinny-patterns.xml @@ -7,17 +7,17 @@ The special applications: - skinny-process tells skinny to process the call (route, set call forwarding, ...) - skinny-drop tells skinny to drop the call - - skinny-wait tells skinny to wait for more digits + - skinny-wait tells skinny to wait 'data' seconds for more numbers before drop --> - + diff --git a/src/mod/endpoints/mod_skinny/conf/skinny_profiles/internal.xml b/src/mod/endpoints/mod_skinny/conf/skinny_profiles/internal.xml index b042c0553c..98da04abe6 100644 --- a/src/mod/endpoints/mod_skinny/conf/skinny_profiles/internal.xml +++ b/src/mod/endpoints/mod_skinny/conf/skinny_profiles/internal.xml @@ -15,6 +15,7 @@ + --> diff --git a/src/mod/endpoints/mod_skinny/mod_skinny.c b/src/mod/endpoints/mod_skinny/mod_skinny.c index 9bb1cd5339..70c96f8deb 100644 --- a/src/mod/endpoints/mod_skinny/mod_skinny.c +++ b/src/mod/endpoints/mod_skinny/mod_skinny.c @@ -751,6 +751,7 @@ switch_status_t channel_on_routing(switch_core_session_t *session) char *data = NULL; listener_t *listener = NULL; struct channel_on_routing_helper helper = {0}; + int digit_timeout; if(switch_test_flag(tech_pvt, TFLAG_FORCE_ROUTE)) { action = SKINNY_ACTION_PROCESS; @@ -783,7 +784,15 @@ switch_status_t channel_on_routing(switch_core_session_t *session) atoi(switch_channel_get_variable(channel, "skinny_device_instance")), &listener); if (listener) { - listener->digit_timeout_time = switch_mono_micro_time_now() + listener->profile->digit_timeout * 1000; + digit_timeout = listener->profile->digit_timeout; + if (!zstr(data)) { + digit_timeout = atoi(data); + if ( digit_timeout < 100 ) { + digit_timeout *= 1000; + } + } + + listener->digit_timeout_time = switch_mono_micro_time_now() + digit_timeout * 1000; } else { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Could not find listener %s:%s for Channel %s\n", switch_channel_get_variable(channel, "skinny_device_name"), switch_channel_get_variable(channel, "skinny_device_instance"),