mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-24 21:22:09 +00:00
misc changes
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6550 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -1525,18 +1525,22 @@ static switch_status_t channel_receive_message(switch_core_session_t *session, s
|
||||
channel_answer_channel(session);
|
||||
break;
|
||||
case SWITCH_MESSAGE_INDICATE_BRIDGE:
|
||||
/*
|
||||
if (tech_pvt->rtp_session && switch_test_flag(tech_pvt->profile, TFLAG_TIMER)) {
|
||||
switch_rtp_clear_flag(tech_pvt->rtp_session, SWITCH_RTP_FLAG_USE_TIMER);
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "De-activate timed RTP!\n");
|
||||
//switch_rtp_set_flag(tech_pvt->rtp_session, SWITCH_RTP_FLAG_TIMER_RECLOCK);
|
||||
}
|
||||
*/
|
||||
break;
|
||||
case SWITCH_MESSAGE_INDICATE_UNBRIDGE:
|
||||
/*
|
||||
if (tech_pvt->rtp_session && switch_test_flag(tech_pvt->profile, TFLAG_TIMER)) {
|
||||
switch_rtp_set_flag(tech_pvt->rtp_session, SWITCH_RTP_FLAG_USE_TIMER);
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Re-activate timed RTP!\n");
|
||||
//switch_rtp_clear_flag(tech_pvt->rtp_session, SWITCH_RTP_FLAG_TIMER_RECLOCK);
|
||||
}
|
||||
*/
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -805,16 +805,20 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
}
|
||||
/*
|
||||
if (tech_pvt->rtp_session && switch_test_flag(tech_pvt, TFLAG_TIMER)) {
|
||||
switch_rtp_clear_flag(tech_pvt->rtp_session, SWITCH_RTP_FLAG_USE_TIMER);
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "De-activate timed RTP!\n");
|
||||
}
|
||||
*/
|
||||
break;
|
||||
case SWITCH_MESSAGE_INDICATE_UNBRIDGE:
|
||||
/*
|
||||
if (tech_pvt->rtp_session && switch_test_flag(tech_pvt, TFLAG_TIMER)) {
|
||||
switch_rtp_set_flag(tech_pvt->rtp_session, SWITCH_RTP_FLAG_USE_TIMER);
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Re-activate timed RTP!\n");
|
||||
}
|
||||
*/
|
||||
break;
|
||||
case SWITCH_MESSAGE_INDICATE_REDIRECT:
|
||||
if (msg->string_arg) {
|
||||
|
||||
@@ -932,7 +932,7 @@ static switch_bool_t telecast_callback(switch_media_bug_t *bug, void *user_data,
|
||||
break;
|
||||
case SWITCH_ABC_TYPE_CLOSE:
|
||||
break;
|
||||
case SWITCH_ABC_TYPE_WRITE:
|
||||
case SWITCH_ABC_TYPE_READ_PING:
|
||||
if (buffer) {
|
||||
if (switch_core_media_bug_read(bug, &frame) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_buffer_lock(buffer);
|
||||
@@ -943,7 +943,10 @@ static switch_bool_t telecast_callback(switch_media_bug_t *bug, void *user_data,
|
||||
return SWITCH_FALSE;
|
||||
}
|
||||
break;
|
||||
|
||||
case SWITCH_ABC_TYPE_READ:
|
||||
case SWITCH_ABC_TYPE_WRITE:
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -1052,8 +1055,9 @@ void do_telecast(switch_stream_handle_t *stream)
|
||||
switch_mutex_init(&mutex, SWITCH_MUTEX_NESTED, switch_core_session_get_pool(tsession));
|
||||
switch_buffer_create_dynamic(&buffer, 1024, 2048, 0);
|
||||
switch_buffer_add_mutex(buffer, mutex);
|
||||
|
||||
if (switch_core_media_bug_add(tsession, telecast_callback, buffer, 0, SMBF_READ_STREAM | SMBF_WRITE_STREAM, &bug) != SWITCH_STATUS_SUCCESS) {
|
||||
|
||||
if (switch_core_media_bug_add(tsession, telecast_callback, buffer, 0,
|
||||
SMBF_READ_STREAM | SMBF_WRITE_STREAM | SMBF_READ_PING, &bug) != SWITCH_STATUS_SUCCESS) {
|
||||
goto end;
|
||||
}
|
||||
|
||||
@@ -1073,8 +1077,13 @@ void do_telecast(switch_stream_handle_t *stream)
|
||||
bytes = switch_buffer_read(buffer, buf, sizeof(buf));
|
||||
switch_buffer_unlock(buffer);
|
||||
} else {
|
||||
if (!bytes) {
|
||||
switch_yield(1000);
|
||||
continue;
|
||||
}
|
||||
memset(buf, 0, bytes);
|
||||
}
|
||||
|
||||
|
||||
if ((rlen = lame_encode_buffer(gfp, (void *)buf, NULL, bytes / 2, mp3buf, sizeof(mp3buf))) < 0) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "MP3 encode error %d!\n", rlen);
|
||||
|
||||
Reference in New Issue
Block a user