]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
tweak
authorAnthony Minessale <anthony.minessale@gmail.com>
Tue, 28 Oct 2008 16:01:15 +0000 (16:01 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Tue, 28 Oct 2008 16:01:15 +0000 (16:01 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10179 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_core_state_machine.c

index 94f3e139a219564d828365e258ef56e9abd4edf9..6b5f2fc4236fc75b1b48aa67dc00168a58de0a91 100644 (file)
@@ -78,7 +78,7 @@ static void switch_core_standard_on_routing(switch_core_session_t *session)
                                for (x = 0; x < argc; x++) {
                                        char *dpname = dp[x];
                                        char *dparg = NULL;
-
+                                       
                                        if (dpname) {
                                                if ((dparg = strchr(dpname, ':'))) {
                                                        *dparg++ = '\0';
@@ -89,7 +89,7 @@ static void switch_core_standard_on_routing(switch_core_session_t *session)
                                        if (!(dialplan_interface = switch_loadable_module_get_dialplan_interface(dpname))) {
                                                continue;
                                        }
-
+                                       
                                        count++;
 
                                        if ((extension = dialplan_interface->hunt_function(session, dparg, NULL)) != 0) {
@@ -103,8 +103,13 @@ static void switch_core_standard_on_routing(switch_core_session_t *session)
 
                if (!count) {
                        if (switch_channel_test_flag(session->channel, CF_OUTBOUND)) {
-                               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "No Dialplan, changing state to HOLD\n");
-                               switch_channel_set_state(session->channel, CS_CONSUME_MEDIA);
+                               if (switch_channel_test_flag(session->channel, CF_ANSWERED)) {
+                                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "No Dialplan on answered channel, changing state to HANGUP\n");
+                                       switch_channel_hangup(session->channel, SWITCH_CAUSE_NO_ROUTE_DESTINATION);
+                               } else {
+                                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "No Dialplan, changing state to CONSUME_MEDIA\n");
+                                       switch_channel_set_state(session->channel, CS_CONSUME_MEDIA);
+                               }
                                goto end;
                        }
                }