FS-4990 --resolve

This commit is contained in:
Anthony Minessale 2013-04-26 17:23:30 -05:00
parent 49b999c167
commit e495702e7d
9 changed files with 31 additions and 23 deletions

View File

@ -928,7 +928,7 @@ typedef enum {
SWITCH_MESSAGE_INDICATE_REQUEST_IMAGE_MEDIA,
SWITCH_MESSAGE_INDICATE_UUID_CHANGE,
SWITCH_MESSAGE_INDICATE_SIMPLIFY,
SWITCH_MESSAGE_INDICATE_DEBUG_AUDIO,
SWITCH_MESSAGE_INDICATE_DEBUG_MEDIA,
SWITCH_MESSAGE_INDICATE_PROXY_MEDIA,
SWITCH_MESSAGE_INDICATE_APPLICATION_EXEC,
SWITCH_MESSAGE_INDICATE_APPLICATION_EXEC_COMPLETE,

View File

@ -3563,8 +3563,8 @@ SWITCH_STANDARD_API(uuid_video_refresh_function)
}
#define DEBUG_AUDIO_SYNTAX "<uuid> <read|write|both> <on|off>"
SWITCH_STANDARD_API(uuid_debug_audio_function)
#define DEBUG_MEDIA_SYNTAX "<uuid> <read|write|both|vread|vwrite|vboth> <on|off>"
SWITCH_STANDARD_API(uuid_debug_media_function)
{
char *mycmd = NULL, *argv[3] = { 0 };
int argc = 0;
@ -3575,13 +3575,13 @@ SWITCH_STANDARD_API(uuid_debug_audio_function)
}
if (zstr(cmd) || argc < 3 || zstr(argv[0]) || zstr(argv[1]) || zstr(argv[2])) {
stream->write_function(stream, "-USAGE: %s\n", DEBUG_AUDIO_SYNTAX);
stream->write_function(stream, "-USAGE: %s\n", DEBUG_MEDIA_SYNTAX);
goto done;
} else {
switch_core_session_message_t msg = { 0 };
switch_core_session_t *lsession = NULL;
msg.message_id = SWITCH_MESSAGE_INDICATE_DEBUG_AUDIO;
msg.message_id = SWITCH_MESSAGE_INDICATE_DEBUG_MEDIA;
msg.string_array_arg[0] = argv[1];
msg.string_array_arg[1] = argv[2];
msg.from = __FILE__;
@ -6034,7 +6034,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_commands_load)
SWITCH_ADD_API(commands_api_interface, "uuid_broadcast", "Execute dialplan application", uuid_broadcast_function, BROADCAST_SYNTAX);
SWITCH_ADD_API(commands_api_interface, "uuid_buglist", "List media bugs on a session", uuid_buglist_function, BUGLIST_SYNTAX);
SWITCH_ADD_API(commands_api_interface, "uuid_chat", "Send a chat message", uuid_chat, UUID_CHAT_SYNTAX);
SWITCH_ADD_API(commands_api_interface, "uuid_debug_audio", "Debug audio", uuid_debug_audio_function, DEBUG_AUDIO_SYNTAX);
SWITCH_ADD_API(commands_api_interface, "uuid_debug_media", "Debug media", uuid_debug_media_function, DEBUG_MEDIA_SYNTAX);
SWITCH_ADD_API(commands_api_interface, "uuid_deflect", "Send a deflect", uuid_deflect, UUID_DEFLECT_SYNTAX);
SWITCH_ADD_API(commands_api_interface, "uuid_displace", "Displace audio", session_displace_function, "<uuid> [start|stop] <path> [<limit>] [mux]");
SWITCH_ADD_API(commands_api_interface, "uuid_display", "Update phone display", uuid_display_function, DISPLAY_SYNTAX);
@ -6176,7 +6176,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_commands_load)
switch_console_set_complete("add uuid_broadcast ::console::list_uuid");
switch_console_set_complete("add uuid_buglist ::console::list_uuid");
switch_console_set_complete("add uuid_chat ::console::list_uuid");
switch_console_set_complete("add uuid_debug_audio ::console::list_uuid");
switch_console_set_complete("add uuid_debug_media ::console::list_uuid");
switch_console_set_complete("add uuid_deflect ::console::list_uuid");
switch_console_set_complete("add uuid_displace ::console::list_uuid");
switch_console_set_complete("add uuid_display ::console::list_uuid");

View File

