client: add features to generate and parse codec information

The current implementation does not support any way to influence the
codec that is negotiated via SDP or LCO. The client statically
negotitates AMR on an invalid payload type number. Also we ignore
any codec information in the responses.

- Add struct members to allow setting of user defined codec information.
- Add struct members to retrieve parsed codec info from responses.
- Add code to generate codec information in SDP
- Add code to parse SDP codec info in MGCP responses

Change-Id: I78e72d41b73acfcb40599a0ff4823f17c3642059
Related: OS#2728
Related: OS#3334
diff --git a/tests/mgcp_client/mgcp_client_test.ok b/tests/mgcp_client/mgcp_client_test.ok
index fc6db30..454ee3d 100644
--- a/tests/mgcp_client/mgcp_client_test.ok
+++ b/tests/mgcp_client/mgcp_client_test.ok
@@ -18,8 +18,9 @@
 s=-

 c=IN IP4 10.9.1.120

 t=0 0

-m=audio 16002 RTP/AVP 98

-a=rtpmap:98 AMR/8000

+m=audio 16002 RTP/AVP 110 96

+a=rtpmap:110 AMR/8000

+a=rtpmap:96 GSM-EFR/8000

 a=ptime:20

 
 -----
@@ -29,16 +30,39 @@
   head.comment = OK
   audio_port = 16002
   audio_ip = 10.9.1.120
+  ptime = 20
+  codecs_len = 2
+  codecs[0] = 112
+  codecs[1] = 110
+  ptmap_len = 2
+  ptmap[0].codec = 112
+  ptmap[0].pt = 110
+  ptmap[1].codec = 110
+  ptmap[1].pt = 96
 
 Generated CRCX message:
 CRCX 1 23@mgw MGCP 1.0

 C: 2f

 I: 11

-L: p:20, a:AMR, nt:IN

+L: p:20, a:GSM, nt:IN

+M: sendrecv

+
+Generated CRCX message (two codecs):
+CRCX 2 23@mgw MGCP 1.0

+C: 2f

+I: 11

+L: p:20, a:GSM;AMR, nt:IN

+M: sendrecv

+
+Generated CRCX message (three codecs, one with custom pt):
+CRCX 3 23@mgw MGCP 1.0

+C: 2f

+I: 11

+L: p:20, a:GSM;AMR;GSM-EFR, nt:IN

 M: sendrecv

 
 Generated MDCX message:
-MDCX 2 23@mgw MGCP 1.0

+MDCX 4 23@mgw MGCP 1.0

 C: 2f

 I: 11

 M: sendrecv

@@ -48,18 +72,50 @@
 s=-

 c=IN IP4 192.168.100.23

 t=0 0

-m=audio 1234 RTP/AVP 255

+m=audio 1234 RTP/AVP 3

+a=ptime:20

+
+Generated MDCX message (two codecs):
+MDCX 5 23@mgw MGCP 1.0

+C: 2f

+I: 11

+M: sendrecv

+

+v=0

+o=- 2f 23 IN IP4 127.0.0.1

+s=-

+c=IN IP4 192.168.100.23

+t=0 0

+m=audio 1234 RTP/AVP 3 112

+a=rtpmap:112 AMR/8000/1

+a=ptime:20

+
+Generated MDCX message (three codecs, one with custom pt):
+MDCX 6 23@mgw MGCP 1.0

+C: 2f

+I: 11

+M: sendrecv

+

+v=0

+o=- 2f 23 IN IP4 127.0.0.1

+s=-

+c=IN IP4 192.168.100.23

+t=0 0

+m=audio 1234 RTP/AVP 3 112 96

+a=rtpmap:112 AMR/8000/1

+a=rtpmap:96 GSM-EFR/8000/1

+a=ptime:20

 
 Generated DLCX message:
-DLCX 3 23@mgw MGCP 1.0

+DLCX 7 23@mgw MGCP 1.0

 C: 2f

 I: 11

 
 Generated AUEP message:
-AUEP 4 23@mgw MGCP 1.0

+AUEP 8 23@mgw MGCP 1.0

 
 Generated RSIP message:
-RSIP 5 23@mgw MGCP 1.0

+RSIP 9 23@mgw MGCP 1.0

 
 Overfolow test:
 
@@ -102,4 +158,33 @@
 test_sdp_section_start() test [8]:
 
 test_sdp_section_start() test [9]:
+ 110 => 96
+ 111 => 97
+ 112 => 98
+ 113 => 99
+ 96 <= 110
+ 97 <= 111
+ 98 <= 112
+ 99 <= 113
+
+ 0 => 0
+ 3 => 3
+ 8 => 8
+ 18 => 18
+ 0 <= 0
+ 3 <= 3
+ 8 <= 8
+ 18 <= 18
+
+ 110 => 96
+ 111 => 97
+ 112 => 98
+ 113 => 113
+ 0 => 0
+ 96 <= 110
+ 97 <= 111
+ 98 <= 112
+ 2 <= 2
+ 100 <= 100
+
 Done