]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
make previous auto hunt feature optional and off by defaule use auto_hunt=true sessio...
authorAnthony Minessale <anthony.minessale@gmail.com>
Wed, 18 Feb 2009 20:23:10 +0000 (20:23 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Wed, 18 Feb 2009 20:23:10 +0000 (20:23 +0000)
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

index 42646a6578d45d7c293acbc3dc3b324830df6195..2d00ef4e867c5fcd3b77d0d204fe3457d74a01e0 100644 (file)
@@ -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");
        }