]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
cleanups
authorMichael Jerris <mike@jerris.com>
Tue, 18 Dec 2007 17:50:39 +0000 (17:50 +0000)
committerMichael Jerris <mike@jerris.com>
Tue, 18 Dec 2007 17:50:39 +0000 (17:50 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6869 d0543943-73ff-0310-b7d9-9358b9ac24b2

libs/stfu/stfu.c
src/switch_ivr.c
src/switch_ivr_originate.c
src/switch_ivr_play_say.c

index 76d39e515e1c6acafb4225686370f4485a8edbef..81b494b8b4b32245662fbfa7614c1848ae0f767e 100644 (file)
@@ -81,7 +81,9 @@ stfu_instance_t *stfu_n_init(uint32_t qlen)
        struct stfu_instance *i;
 
        i = malloc(sizeof(*i));
-       assert(i != NULL);
+       if (!i) {
+               return NULL;
+       }
        memset(i, 0, sizeof(*i));
        stfu_n_init_aqueue(&i->a_queue, qlen);
        stfu_n_init_aqueue(&i->b_queue, qlen);
index 280a6e21558159786502475acc0b85e279061c5e..9e2622e41dff19d6df9137f136dd206e698b050a 100644 (file)
@@ -441,7 +441,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_park(switch_core_session_t *session,
                                        switch_byte_t decoded[SWITCH_RECOMMENDED_BUFFER_SIZE];
                                        uint32_t rate = read_codec->implementation->actual_samples_per_second;
                                        uint32_t dlen = sizeof(decoded);
-                                       switch_status_t status;
+                                       switch_status_t tstatus;
                                        switch_byte_t *sendbuf = NULL;
                                        uint32_t sendlen = 0;
 
@@ -452,9 +452,9 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_park(switch_core_session_t *session,
                                                status = SWITCH_STATUS_SUCCESS;
                                        } else {
                                                if (switch_test_flag(conninfo, SUF_NATIVE)) {
-                                                       status = SWITCH_STATUS_NOOP;
+                                                       tstatus = SWITCH_STATUS_NOOP;
                                                } else {
-                                                       status = switch_core_codec_decode(
+                                                       tstatus = switch_core_codec_decode(
                                                                                                                          read_codec,
                                                                                                                          &conninfo->read_codec,
                                                                                                                          read_frame->data,
@@ -462,17 +462,17 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_park(switch_core_session_t *session,
                                                                                                                          read_codec->implementation->actual_samples_per_second,
                                                                                                                          decoded, &dlen, &rate, &flags);
                                                }
-                                               switch (status) {
+                                               switch (tstatus) {
                                                case SWITCH_STATUS_NOOP:
                                                case SWITCH_STATUS_BREAK:
                                                        sendbuf = read_frame->data;
                                                        sendlen = read_frame->datalen;
-                                                       status = SWITCH_STATUS_SUCCESS;
+                                                       tstatus = SWITCH_STATUS_SUCCESS;
                                                        break;
                                                case SWITCH_STATUS_SUCCESS:
                                                        sendbuf = decoded;
                                                        sendlen = dlen;
-                                                       status = SWITCH_STATUS_SUCCESS;
+                                                       tstatus = SWITCH_STATUS_SUCCESS;
                                                        break;
                                                default:
                                                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Codec Error\n");
@@ -481,7 +481,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_park(switch_core_session_t *session,
                                                }
                                        }
 
-                                       if (status == SWITCH_STATUS_SUCCESS) {
+                                       if (tstatus == SWITCH_STATUS_SUCCESS) {
                                                len = sendlen;
                                                if (switch_socket_sendto(conninfo->socket, conninfo->remote_addr, 0, (void *)sendbuf, &len) != SWITCH_STATUS_SUCCESS) {
                                                        switch_ivr_deactivate_unicast(session);
index c1c8a4282fcf49fd4b3d90ef43aba1babb6a92a1..0e177e8acbfcaec2d12f99d98f7f30dec2ea09cf 100644 (file)
@@ -785,9 +785,9 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
                                /* read from the channel while we wait if the audio is up on it */
                                if (session && (ringback_data || !switch_channel_test_flag(caller_channel, CF_BYPASS_MEDIA)) &&
                                        (switch_channel_test_flag(caller_channel, CF_ANSWERED) || switch_channel_test_flag(caller_channel, CF_EARLY_MEDIA))) {
-                                       switch_status_t status = switch_core_session_read_frame(session, &read_frame, 1000, 0);
+                                       switch_status_t tstatus = switch_core_session_read_frame(session, &read_frame, 1000, 0);
                                        
-                                       if (!SWITCH_READ_ACCEPTABLE(status)) {
+                                       if (!SWITCH_READ_ACCEPTABLE(tstatus)) {
                                                break;
                                        }
                                        
index c67dde3757fb88a3d0342f3547153e50e319ade5..254b4fe1933ec1cecc660eb15006d9224a1f1614 100644 (file)
@@ -1063,13 +1063,13 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
                        }
                } else {                                /* time off the channel (if you must) */
                        switch_frame_t *read_frame;
-                       switch_status_t status;
+                       switch_status_t tstatus;
                        while (switch_channel_ready(channel) && switch_channel_test_flag(channel, CF_HOLD)) {
                                switch_yield(10000);
                        }
-                       status = switch_core_session_read_frame(session, &read_frame, -1, 0);
+                       tstatus = switch_core_session_read_frame(session, &read_frame, -1, 0);
 
-                       if (!SWITCH_READ_ACCEPTABLE(status)) {
+                       if (!SWITCH_READ_ACCEPTABLE(tstatus)) {
                                break;
                        }
 
@@ -1387,13 +1387,13 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_speak_text_handle(switch_core_session
                                }
                        } else {
                                switch_frame_t *read_frame;
-                               switch_status_t status = switch_core_session_read_frame(session, &read_frame, -1, 0);
+                               switch_status_t tstatus = switch_core_session_read_frame(session, &read_frame, -1, 0);
 
                                while (switch_channel_ready(channel) && switch_channel_test_flag(channel, CF_HOLD)) {
                                        switch_yield(10000);
                                }
 
-                               if (!SWITCH_READ_ACCEPTABLE(status)) {
+                               if (!SWITCH_READ_ACCEPTABLE(tstatus)) {
                                        break;
                                }
 
@@ -1450,13 +1450,13 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_speak_text_handle(switch_core_session
                        }
                } else {                                /* time off the channel (if you must) */
                        switch_frame_t *read_frame;
-                       switch_status_t status = switch_core_session_read_frame(session, &read_frame, -1, 0);
+                       switch_status_t tstatus = switch_core_session_read_frame(session, &read_frame, -1, 0);
 
                        while (switch_channel_ready(channel) && switch_channel_test_flag(channel, CF_HOLD)) {
                                switch_yield(10000);
                        }
 
-                       if (!SWITCH_READ_ACCEPTABLE(status)) {
+                       if (!SWITCH_READ_ACCEPTABLE(tstatus)) {
                                break;
                        }