[Freeswitch-svn] [commit] r12144 - freeswitch/trunk/src/mod/dialplans/mod_dialplan_xml

FreeSWITCH SVN anthm at freeswitch.org
Wed Feb 18 12:23:10 PST 2009


Author: anthm
Date: Wed Feb 18 14:23:10 2009
New Revision: 12144

Log:
make previous auto hunt feature optional and off by defaule use auto_hunt=true session or global variable to enable

Modified:
   freeswitch/trunk/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c

Modified: freeswitch/trunk/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c
==============================================================================
--- freeswitch/trunk/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c	(original)
+++ freeswitch/trunk/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c	Wed Feb 18 14:23:10 2009
@@ -215,8 +215,9 @@
 {
 	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 @@
 		}
 	}
 
-	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");
 	}
 



More information about the Freeswitch-svn mailing list