mgcp: Parse SDP to get rate and packet duration
This patch parses the 'ptime' and 'maxptime' SDP attributes, and the
SDP rate information and sets up packet_duration_ms accordingly. If
the packet duration is unknown or allows for different values (e.g.
because 'ptime' uses a range or 'maxptime' allows for more than one
frame) the duration is set to 0.
Sponsored-by: On-Waves ehf
diff --git a/openbsc/tests/mgcp/mgcp_test.ok b/openbsc/tests/mgcp/mgcp_test.ok
index 24f9b33..f9dd7cb 100644
--- a/openbsc/tests/mgcp/mgcp_test.ok
+++ b/openbsc/tests/mgcp/mgcp_test.ok
@@ -16,22 +16,22 @@
Testing MDCX1
Testing MDCX2
Testing CRCX
-Packet duration not set
+Detected packet duration: 40
Requested packetetization period: 20-20
Testing MDCX3
Packet duration not set
Requested packetization period not set
Testing MDCX4
-Packet duration not set
+Detected packet duration: 40
Requested packetetization period: 20-20
Testing MDCX4_PT1
-Packet duration not set
+Detected packet duration: 40
Requested packetetization period: 20-40
Testing MDCX4_PT2
-Packet duration not set
+Detected packet duration: 40
Requested packetetization period: 20-20
Testing MDCX4_PT3
-Packet duration not set
+Detected packet duration: 40
Requested packetization period not set
Testing DLCX
Detected packet duration: 20