From aabfeee994029864e8c39084d67936af9649a904 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 2 Mar 2006 00:32:45 +0000 Subject: [PATCH] tweak git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@724 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/switch_core.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/switch_core.c b/src/switch_core.c index 231857aa1a..7a15a8dc7e 100644 --- a/src/switch_core.c +++ b/src/switch_core.c @@ -1572,25 +1572,26 @@ static void switch_core_standard_on_hangup(switch_core_session *session) static void switch_core_standard_on_ring(switch_core_session *session) { - switch_dialplan_interface *dialplan_interface; + switch_dialplan_interface *dialplan_interface = NULL; switch_caller_profile *caller_profile; switch_caller_extension *extension; switch_console_printf(SWITCH_CHANNEL_CONSOLE, "Standard RING %s\n", switch_channel_get_name(session->channel)); - - if (switch_channel_test_flag(session->channel, CF_OUTBOUND)) { - switch_channel_set_state(session->channel, CS_TRANSMIT); - return; - } - if ((caller_profile = switch_channel_get_caller_profile(session->channel)) == 0) { switch_console_printf(SWITCH_CHANNEL_CONSOLE, "Can't get profile!\n"); switch_channel_set_state(session->channel, CS_HANGUP); } else { - if ((dialplan_interface = switch_loadable_module_get_dialplan_interface(caller_profile->dialplan)) == 0) { - switch_console_printf(SWITCH_CHANNEL_CONSOLE, "Can't get dialplan [%s]!\n", caller_profile->dialplan); - switch_channel_set_state(session->channel, CS_HANGUP); + if (!switch_strlen_zero(caller_profile->dialplan)) { + dialplan_interface = switch_loadable_module_get_dialplan_interface(caller_profile->dialplan); + } + + if (!dialplan_interface) { + if (switch_channel_test_flag(session->channel, CF_OUTBOUND)) { + switch_console_printf(SWITCH_CHANNEL_CONSOLE, "No Dialplan, changing state to TRANSMIT\n"); + switch_channel_set_state(session->channel, CS_TRANSMIT); + return; + } } else { if ((extension = dialplan_interface->hunt_function(session)) != 0) { switch_channel_set_caller_extension(session->channel, extension);