add uuid_debug_audio <uuid> <read|write|both> <on|off>

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15274 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2009-10-29 17:52:52 +00:00
parent 8d01cf8e1a
commit b3ec0eac5f
4 changed files with 62 additions and 15 deletions
+18 -4
View File
@@ -1082,14 +1082,28 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
switch (msg->message_id) {
case SWITCH_MESSAGE_INDICATE_DEBUG_AUDIO:
{
if (switch_rtp_ready(tech_pvt->rtp_session)) {
if (switch_true(msg->string_arg)) {
switch_rtp_set_flag(tech_pvt->rtp_session, SWITCH_RTP_FLAG_DEBUG_RTP);
if (switch_rtp_ready(tech_pvt->rtp_session) && !zstr(msg->string_array_arg[0]) && !zstr(msg->string_array_arg[1])) {
int32_t flags = 0;
if (!strcasecmp(msg->string_array_arg[0], "read")) {
flags |= SWITCH_RTP_FLAG_DEBUG_RTP_READ;
} else if (!strcasecmp(msg->string_array_arg[0], "write")) {
flags |= SWITCH_RTP_FLAG_DEBUG_RTP_WRITE;
} else if (!strcasecmp(msg->string_array_arg[0], "both")) {
flags |= SWITCH_RTP_FLAG_DEBUG_RTP_READ | SWITCH_RTP_FLAG_DEBUG_RTP_WRITE;
}
if (flags) {
if (switch_true(msg->string_array_arg[1])) {
switch_rtp_set_flag(tech_pvt->rtp_session, flags);
} else {
switch_rtp_clear_flag(tech_pvt->rtp_session, flags);
}
} else {
switch_rtp_clear_flag(tech_pvt->rtp_session, SWITCH_RTP_FLAG_DEBUG_RTP);
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Invalid Options\n");
}
}
}
status = SWITCH_STATUS_FALSE;
goto end;
case SWITCH_MESSAGE_INDICATE_TRANSCODING_NECESSARY:
if (tech_pvt->rtp_session && switch_rtp_test_flag(tech_pvt->rtp_session, SWITCH_RTP_FLAG_PASS_RFC2833)) {