]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
mod_sangoma_codec: update stats to include more verbose rtp tx/rx format information
authorMoises Silva <moy@sangoma.com>
Tue, 12 Oct 2010 17:19:48 +0000 (13:19 -0400)
committerMoises Silva <moy@sangoma.com>
Thu, 14 Oct 2010 15:59:25 +0000 (11:59 -0400)
src/mod/codecs/mod_sangoma_codec/mod_sangoma_codec.c

index 697134b1c82e5196b7552cc417dab6366d9fda4e..19f460be31de6eaea6c4cef4b8d28e8fd7a538a4 100644 (file)
@@ -898,37 +898,40 @@ SWITCH_STANDARD_API(sangoma_function)
 
                if (sess->encoder.rxrtp) {
                        stats = switch_rtp_get_stats(sess->encoder.rxrtp, NULL);
-                       stream->write_function(stream, "=== Encoder ===\n");
+                       stream->write_function(stream, "=== %s Encoder ===\n", sess->impl->iananame);
 
-                       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, "Tx ULAW from %d.%d.%d.%d:%d to %d.%d.%d.%d:%d\n\n", SNGTC_NIPV4(sess->encoder.reply.a.host_ip), sess->encoder.reply.a.host_udp_port,
+                                       SNGTC_NIPV4(sess->encoder.reply.a.codec_ip), sess->encoder.reply.a.codec_udp_port);
+                       stream->write_function(stream, "Rx %s at %d.%d.%d.%d:%d from %d.%d.%d.%d:%d\n\n", sess->impl->iananame, SNGTC_NIPV4(sess->encoder.reply.b.host_ip), sess->encoder.reply.b.host_udp_port,
+                                       SNGTC_NIPV4(sess->encoder.reply.b.codec_ip), sess->encoder.reply.b.codec_udp_port);
 
-                       stream->write_function(stream, "-- Encoder Inbound Stats --\n");
+
+                       stream->write_function(stream, "-- Inbound Stats --\n");
                        stream->write_function(stream, "Rx Discarded: %lu\n", sess->encoder.rxdiscarded);
                        sangoma_print_stats(stream, &stats->inbound);
                        
 
                        stats = switch_rtp_get_stats(sess->encoder.txrtp, NULL);
-                       stream->write_function(stream, "-- Encoder Outbound Stats --\n");
+                       stream->write_function(stream, "-- 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, "=== %s Decoder ===\n", sess->impl->iananame);
+                       stream->write_function(stream, "Tx %s from %d.%d.%d.%d:%d to %d.%d.%d.%d:%d\n\n", sess->impl->iananame, SNGTC_NIPV4(sess->decoder.reply.a.host_ip), sess->decoder.reply.a.host_udp_port,
+                                       SNGTC_NIPV4(sess->decoder.reply.a.codec_ip), sess->decoder.reply.a.codec_udp_port);
+                       stream->write_function(stream, "Rx ULAW at %d.%d.%d.%d:%d from %d.%d.%d.%d:%d\n\n", SNGTC_NIPV4(sess->decoder.reply.b.host_ip), sess->decoder.reply.b.host_udp_port,
+                                       SNGTC_NIPV4(sess->decoder.reply.b.codec_ip), sess->decoder.reply.b.codec_udp_port);
 
-                       stream->write_function(stream, "-- Decoder Inbound Stats --\n");
+                       stream->write_function(stream, "-- Inbound Stats --\n");
                        stream->write_function(stream, "Rx Discarded: %lu\n", sess->decoder.rxdiscarded);
                        sangoma_print_stats(stream, &stats->inbound);
 
                        stats = switch_rtp_get_stats(sess->decoder.txrtp, NULL);
-                       stream->write_function(stream, "-- Decoder Outbound Stats --\n");
+                       stream->write_function(stream, "-- Outbound Stats --\n");
                        sangoma_print_stats(stream, &stats->outbound);
-               } else {
-                       stream->write_function(stream, "\n=== No Decoder ===\n\n");
                }
        } else if (!strcasecmp(argv[0], "debug")) {
                struct sangoma_transcoding_session *sess;