]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
update
authorAnthony Minessale <anthony.minessale@gmail.com>
Thu, 5 Jun 2008 00:23:58 +0000 (00:23 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Thu, 5 Jun 2008 00:23:58 +0000 (00:23 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8760 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_ivr_originate.c

index a822ef4b55859b233541d678804f5c5f1db837ad..077fb5717d5c69f9d1543553643fd386d2eafa5d 100644 (file)
@@ -1195,7 +1195,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
                                peer_channel = peer_channels[idx];
                        } else {
                                status = SWITCH_STATUS_FALSE;
-                               if (caller_channel) {
+                               if (caller_channel && peer_channel) {
                                        process_import(session, peer_channel);
                                }
                                peer_channel = NULL;
@@ -1238,7 +1238,9 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
                        if (status == SWITCH_STATUS_SUCCESS) {
                                if (caller_channel) {
                                        switch_channel_set_variable(caller_channel, "originate_disposition", "call accepted");
-                                       process_import(session, peer_channel);
+                                       if (peer_channel) {
+                                               process_import(session, peer_channel);
+                                       }
                                }
                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Originate Resulted in Success: [%s]\n", switch_channel_get_name(peer_channel));
                                *cause = SWITCH_CAUSE_SUCCESS;