]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
update
authorAnthony Minessale <anthony.minessale@gmail.com>
Tue, 6 Jun 2006 23:49:02 +0000 (23:49 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Tue, 6 Jun 2006 23:49:02 +0000 (23:49 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@1553 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_wanpipe/mod_wanpipe.c
src/switch_channel.c

index b7c07f1e530d8c04e93d7800811beadb76d1c256..2a4d233c9544f2c8daa3c76e097749edefb5d4be 100644 (file)
@@ -577,11 +577,17 @@ static switch_status_t wanpipe_write_frame(switch_core_session_t *session, switc
 #endif
                towrite = bytes >= globals.mtu ? globals.mtu : bytes;
 
+               if (towrite < globals.mtu) {
+                       int diff = globals.mtu - towrite;
+                       memset(bp + towrite, 0, diff);
+                       towrite = globals.mtu;
+               }
+
                result = sangoma_sendmsg_socket(tech_pvt->socket,
                                                                         &tech_pvt->hdrframe, sizeof(tech_pvt->hdrframe), bp, towrite, 0);
                if (result < 0) {
                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
-                                                                 "Bad Write frame len %u write %d bytes returned %d (%s)!\n", frame->datalen,
+                                                                 "Bad Write frame len %u write %d bytes returned %d (%s)!\n", towrite,
                                                                  globals.mtu, result, strerror(errno));
                        if (errno == EBUSY) {
                                continue;
index 12b3820806b0883ddcebeb16fb7dbbfcfbdafeac..fb54780c12f1dae9b0ac9bde7b41176e76e28f31 100644 (file)
@@ -857,6 +857,10 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_answer(switch_channel_t *
                return SWITCH_STATUS_FALSE;
        }
 
+       if (switch_channel_test_flag(channel, CF_ANSWERED)) {
+               return SWITCH_STATUS_SUCCESS;
+       }
+
        if (switch_core_session_answer_channel(channel->session) == SWITCH_STATUS_SUCCESS) {
                switch_event_t *event;