26
26
#include "statistics.h"
27
27
#include "main.h"
28
28
#include "media_socket.h"
29
+ #include "rtplib.h"
29
30
30
31
#include "rtpengine_config.h"
31
32
@@ -633,6 +634,8 @@ static void cli_incoming_list_callid(str *instr, struct streambuf *replybuffer)
633
634
for (k = ml -> medias .head ; k ; k = k -> next ) {
634
635
md = k -> data ;
635
636
637
+ const struct rtp_payload_type * rtp_pt = __rtp_stats_codec (md );
638
+
636
639
for (o = md -> streams .head ; o ; o = o -> next ) {
637
640
ps = o -> data ;
638
641
@@ -654,7 +657,7 @@ static void cli_incoming_list_callid(str *instr, struct streambuf *replybuffer)
654
657
atomic64_get (& ps -> last_packet ));
655
658
} else {
656
659
streambuf_printf (replybuffer , "------ Media #%u, %15s:%-5hu <> %15s:%-5hu%s, "
657
- "" UINT64F " p, " UINT64F " b, " UINT64F " e, " UINT64F " last_packet, %.9f delay_min, %.9f delay_avg, %.9f delay_max\n" ,
660
+ "" UINT64F " p, " UINT64F " b, " UINT64F " e, " UINT64F " last_packet, " STR_FORMAT ", %.9f delay_min, %.9f delay_avg, %.9f delay_max\n" ,
658
661
md -> index ,
659
662
local_addr , (unsigned int ) (ps -> sfd ? ps -> sfd -> fd .localport : 0 ),
660
663
sockaddr_print_buf (& ps -> endpoint .ip46 ), ps -> endpoint .port ,
@@ -663,21 +666,25 @@ static void cli_incoming_list_callid(str *instr, struct streambuf *replybuffer)
663
666
atomic64_get (& ps -> stats .bytes ),
664
667
atomic64_get (& ps -> stats .errors ),
665
668
atomic64_get (& ps -> last_packet ),
669
+ rtp_pt ? (int ) rtp_pt -> encoding_with_params .len : (int ) strlen ("unknown codec" ),
670
+ rtp_pt ? rtp_pt -> encoding_with_params .s : "unknown codec" ,
666
671
(double ) ps -> stats .delay_min / 1000000 ,
667
672
(double ) ps -> stats .delay_avg / 1000000 ,
668
673
(double ) ps -> stats .delay_max / 1000000 );
669
674
}
670
675
#else
671
676
streambuf_printf (replybuffer , "------ Media #%u, %15s:%-5u <> %15s:%-5u%s, "
672
- "" UINT64F " p, " UINT64F " b, " UINT64F " e, " UINT64F " last_packet\n" ,
677
+ "" UINT64F " p, " UINT64F " b, " UINT64F " e, " UINT64F " last_packet, " STR_FORMAT " \n" ,
673
678
md -> index ,
674
679
local_addr , (unsigned int ) (ps -> selected_sfd ? ps -> selected_sfd -> socket .local .port : 0 ),
675
680
sockaddr_print_buf (& ps -> endpoint .address ), ps -> endpoint .port ,
676
681
(!PS_ISSET (ps , RTP ) && PS_ISSET (ps , RTCP )) ? " (RTCP)" : "" ,
677
682
atomic64_get (& ps -> stats .packets ),
678
683
atomic64_get (& ps -> stats .bytes ),
679
684
atomic64_get (& ps -> stats .errors ),
680
- atomic64_get (& ps -> last_packet ));
685
+ atomic64_get (& ps -> last_packet ),
686
+ rtp_pt ? (int ) rtp_pt -> encoding_with_params .len : (int ) strlen ("unknown codec" ),
687
+ rtp_pt ? rtp_pt -> encoding_with_params .s : "unknown codec" );
681
688
#endif
682
689
}
683
690
}
0 commit comments