@ -791,8 +791,8 @@ switch_status_t khompReceiveMessage(switch_core_session_t *session, switch_core_
case SWITCH_MESSAGE_INDICATE_SIMPLIFY:
DBG(FUNC, PVT_FMT(tech_pvt->_target, "SWITCH_MESSAGE_INDICATE_SIMPLIFY"));
break;
case SWITCH_MESSAGE_INDICATE_DEBUG_AUDIO:
DBG(FUNC, PVT_FMT(tech_pvt->_target, "SWITCH_MESSAGE_INDICATE_DEBUG_AUDIO"));
case SWITCH_MESSAGE_INDICATE_DEBUG_MEDIA:
DBG(FUNC, PVT_FMT(tech_pvt->_target, "SWITCH_MESSAGE_INDICATE_DEBUG_MEDIA"));
break;
case SWITCH_MESSAGE_INDICATE_PROXY_MEDIA:
DBG(FUNC, PVT_FMT(tech_pvt->_target, "SWITCH_MESSAGE_INDICATE_PROXY_MEDIA"));

View File

@ -1687,30 +1687,38 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
}
}
break;
case SWITCH_MESSAGE_INDICATE_DEBUG_AUDIO:
case SWITCH_MESSAGE_INDICATE_DEBUG_MEDIA:
{
if (switch_rtp_ready(tech_pvt->rtp_session) && !zstr(msg->string_array_arg[0]) && !zstr(msg->string_array_arg[1])) {
switch_rtp_t *rtp = tech_pvt->rtp_session;
const char *direction = msg->string_array_arg[0];
if (direction && *direction == 'v') {
direction++;
rtp = tech_pvt->video_rtp_session;
}
if (switch_rtp_ready(rtp) && !zstr(direction) && !zstr(msg->string_array_arg[1])) {
int32_t flags = 0;
if (!strcasecmp(msg->string_array_arg[0], "read")) {
if (!strcasecmp(direction, "read")) {
flags |= SWITCH_RTP_FLAG_DEBUG_RTP_READ;
} else if (!strcasecmp(msg->string_array_arg[0], "write")) {
} else if (!strcasecmp(direction, "write")) {
flags |= SWITCH_RTP_FLAG_DEBUG_RTP_WRITE;
} else if (!strcasecmp(msg->string_array_arg[0], "both")) {
} else if (!strcasecmp(direction, "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);
switch_rtp_set_flag(rtp, flags);
} else {
switch_rtp_clear_flag(tech_pvt->rtp_session, flags);
switch_rtp_clear_flag(rtp, flags);
}
} else {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Invalid Options\n");
}
}
}
status = SWITCH_STATUS_FALSE;
status = SWITCH_STATUS_SUCCESS;
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)) {

View File

@ -554,7 +554,7 @@ static switch_status_t channel_receive_message(switch_core_session_t *session, s
assert(tech_pvt != NULL);
switch (msg->message_id) {
case SWITCH_MESSAGE_INDICATE_DEBUG_AUDIO:
case SWITCH_MESSAGE_INDICATE_DEBUG_MEDIA:
{
if (switch_rtp_ready(tech_pvt->rtp_session) && !zstr(msg->string_array_arg[0]) && !zstr(msg->string_array_arg[1])) {
int32_t flags = 0;

View File

@ -26620,7 +26620,7 @@ public enum switch_core_session_message_types_t {
SWITCH_MESSAGE_INDICATE_REQUEST_IMAGE_MEDIA,
SWITCH_MESSAGE_INDICATE_UUID_CHANGE,
SWITCH_MESSAGE_INDICATE_SIMPLIFY,
SWITCH_MESSAGE_INDICATE_DEBUG_AUDIO,
SWITCH_MESSAGE_INDICATE_DEBUG_MEDIA,
SWITCH_MESSAGE_INDICATE_PROXY_MEDIA,
SWITCH_MESSAGE_INDICATE_APPLICATION_EXEC,
SWITCH_MESSAGE_INDICATE_APPLICATION_EXEC_COMPLETE,

View File

@ -26538,7 +26538,7 @@ public enum switch_core_session_message_types_t {
SWITCH_MESSAGE_INDICATE_REQUEST_IMAGE_MEDIA,
SWITCH_MESSAGE_INDICATE_UUID_CHANGE,
SWITCH_MESSAGE_INDICATE_SIMPLIFY,
SWITCH_MESSAGE_INDICATE_DEBUG_AUDIO,
SWITCH_MESSAGE_INDICATE_DEBUG_MEDIA,
SWITCH_MESSAGE_INDICATE_PROXY_MEDIA,
SWITCH_MESSAGE_INDICATE_APPLICATION_EXEC,
SWITCH_MESSAGE_INDICATE_APPLICATION_EXEC_COMPLETE,

View File

@ -705,7 +705,7 @@ static const char *message_names[] = {
"REQUEST_IMAGE_MEDIA",
"UUID_CHANGE",
"SIMPLIFY",
"DEBUG_AUDIO",
"DEBUG_MEDIA",
"PROXY_MEDIA",
"APPLICATION_EXEC",
"APPLICATION_EXEC_COMPLETE",

View File

@ -3640,7 +3640,7 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
my_host = switch_get_addr(bufc, sizeof(bufc), rtp_session->local_addr);
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG_CLEAN(session), SWITCH_LOG_CONSOLE,
"R %s b=%ld %s:%u %s:%u %s:%u pt=%d ts=%u m=%d\n",
"R %s b=%4ld %s:%u %s:%u %s:%u pt=%d ts=%u m=%d\n",
switch_channel_get_name(switch_core_session_get_channel(session)),
(long) bytes,
my_host, switch_sockaddr_get_port(rtp_session->local_addr),
@ -4468,7 +4468,7 @@ static int rtp_common_write(switch_rtp_t *rtp_session,
my_host = switch_get_addr(bufc, sizeof(bufc), rtp_session->local_addr);
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG_CLEAN(session), SWITCH_LOG_CONSOLE,
"W %s b=%ld %s:%u %s:%u %s:%u pt=%d ts=%u m=%d\n",
"W %s b=%4ld %s:%u %s:%u %s:%u pt=%d ts=%u m=%d\n",
switch_channel_get_name(switch_core_session_get_channel(session)),
(long) bytes,
my_host, switch_sockaddr_get_port(rtp_session->local_addr),