]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix
authorAnthony Minessale <anthony.minessale@gmail.com>
Mon, 27 Mar 2006 20:14:34 +0000 (20:14 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Mon, 27 Mar 2006 20:14:34 +0000 (20:14 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@943 d0543943-73ff-0310-b7d9-9358b9ac24b2

libs/jrtplib/src/pthread/jthread.cpp
src/switch_ivr.c

index d658723e9d849885ebdc27835e39971e4cf45106..8c27ddbe7f948d24d5417a48062d17f507dd130f 100644 (file)
@@ -27,6 +27,9 @@
 
 #include "jthread.h"
 #include <stdlib.h>
+#include <stdio.h>
+#include <errno.h>
+#include <string.h>
 
 JThread::JThread()
 {
@@ -48,18 +51,24 @@ int JThread::Start()
        {
                if (!runningmutex.IsInitialized())
                {
-                       if (runningmutex.Init() < 0)
+                       if (runningmutex.Init() < 0) {
+                               printf("STUPID 1\n");
                                return ERR_JTHREAD_CANTINITMUTEX;
+                       }
                }
                if (!continuemutex.IsInitialized())
                {
-                       if (continuemutex.Init() < 0)
+                       if (continuemutex.Init() < 0) {
+                               printf("STUPID 2\n");
                                return ERR_JTHREAD_CANTINITMUTEX;
+                       }
                }
                if (!continuemutex2.IsInitialized())
                {
-                       if (continuemutex2.Init() < 0)
+                       if (continuemutex2.Init() < 0) {
+                               printf("STUPID 3\n");
                                return ERR_JTHREAD_CANTINITMUTEX;
+                       }
                }
                mutexinit = true;
        }
@@ -68,6 +77,7 @@ int JThread::Start()
        if (running)
        {
                runningmutex.Unlock();
+               printf("STUPID 4\n");
                return ERR_JTHREAD_ALREADYRUNNING;
        }
        runningmutex.Unlock();
@@ -77,6 +87,7 @@ int JThread::Start()
        if (status != 0)
        {
                continuemutex.Unlock();
+               printf("STUPID 5 %d (%s) (%s)\n", strerror(errno), strerror(status));
                return ERR_JTHREAD_CANTSTARTTHREAD;
        }
        
index 7d954a29687dac05a6653744aa332f52e0b13e39..e6cd2c9193790efab3f5dd281f8ea9bf9027547f 100644 (file)
@@ -903,12 +903,17 @@ SWITCH_DECLARE(switch_status) switch_ivr_multi_threaded_bridge(switch_core_sessi
 
                /* read from the channel while we wait if the audio is up on it */
                if (switch_channel_test_flag(caller_channel, CF_ANSWERED) || switch_channel_test_flag(caller_channel, CF_EARLY_MEDIA)) {
+
                        if (switch_core_session_read_frame(session, &read_frame, 1000, 0) != SWITCH_STATUS_SUCCESS) {
                                break;
                        }
-                       if (switch_core_session_write_frame(session, read_frame, 1000, 0) != SWITCH_STATUS_SUCCESS) {
-                               break;
+                       if (read_frame) {
+                               memset(read_frame->data, 0, read_frame->datalen);
+                               if (switch_core_session_write_frame(session, read_frame, 1000, 0) != SWITCH_STATUS_SUCCESS) {
+                                       break;
+                               }
                        }
+
                } else {
                        switch_yield(1000);
                }