tsearle created an issue (kamailio/kamailio#4232)
### Description
For getting A and B leg QoS stats, Kamailio expects there to be a SSRC key inside the Stream object.
However some versions of rtpengine (tested with mr13.3.1.1) do not send this key. Looking at the master version of rtpengine, I see this key has been added to correspond to ingress SSRCs[0].
This patch adds a checking ingress SSRCs[0] as a fallback if SSRC ### Troubleshooting
#### Reproduction
use kamailio 6.0.1 and rtpengine mr13.3.1.1 using baresip as the calling and called party
the following in the kamailio.cfg
``` modparam("rtpengine", "mos_A_label_pv", "$avp(mos_A_label)") #The name of a pseudovariable to hold the minimum encountered MOS value for the call. The value typically has a range of 1.0 through 5.0. modparam("rtpengine", "mos_min_A_pv", "$avp(mos_min_mos_A)") #The name of a pseudovariable to hold the amount of packetloss in percent at the time the minimum MOS value was encountered; modparam("rtpengine", "mos_min_packetloss_A_pv", "$avp(mos_min_packetloss_A)") #The name of a pseudovariable to hold the amount of jitter in milliseconds at the time the minimum MOS value was encountered; modparam("rtpengine", "mos_min_jitter_A_pv", "$avp(mos_min_jitter_A)") #The name of a pseudovariable to hold the packet round-trip time in microseconds at the time the minimum MOS value was encountered; modparam("rtpengine", "mos_min_roundtrip_A_pv", "$avp(mos_min_roundtrip_A)")
#The name of a pseudovariable to hold the maximum encountered MOS value for the call. The value typically has a range of 1.0 through 5.0. modparam("rtpengine", "mos_max_A_pv", "$avp(mos_max_mos_A)") #The name of a pseudovariable to hold the amount of packetloss in percent at the time the maximum MOS value was encountered; modparam("rtpengine", "mos_max_packetloss_A_pv", "$avp(mos_max_packetloss_A)") #The name of a pseudovariable to hold the amount of jitter in milliseconds at the time the maximum MOS value was encountered; modparam("rtpengine", "mos_max_jitter_A_pv", "$avp(mos_max_jitter_A)") #The name of a pseudovariable to hold the packet round-trip time in microseconds at the time the maximum MOS value was encountered; modparam("rtpengine", "mos_max_roundtrip_A_pv", "$avp(mos_max_roundtrip_A)")
#The name of a pseudovariable to hold the average (median) MOS value for the call. The value typically has a range of 1.0 through 5.0. modparam("rtpengine", "mos_average_A_pv", "$avp(mos_average_mos_A)") #The name of a pseudovariable to hold the average (median) amount of packetloss in percent present throughout the call. modparam("rtpengine", "mos_average_packetloss_A_pv", "$avp(mos_average_packetloss_A)") #The name of a pseudovariable to hold the average (median) amount of jitter in milliseconds present throughout the call. modparam("rtpengine", "mos_average_jitter_A_pv", "$avp(mos_average_jitter_A)") #The name of a pseudovariable to hold the average (median) packet round-trip time in microseconds present throughout the call. modparam("rtpengine", "mos_average_roundtrip_A_pv", "$avp(mos_average_roundtrip_A)")
modparam("rtpengine", "mos_B_label_pv", "$avp(mos_B_label)") #The name of a pseudovariable to hold the minimum encountered MOS value for the call. The value typically has a range of 1.0 through 5.0. modparam("rtpengine", "mos_min_B_pv", "$avp(mos_min_mos_B)") #The name of a pseudovariable to hold the amount of packetloss in percent at the time the minimum MOS value was encountered; modparam("rtpengine", "mos_min_packetloss_B_pv", "$avp(mos_min_packetloss_B)") #The name of a pseudovariable to hold the amount of jitter in milliseconds at the time the minimum MOS value was encountered; modparam("rtpengine", "mos_min_jitter_B_pv", "$avp(mos_min_jitter_B)") #The name of a pseudovariable to hold the packet round-trip time in microseconds at the time the minimum MOS value was encountered; modparam("rtpengine", "mos_min_roundtrip_B_pv", "$avp(mos_min_roundtrip_B)")
#The name of a pseudovariable to hold the maximum encountered MOS value for the call. The value typically has a range of 1.0 through 5.0. modparam("rtpengine", "mos_max_B_pv", "$avp(mos_max_mos_B)") #The name of a pseudovariable to hold the amount of packetloss in percent at the time the maximum MOS value was encountered; modparam("rtpengine", "mos_max_packetloss_B_pv", "$avp(mos_max_packetloss_B)") #The name of a pseudovariable to hold the amount of jitter in milliseconds at the time the maximum MOS value was encountered; modparam("rtpengine", "mos_max_jitter_B_pv", "$avp(mos_max_jitter_B)") #The name of a pseudovariable to hold the packet round-trip time in microseconds at the time the maximum MOS value was encountered; modparam("rtpengine", "mos_max_roundtrip_B_pv", "$avp(mos_max_roundtrip_B)")
#The name of a pseudovariable to hold the average (median) MOS value for the call. The value typically has a range of 1.0 through 5.0. modparam("rtpengine", "mos_average_B_pv", "$avp(mos_average_mos_B)") #The name of a pseudovariable to hold the average (median) amount of packetloss in percent present throughout the call. modparam("rtpengine", "mos_average_packetloss_B_pv", "$avp(mos_average_packetloss_B)") #The name of a pseudovariable to hold the average (median) amount of jitter in milliseconds present throughout the call. modparam("rtpengine", "mos_average_jitter_B_pv", "$avp(mos_average_jitter_B)") #The name of a pseudovariable to hold the average (median) packet round-trip time in microseconds present throughout the call. modparam("rtpengine", "mos_average_roundtrip_B_pv", "$avp(mos_average_roundtrip_B)")
``` #### Debugging Data
<!-- If you got a core dump, use gdb to extract troubleshooting data - full backtrace, local variables and the list of the code at the issue location.
gdb /path/to/kamailio /path/to/corefile bt full info locals list
If you are familiar with gdb, feel free to attach more of what you consider to be relevant. -->
``` (paste your debugging data here) ```
#### Log Messages
``` May 07 06:12:56 tst-ec1-blue-app-116 /usr/sbin/kamailio[3299]: { "level": "DEBUG", "module": "rtpengine", "file": "rtpengine.c", "line": 3684, "function": "rtpp_function_call", "callid": "3df537fef966eb1a", "logprefix": "{BYE <null> 10.152.8.37 3df537fef966eb1a } ", "message": "rtpengine hash table remove entry for callen=16 callid=3df537fef966eb1a viabranch=" } May 07 06:12:56 tst-ec1-blue-app-116 /usr/sbin/kamailio[3299]: { "level": "DEBUG", "module": "rtpengine", "file": "rtpengine.c", "line": 4508, "function": "parse_call_stats_1", "callid": "3df537fef966eb1a", "logprefix": "{BYE <null> 10.152.8.37 3df537fef966eb1a } ", "message": "rtpengine: looking for label 'Aleg_label'" } May 07 06:12:56 tst-ec1-blue-app-116 /usr/sbin/kamailio[3299]: { "level": "DEBUG", "module": "rtpengine", "file": "rtpengine.c", "line": 4514, "function": "parse_call_stats_1", "callid": "3df537fef966eb1a", "logprefix": "{BYE <null> 10.152.8.37 3df537fef966eb1a } ", "message": "rtpengine: XXX got tags" } May 07 06:12:56 tst-ec1-blue-app-116 /usr/sbin/kamailio[3299]: { "level": "DEBUG", "module": "rtpengine", "file": "rtpengine.c", "line": 4517, "function": "parse_call_stats_1", "callid": "3df537fef966eb1a", "logprefix": "{BYE <null> 10.152.8.37 3df537fef966eb1a } ", "message": "rtpengine: XXX got tag" } May 07 06:12:56 tst-ec1-blue-app-116 /usr/sbin/kamailio[3299]: { "level": "DEBUG", "module": "rtpengine", "file": "rtpengine.c", "line": 4522, "function": "parse_call_stats_1", "callid": "3df537fef966eb1a", "logprefix": "{BYE <null> 10.152.8.37 3df537fef966eb1a } ", "message": "rtpengine: XXX got label Aleg_label" } May 07 06:12:56 tst-ec1-blue-app-116 /usr/sbin/kamailio[3299]: { "level": "DEBUG", "module": "rtpengine", "file": "rtpengine.c", "line": 4525, "function": "parse_call_stats_1", "callid": "3df537fef966eb1a", "logprefix": "{BYE <null> 10.152.8.37 3df537fef966eb1a } ", "message": "rtpengine: XXX label match" } May 07 06:12:56 tst-ec1-blue-app-116 /usr/sbin/kamailio[3299]: { "level": "DEBUG", "module": "rtpengine", "file": "rtpengine.c", "line": 4530, "function": "parse_call_stats_1", "callid": "3df537fef966eb1a", "logprefix": "{BYE <null> 10.152.8.37 3df537fef966eb1a } ", "message": "rtpengine: XXX got medias" } May 07 06:12:56 tst-ec1-blue-app-116 /usr/sbin/kamailio[3299]: { "level": "DEBUG", "module": "rtpengine", "file": "rtpengine.c", "line": 4532, "function": "parse_call_stats_1", "callid": "3df537fef966eb1a", "logprefix": "{BYE <null> 10.152.8.37 3df537fef966eb1a } ", "message": "rtpengine: XXX got media" } May 07 06:12:56 tst-ec1-blue-app-116 /usr/sbin/kamailio[3299]: { "level": "DEBUG", "module": "rtpengine", "file": "rtpengine.c", "line": 4537, "function": "parse_call_stats_1", "callid": "3df537fef966eb1a", "logprefix": "{BYE <null> 10.152.8.37 3df537fef966eb1a } ", "message": "rtpengine: XXX got streams" } May 07 06:12:56 tst-ec1-blue-app-116 /usr/sbin/kamailio[3299]: { "level": "DEBUG", "module": "rtpengine", "file": "rtpengine.c", "line": 4542, "function": "parse_call_stats_1", "callid": "3df537fef966eb1a", "logprefix": "{BYE <null> 10.152.8.37 3df537fef966eb1a } ", "message": "rtpengine: XXX got stream type 4" } May 07 06:12:56 tst-ec1-blue-app-116 /usr/sbin/kamailio[3299]: { "level": "DEBUG", "module": "rtpengine", "file": "rtpengine.c", "line": 4543, "function": "parse_call_stats_1", "callid": "3df537fef966eb1a", "logprefix": "{BYE <null> 10.152.8.37 3df537fef966eb1a } ", "message": "rtpengine: XXX stream child 'local port'" } May 07 06:12:56 tst-ec1-blue-app-116 /usr/sbin/kamailio[3299]: { "level": "DEBUG", "module": "rtpengine", "file": "rtpengine.c", "line": 4546, "function": "parse_call_stats_1", "callid": "3df537fef966eb1a", "logprefix": "{BYE <null> 10.152.8.37 3df537fef966eb1a } ", "message": "rtpengine: XXX stream child val type 2" } May 07 06:12:56 tst-ec1-blue-app-116 /usr/sbin/kamailio[3299]: { "level": "DEBUG", "module": "rtpengine", "file": "rtpengine.c", "line": 4517, "function": "parse_call_stats_1", "callid": "3df537fef966eb1a", "logprefix": "{BYE <null> 10.152.8.37 3df537fef966eb1a } ", "message": "rtpengine: XXX got tag" } May 07 06:12:56 tst-ec1-blue-app-116 /usr/sbin/kamailio[3299]: { "level": "DEBUG", "module": "rtpengine", "file": "rtpengine.c", "line": 4522, "function": "parse_call_stats_1", "callid": "3df537fef966eb1a", "logprefix": "{BYE <null> 10.152.8.37 3df537fef966eb1a } ", "message": "rtpengine: XXX got label Bleg_label" } May 07 06:12:56 tst-ec1-blue-app-116 /usr/sbin/kamailio[3299]: { "level": "DEBUG", "module": "rtpengine", "file": "rtpengine.c", "line": 4508, "function": "parse_call_stats_1", "callid": "3df537fef966eb1a", "logprefix": "{BYE <null> 10.152.8.37 3df537fef966eb1a } ", "message": "rtpengine: looking for label 'Bleg_label'" } May 07 06:12:56 tst-ec1-blue-app-116 /usr/sbin/kamailio[3299]: { "level": "DEBUG", "module": "rtpengine", "file": "rtpengine.c", "line": 4514, "function": "parse_call_stats_1", "callid": "3df537fef966eb1a", "logprefix": "{BYE <null> 10.152.8.37 3df537fef966eb1a } ", "message": "rtpengine: XXX got tags" } May 07 06:12:56 tst-ec1-blue-app-116 /usr/sbin/kamailio[3299]: { "level": "DEBUG", "module": "rtpengine", "file": "rtpengine.c", "line": 4517, "function": "parse_call_stats_1", "callid": "3df537fef966eb1a", "logprefix": "{BYE <null> 10.152.8.37 3df537fef966eb1a } ", "message": "rtpengine: XXX got tag" } May 07 06:12:56 tst-ec1-blue-app-116 /usr/sbin/kamailio[3299]: { "level": "DEBUG", "module": "rtpengine", "file": "rtpengine.c", "line": 4522, "function": "parse_call_stats_1", "callid": "3df537fef966eb1a", "logprefix": "{BYE <null> 10.152.8.37 3df537fef966eb1a } ", "message": "rtpengine: XXX got label Aleg_label" } May 07 06:12:56 tst-ec1-blue-app-116 /usr/sbin/kamailio[3299]: { "level": "DEBUG", "module": "rtpengine", "file": "rtpengine.c", "line": 4517, "function": "parse_call_stats_1", "callid": "3df537fef966eb1a", "logprefix": "{BYE <null> 10.152.8.37 3df537fef966eb1a } ", "message": "rtpengine: XXX got tag" } May 07 06:12:56 tst-ec1-blue-app-116 /usr/sbin/kamailio[3299]: { "level": "DEBUG", "module": "rtpengine", "file": "rtpengine.c", "line": 4522, "function": "parse_call_stats_1", "callid": "3df537fef966eb1a", "logprefix": "{BYE <null> 10.152.8.37 3df537fef966eb1a } ", "message": "rtpengine: XXX got label Bleg_label" } May 07 06:12:56 tst-ec1-blue-app-116 /usr/sbin/kamailio[3299]: { "level": "DEBUG", "module": "rtpengine", "file": "rtpengine.c", "line": 4525, "function": "parse_call_stats_1", "callid": "3df537fef966eb1a", "logprefix": "{BYE <null> 10.152.8.37 3df537fef966eb1a } ", "message": "rtpengine: XXX label match" } May 07 06:12:56 tst-ec1-blue-app-116 /usr/sbin/kamailio[3299]: { "level": "DEBUG", "module": "rtpengine", "file": "rtpengine.c", "line": 4530, "function": "parse_call_stats_1", "callid": "3df537fef966eb1a", "logprefix": "{BYE <null> 10.152.8.37 3df537fef966eb1a } ", "message": "rtpengine: XXX got medias" } May 07 06:12:56 tst-ec1-blue-app-116 /usr/sbin/kamailio[3299]: { "level": "DEBUG", "module": "rtpengine", "file": "rtpengine.c", "line": 4532, "function": "parse_call_stats_1", "callid": "3df537fef966eb1a", "logprefix": "{BYE <null> 10.152.8.37 3df537fef966eb1a } ", "message": "rtpengine: XXX got media" } May 07 06:12:56 tst-ec1-blue-app-116 /usr/sbin/kamailio[3299]: { "level": "DEBUG", "module": "rtpengine", "file": "rtpengine.c", "line": 4537, "function": "parse_call_stats_1", "callid": "3df537fef966eb1a", "logprefix": "{BYE <null> 10.152.8.37 3df537fef966eb1a } ", "message": "rtpengine: XXX got streams" } May 07 06:12:56 tst-ec1-blue-app-116 /usr/sbin/kamailio[3299]: { "level": "DEBUG", "module": "rtpengine", "file": "rtpengine.c", "line": 4542, "function": "parse_call_stats_1", "callid": "3df537fef966eb1a", "logprefix": "{BYE <null> 10.152.8.37 3df537fef966eb1a } ", "message": "rtpengine: XXX got stream type 4" } May 07 06:12:56 tst-ec1-blue-app-116 /usr/sbin/kamailio[3299]: { "level": "DEBUG", "module": "rtpengine", "file": "rtpengine.c", "line": 4543, "function": "parse_call_stats_1", "callid": "3df537fef966eb1a", "logprefix": "{BYE <null> 10.152.8.37 3df537fef966eb1a } ", "message": "rtpengine: XXX stream child 'local port'" } May 07 06:12:56 tst-ec1-blue-app-116 /usr/sbin/kamailio[3299]: { "level": "DEBUG", "module": "rtpengine", "file": "rtpengine.c", "line": 4546, "function": "parse_call_stats_1", "callid": "3df537fef966eb1a", "logprefix": "{BYE <null> 10.152.8.37 3df537fef966eb1a } ", "message": "rtpengine: XXX stream child val type 2" } ```
tsearle left a comment (kamailio/kamailio#4232)
here is the received statistics that this patch addresses the parsing of [stats.pcap.zip](https://github.com/user-attachments/files/20081901/stats.pcap.zip)
Closed #4232 as completed via #4233.