From e61c0749850a54295738ae223c771ffa8639b715 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 18 Feb 2009 20:23:10 +0000 Subject: [PATCH] make previous auto hunt feature optional and off by defaule use auto_hunt=true session or global variable to enable git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12144 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c b/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c index 42646a6578..2d00ef4e86 100644 --- a/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c +++ b/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c @@ -215,8 +215,9 @@ SWITCH_STANDARD_DIALPLAN(dialplan_hunt) { switch_caller_extension_t *extension = NULL; switch_channel_t *channel = switch_core_session_get_channel(session); - switch_xml_t alt_root = NULL, cfg, xml = NULL, xcontext, xexten; + switch_xml_t alt_root = NULL, cfg, xml = NULL, xcontext, xexten = NULL; char *alt_path = (char *) arg; + const char *hunt = NULL; if (!caller_profile) { if (!(caller_profile = switch_channel_get_caller_profile(channel))) { @@ -264,7 +265,11 @@ SWITCH_STANDARD_DIALPLAN(dialplan_hunt) } } - if (!(xexten = switch_xml_find_child(xcontext, "extension", "name", caller_profile->destination_number))) { + if ((hunt = switch_channel_get_variable(channel, "auto_hunt")) && switch_true(hunt)) { + xexten = switch_xml_find_child(xcontext, "extension", "name", caller_profile->destination_number); + } + + if (!xexten) { xexten = switch_xml_child(xcontext, "extension"); }