diff --git a/src/mod/codecs/mod_sangoma_codec/mod_sangoma_codec.c b/src/mod/codecs/mod_sangoma_codec/mod_sangoma_codec.c index d5ce08b3fc..4e3339bea2 100644 --- a/src/mod/codecs/mod_sangoma_codec/mod_sangoma_codec.c +++ b/src/mod/codecs/mod_sangoma_codec/mod_sangoma_codec.c @@ -737,10 +737,14 @@ SWITCH_STANDARD_API(sangoma_function) stream->write_function(stream, "Failed to find session %lu\n", sessid); goto done; } - stream->write_function(stream, "Session: %lu\n", sessid); + stream->write_function(stream, "Stats for transcoding session: %lu\n", sessid); if (sess->encoder.rxrtp) { stats = switch_rtp_get_stats(sess->encoder.rxrtp, NULL); + stream->write_function(stream, "=== Encoder ===\n"); + + stream->write_function(stream, "Remote address: %s:%d\n\n", switch_rtp_get_remote_host(sess->encoder.rxrtp), switch_rtp_get_remote_port(sess->encoder.rxrtp)); + stream->write_function(stream, "-- Encoder Inbound Stats --\n"); stream->write_function(stream, "Rx Discarded: %lu\n", sess->encoder.rxdiscarded); sangoma_print_stats(stream, &stats->inbound); @@ -749,10 +753,16 @@ SWITCH_STANDARD_API(sangoma_function) stats = switch_rtp_get_stats(sess->encoder.txrtp, NULL); stream->write_function(stream, "-- Encoder Outbound Stats --\n"); sangoma_print_stats(stream, &stats->outbound); + } else { + stream->write_function(stream, "\n=== No Encoder ===\n\n"); } if (sess->decoder.rxrtp) { stats = switch_rtp_get_stats(sess->decoder.rxrtp, NULL); + + stream->write_function(stream, "=== Decoder ===\n"); + stream->write_function(stream, "Remote address: %s:%d\n\n", switch_rtp_get_remote_host(sess->decoder.rxrtp), switch_rtp_get_remote_port(sess->decoder.rxrtp)); + stream->write_function(stream, "-- Decoder Inbound Stats --\n"); stream->write_function(stream, "Rx Discarded: %lu\n", sess->decoder.rxdiscarded); sangoma_print_stats(stream, &stats->inbound); @@ -760,6 +770,8 @@ SWITCH_STANDARD_API(sangoma_function) stats = switch_rtp_get_stats(sess->decoder.txrtp, NULL); stream->write_function(stream, "-- Decoder Outbound Stats --\n"); sangoma_print_stats(stream, &stats->outbound); + } else { + stream->write_function(stream, "\n=== No Decoder ===\n\n"); } } else { stream->write_function(stream, "Unknown Command [%s]\n", argv[0]);