]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
wait for channels to come up in paging mode
authorAnthony Minessale <anthm@freeswitch.org>
Thu, 31 Mar 2011 01:12:25 +0000 (20:12 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Thu, 31 Mar 2011 01:12:25 +0000 (20:12 -0500)
src/mod/applications/mod_conference/mod_conference.c

index e198d8aa74d14413207432f11e6231667b144b71..5249adda7093a651587225eb47793b2bc05e840c 100644 (file)
@@ -2559,10 +2559,6 @@ static void conference_loop_output(conference_member_t *member)
 
        write_frame.codec = &member->write_codec;
 
-       if (!switch_test_flag(member->conference, CFLAG_ANSWERED)) {
-               switch_channel_answer(channel);
-       }
-
        if (!restarting) {
                /* Start the input thread */
                launch_conference_loop_input(member, switch_core_session_get_pool(member->session));
@@ -2609,8 +2605,22 @@ static void conference_loop_output(conference_member_t *member)
                                }
                                switch_safe_free(cpstr);
                        }
+
+                       do {
+                               switch_ivr_play_file(member->session, NULL, "tone_stream://%(500,0,640)", NULL);
+                       } while(switch_channel_up(channel) && member->conference->originating);
+
+                       if (!switch_channel_ready(channel)) {
+                               member->conference->cancel_cause = SWITCH_CAUSE_ORIGINATOR_CANCEL;
+                               goto end;
+                       }
+                       
                }
        }
+       
+       if (!switch_test_flag(member->conference, CFLAG_ANSWERED)) {
+               switch_channel_answer(channel);
+       }
 
        if (restarting) {
                switch_channel_clear_app_flag(channel, CF_APP_TAGGED);
@@ -2788,8 +2798,9 @@ static void conference_loop_output(conference_member_t *member)
                        switch_cond_next();
                }
 
-       }                                                       /* Rinse ... Repeat */
+       } /* Rinse ... Repeat */
 
+ end:
 
        switch_clear_flag_locked(member, MFLAG_RUNNING);
        switch_core_timer_destroy(&timer);