]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
try to pass cause code on calls ended during early media
authorAnthony Minessale <anthony.minessale@gmail.com>
Thu, 30 Aug 2007 15:38:21 +0000 (15:38 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Thu, 30 Aug 2007 15:38:21 +0000 (15:38 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5682 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_ivr_bridge.c

index c7dc451e419350a7303ad5915a9f7a7cba19308c..164d2a69215f36262fbbcd359c2cdfbadd58c33e 100644 (file)
@@ -84,12 +84,14 @@ static void *audio_bridge_thread(switch_thread_t * thread, void *obj)
                switch_event_t *event;
                loop_count++;
 
-               /* if you really want to make sure it's not ready, test it twice because it might be just a break */
-               if (!switch_channel_ready(chan_a) && !switch_channel_ready(chan_a)) {
+               if (!switch_channel_ready(chan_a)) {
                        break;
                }
 
                if ((b_state = switch_channel_get_state(chan_b)) >= CS_HANGUP) {
+                       if (originator && !ans_a && !ans_b) {
+                               switch_channel_hangup(chan_a, switch_channel_get_cause(chan_b));
+                       }
                        break;
                }
 
@@ -163,8 +165,7 @@ static void *audio_bridge_thread(switch_thread_t * thread, void *obj)
                                continue;
                        }
                }
-
-
+               
                /* read audio from 1 channel and write it to the other */
                status = switch_core_session_read_frame(session_a, &read_frame, -1, stream_id);