]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
mod_sangoma_codec: print rtp address in stats
authorMoises Silva <moy@sangoma.com>
Tue, 5 Oct 2010 14:58:26 +0000 (10:58 -0400)
committerMoises Silva <moy@sangoma.com>
Tue, 5 Oct 2010 14:58:42 +0000 (10:58 -0400)
src/mod/codecs/mod_sangoma_codec/mod_sangoma_codec.c

index d5ce08b3fc58724eb83f8ae25564fa3067c41709..4e3339bea2e335e93c0a10040ca0eccee317897b 100644 (file)
@@ -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]);