fix for MODAPP-21
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5499 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
7feef76fb2
commit
bf820aa701
|
@ -242,6 +242,8 @@ SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_dialplan, globals.dialplan)
|
||||||
switch_channel_mark_ring_ready(channel);
|
switch_channel_mark_ring_ready(channel);
|
||||||
|
|
||||||
while (switch_channel_get_state(channel) == CS_INIT && !switch_test_flag(tech_pvt, TFLAG_ANSWER)) {
|
while (switch_channel_get_state(channel) == CS_INIT && !switch_test_flag(tech_pvt, TFLAG_ANSWER)) {
|
||||||
|
switch_size_t olen = globals.timer.samples;
|
||||||
|
|
||||||
if (switch_time_now() - last >= waitsec) {
|
if (switch_time_now() - last >= waitsec) {
|
||||||
char buf[512];
|
char buf[512];
|
||||||
switch_event_t *event;
|
switch_event_t *event;
|
||||||
|
@ -254,26 +256,23 @@ SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_dialplan, globals.dialplan)
|
||||||
switch_channel_event_set_data(channel, event);
|
switch_channel_event_set_data(channel, event);
|
||||||
switch_event_fire(&event);
|
switch_event_fire(&event);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s\n", buf);
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s\n", buf);
|
||||||
last = switch_time_now();
|
last = switch_time_now();
|
||||||
|
}
|
||||||
|
|
||||||
if (ring_file) {
|
if (ring_file) {
|
||||||
unsigned int pos = 0;
|
if (switch_core_timer_next(&globals.timer) != SWITCH_STATUS_SUCCESS) {
|
||||||
switch_core_file_seek(&fh, &pos, 0, SEEK_SET);
|
switch_core_file_close(&fh);
|
||||||
for (;;) {
|
break;
|
||||||
switch_size_t olen = 1024;
|
}
|
||||||
switch_core_file_read(&fh, abuf, &olen);
|
switch_core_file_read(&fh, abuf, &olen);
|
||||||
if (olen == 0) {
|
if (olen == 0) {
|
||||||
break;
|
unsigned int pos = 0;
|
||||||
|
switch_core_file_seek(&fh, &pos, 0, SEEK_SET);
|
||||||
}
|
}
|
||||||
WriteAudioStream(globals.ring_stream, abuf, (long) olen, &globals.timer);
|
WriteAudioStream(globals.ring_stream, abuf, (long) olen, &globals.timer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
switch_yield(globals.read_codec.implementation->microseconds_per_frame);
|
|
||||||
|
|
||||||
}
|
|
||||||
switch_clear_flag_locked((&globals), GFLAG_RING);
|
switch_clear_flag_locked((&globals), GFLAG_RING);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue