]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix refactor typo
authorAnthony Minessale <anthony.minessale@gmail.com>
Mon, 21 Jul 2008 14:55:49 +0000 (14:55 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Mon, 21 Jul 2008 14:55:49 +0000 (14:55 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9120 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_ivr_originate.c

index 8ed77d188d7414258e7426071593e66fc3baa7d0..70d739e9a7aa7e98d5d07d44a87b84f409cf5139 100644 (file)
@@ -268,9 +268,11 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_wait_for_answer(switch_core_session_t
        switch_frame_t *read_frame = NULL;
        switch_status_t status = SWITCH_STATUS_SUCCESS;
        int timelimit = 60;
-       const char *var = switch_channel_get_variable(caller_channel, "call_timeout");
+       const char *var;
        switch_time_t start = 0;
 
+       switch_assert(peer_channel);
+       
        if (session) {
                caller_channel = switch_core_session_get_channel(session);
        }
@@ -282,7 +284,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_wait_for_answer(switch_core_session_t
        switch_zmalloc(write_frame.data, SWITCH_RECOMMENDED_BUFFER_SIZE);
        write_frame.buflen = SWITCH_RECOMMENDED_BUFFER_SIZE;
 
-       if (var) {
+       if (caller_channel && (var = switch_channel_get_variable(caller_channel, "call_timeout"))) {
                timelimit = atoi(var);
                if (timelimit < 0) {
                        timelimit = 60;