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
This commit is contained in:
Anthony Minessale 2009-02-18 20:23:10 +00:00
parent 4ecf801683
commit e61c074985
1 changed files with 7 additions and 2 deletions

View 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");
}