@ -1276,7 +1276,7 @@ p:10, a:PCMU -> p:10, a:PCMU
p10, aPCMU -> (null)
'10,a :PCMU' -> '(null)'
Testing mgcp_codec_pt_translat e()
Testing mgcp_codec_find_convertibl e()
#0: same order, but differing payload type numbers
- add codecs on conn0:
0: 112 AMR/8000/1 octet-aligned=1 -> rc=0
@ -1286,13 +1286,19 @@ Testing mgcp_codec_pt_translate()
0: 96 AMR/8000/1 octet-aligned=1 -> rc=0
1: 0 PCMU/8000/1 -> rc=0
2: 97 GSM-HR-08/8000/1 -> rc=0
- mgcp_codec_pt_translate(conn0, conn1, 112) -> 96
- mgcp_codec_pt_translate(conn1, conn0, 96) -> 112
- mgcp_codec_pt_translate(conn0, conn1, 0) -> 0
- mgcp_codec_pt_translate(conn1, conn0, 0) -> 0
- mgcp_codec_pt_translate(conn0, conn1, 111) -> 97
- mgcp_codec_pt_translate(conn1, conn0, 97) -> 111
- mgcp_codec_pt_translate(conn0, conn1, 123) -> -22
- mgcp_codec_from_pt(conn0, 112) -> AMR
- mgcp_codec_find_convertible(conn1, AMR) -> AMR -> 96
- mgcp_codec_from_pt(conn1, 96) -> AMR
- mgcp_codec_find_convertible(conn0, AMR) -> AMR -> 112
- mgcp_codec_from_pt(conn0, 0) -> PCMU
- mgcp_codec_find_convertible(conn1, PCMU) -> PCMU -> 0
- mgcp_codec_from_pt(conn1, 0) -> PCMU
- mgcp_codec_find_convertible(conn0, PCMU) -> PCMU -> 0
- mgcp_codec_from_pt(conn0, 111) -> GSM-HR-08
- mgcp_codec_find_convertible(conn1, GSM-HR-08) -> GSM-HR-08 -> 97
- mgcp_codec_from_pt(conn1, 97) -> GSM-HR-08
- mgcp_codec_find_convertible(conn0, GSM-HR-08) -> GSM-HR-08 -> 111
- mgcp_codec_from_pt(conn0, 123) -> NO RESULT
#1: different order and different payload type numbers
- add codecs on conn0:
0: 0 PCMU/8000/1 -> rc=0
@ -1302,13 +1308,19 @@ Testing mgcp_codec_pt_translate()
0: 97 GSM-HR-08/8000/1 -> rc=0
1: 0 PCMU/8000/1 -> rc=0
2: 96 AMR/8000/1 octet-aligned=1 -> rc=0
- mgcp_codec_pt_translate(conn0, conn1, 112) -> 96
- mgcp_codec_pt_translate(conn1, conn0, 96) -> 112
- mgcp_codec_pt_translate(conn0, conn1, 0) -> 0
- mgcp_codec_pt_translate(conn1, conn0, 0) -> 0
- mgcp_codec_pt_translate(conn0, conn1, 111) -> 97
- mgcp_codec_pt_translate(conn1, conn0, 97) -> 111
- mgcp_codec_pt_translate(conn0, conn1, 123) -> -22
- mgcp_codec_from_pt(conn0, 112) -> AMR
- mgcp_codec_find_convertible(conn1, AMR) -> AMR -> 96
- mgcp_codec_from_pt(conn1, 96) -> AMR
- mgcp_codec_find_convertible(conn0, AMR) -> AMR -> 112
- mgcp_codec_from_pt(conn0, 0) -> PCMU
- mgcp_codec_find_convertible(conn1, PCMU) -> PCMU -> 0
- mgcp_codec_from_pt(conn1, 0) -> PCMU
- mgcp_codec_find_convertible(conn0, PCMU) -> PCMU -> 0
- mgcp_codec_from_pt(conn0, 111) -> GSM-HR-08
- mgcp_codec_find_convertible(conn1, GSM-HR-08) -> GSM-HR-08 -> 97
- mgcp_codec_from_pt(conn1, 97) -> GSM-HR-08
- mgcp_codec_find_convertible(conn0, GSM-HR-08) -> GSM-HR-08 -> 111
- mgcp_codec_from_pt(conn0, 123) -> NO RESULT
#2: both sides have the same payload_type numbers assigned to differing codecs
- add codecs on conn0:
0: 0 PCMU/8000/1 -> rc=0
@ -1318,13 +1330,19 @@ Testing mgcp_codec_pt_translate()
0: 97 GSM-HR-08/8000/1 -> rc=0
1: 0 PCMU/8000/1 -> rc=0
2: 96 AMR/8000/1 octet-aligned=1 -> rc=0
- mgcp_codec_pt_translate(conn0, conn1, 96) -> 97
- mgcp_codec_pt_translate(conn1, conn0, 97) -> 96
- mgcp_codec_pt_translate(conn0, conn1, 97) -> 96
- mgcp_codec_pt_translate(conn1, conn0, 96) -> 97
- mgcp_codec_pt_translate(conn0, conn1, 0) -> 0
- mgcp_codec_pt_translate(conn1, conn0, 0) -> 0
- mgcp_codec_pt_translate(conn0, conn1, 123) -> -22
- mgcp_codec_from_pt(conn0, 96) -> GSM-HR-08
- mgcp_codec_find_convertible(conn1, GSM-HR-08) -> GSM-HR-08 -> 97
- mgcp_codec_from_pt(conn1, 97) -> GSM-HR-08
- mgcp_codec_find_convertible(conn0, GSM-HR-08) -> GSM-HR-08 -> 96
- mgcp_codec_from_pt(conn0, 97) -> AMR
- mgcp_codec_find_convertible(conn1, AMR) -> AMR -> 96
- mgcp_codec_from_pt(conn1, 96) -> AMR
- mgcp_codec_find_convertible(conn0, AMR) -> AMR -> 97
- mgcp_codec_from_pt(conn0, 0) -> PCMU
- mgcp_codec_find_convertible(conn1, PCMU) -> PCMU -> 0
- mgcp_codec_from_pt(conn1, 0) -> PCMU
- mgcp_codec_find_convertible(conn0, PCMU) -> PCMU -> 0
- mgcp_codec_from_pt(conn0, 123) -> NO RESULT
#3: conn0 has no codecs
- add codecs on conn0:
(none)
@ -1332,9 +1350,9 @@ Testing mgcp_codec_pt_translate()
0: 96 AMR/8000/1 octet-aligned=1 -> rc=0
1: 0 PCMU/8000/1 -> rc=0
2: 97 GSM-HR-08/8000/1 -> rc=0
- mgcp_codec_pt_translate(conn0, conn1, 112) -> -22
- mgcp_codec_pt_translate(conn0, conn1, 0) -> -22
- mgcp_codec_pt_translate(conn0, conn1, 111) -> -22
- mgcp_codec_from_pt(conn0, 112) -> NO RESULT
- mgcp_codec_from_pt(conn0, 0) -> NO RESULT
- mgcp_codec_from_pt(conn0, 111) -> NO RESULT
#4: conn1 has no codecs
- add codecs on conn0:
0: 112 AMR/8000/1 octet-aligned=1 -> rc=0
@ -1342,9 +1360,12 @@ Testing mgcp_codec_pt_translate()
2: 111 GSM-HR-08/8000/1 -> rc=0
- add codecs on conn1:
(none)
- mgcp_codec_pt_translate(conn0, conn1, 112) -> -22
- mgcp_codec_pt_translate(conn0, conn1, 0) -> -22
- mgcp_codec_pt_translate(conn0, conn1, 111) -> -22
- mgcp_codec_from_pt(conn0, 112) -> AMR
- mgcp_codec_find_convertible(conn1, AMR) -> NO RESULT
- mgcp_codec_from_pt(conn0, 0) -> PCMU
- mgcp_codec_find_convertible(conn1, PCMU) -> NO RESULT
- mgcp_codec_from_pt(conn0, 111) -> GSM-HR-08
- mgcp_codec_find_convertible(conn1, GSM-HR-08) -> NO RESULT
#5: test AMR with differing octet-aligned settings
- add codecs on conn0:
0: 111 AMR/8000 octet-aligned=1 -> rc=0
@ -1352,43 +1373,55 @@ Testing mgcp_codec_pt_translate()
- add codecs on conn1:
0: 122 AMR/8000 octet-aligned=0 -> rc=0
1: 121 AMR/8000 octet-aligned=1 -> rc=0
- mgcp_codec_pt_translate(conn0, conn1, 111) -> 121
- mgcp_codec_pt_translate(conn1, conn0, 121) -> 111
- mgcp_codec_pt_translate(conn0, conn1, 112) -> 122
- mgcp_codec_pt_translate(conn1, conn0, 122) -> 112
- mgcp_codec_pt_translate(conn0, conn1, 123) -> -22
- mgcp_codec_from_pt(conn0, 111) -> AMR
- mgcp_codec_find_convertible(conn1, AMR) -> AMR -> 121
- mgcp_codec_from_pt(conn1, 121) -> AMR
- mgcp_codec_find_convertible(conn0, AMR) -> AMR -> 111
- mgcp_codec_from_pt(conn0, 112) -> AMR
- mgcp_codec_find_convertible(conn1, AMR) -> AMR -> 122
- mgcp_codec_from_pt(conn1, 122) -> AMR
- mgcp_codec_find_convertible(conn0, AMR) -> AMR -> 112
- mgcp_codec_from_pt(conn0, 123) -> NO RESULT
#6: test AMR with missing octet-aligned settings (oa <-> unset)
- add codecs on conn0:
0: 111 AMR/8000 octet-aligned=1 -> rc=0
- add codecs on conn1:
0: 122 AMR/8000 octet-aligned=unset -> rc=0
- mgcp_codec_pt_translate(conn0, conn1, 111) -> 122
- mgcp_codec_pt_translate(conn1, conn0, 122) -> 111
- mgcp_codec_pt_translate(conn0, conn1, 55) -> -22
- mgcp_codec_from_pt(conn0, 111) -> AMR
- mgcp_codec_find_convertible(conn1, AMR) -> AMR -> 122
- mgcp_codec_from_pt(conn1, 122) -> AMR
- mgcp_codec_find_convertible(conn0, AMR) -> AMR -> 111
- mgcp_codec_from_pt(conn0, 55) -> NO RESULT
#7: test AMR with missing octet-aligned settings (bwe <-> unset)
- add codecs on conn0:
0: 111 AMR/8000 octet-aligned=0 -> rc=0
- add codecs on conn1:
0: 122 AMR/8000 octet-aligned=unset -> rc=0
- mgcp_codec_pt_translate(conn0, conn1, 111) -> 122
- mgcp_codec_pt_translate(conn1, conn0, 122) -> 111
- mgcp_codec_pt_translate(conn0, conn1, 55) -> -22
- mgcp_codec_from_pt(conn0, 111) -> AMR
- mgcp_codec_find_convertible(conn1, AMR) -> AMR -> 122
- mgcp_codec_from_pt(conn1, 122) -> AMR
- mgcp_codec_find_convertible(conn0, AMR) -> AMR -> 111
- mgcp_codec_from_pt(conn0, 55) -> NO RESULT
#8: test AMR with NULL param (oa <-> null)
- add codecs on conn0:
0: 112 AMR/8000 octet-aligned=1 -> rc=0
- add codecs on conn1:
0: 122 AMR/8000 -> rc=0
- mgcp_codec_pt_translate(conn0, conn1, 112) -> 122
- mgcp_codec_pt_translate(conn1, conn0, 122) -> 112
- mgcp_codec_pt_translate(conn0, conn1, 55) -> -22
- mgcp_codec_from_pt(conn0, 112) -> AMR
- mgcp_codec_find_convertible(conn1, AMR) -> AMR -> 122
- mgcp_codec_from_pt(conn1, 122) -> AMR
- mgcp_codec_find_convertible(conn0, AMR) -> AMR -> 112
- mgcp_codec_from_pt(conn0, 55) -> NO RESULT
#9: test AMR with NULL param (bwe <-> null)
- add codecs on conn0:
0: 112 AMR/8000 octet-aligned=0 -> rc=0
- add codecs on conn1:
0: 122 AMR/8000 -> rc=0
- mgcp_codec_pt_translate(conn0, conn1, 112) -> 122
- mgcp_codec_pt_translate(conn1, conn0, 122) -> 112
- mgcp_codec_pt_translate(conn0, conn1, 55) -> -22
- mgcp_codec_from_pt(conn0, 112) -> AMR
- mgcp_codec_find_convertible(conn1, AMR) -> AMR -> 122
- mgcp_codec_from_pt(conn1, 122) -> AMR
- mgcp_codec_find_convertible(conn0, AMR) -> AMR -> 112
- mgcp_codec_from_pt(conn0, 55) -> NO RESULT
#10: match FOO/8000/1 and FOO/8000 as identical, single channel is implicit
- add codecs on conn0:
0: 0 PCMU/8000/1 -> rc=0
@ -1398,13 +1431,19 @@ Testing mgcp_codec_pt_translate()
0: 97 GSM-HR-08/8000 -> rc=0
1: 0 PCMU/8000 -> rc=0
2: 96 AMR/8000 octet-aligned=1 -> rc=0
- mgcp_codec_pt_translate(conn0, conn1, 112) -> 96
- mgcp_codec_pt_translate(conn1, conn0, 96) -> 112
- mgcp_codec_pt_translate(conn0, conn1, 0) -> 0
- mgcp_codec_pt_translate(conn1, conn0, 0) -> 0
- mgcp_codec_pt_translate(conn0, conn1, 111) -> 97
- mgcp_codec_pt_translate(conn1, conn0, 97) -> 111
- mgcp_codec_pt_translate(conn0, conn1, 123) -> -22
- mgcp_codec_from_pt(conn0, 112) -> AMR
- mgcp_codec_find_convertible(conn1, AMR) -> AMR -> 96
- mgcp_codec_from_pt(conn1, 96) -> AMR
- mgcp_codec_find_convertible(conn0, AMR) -> AMR -> 112
- mgcp_codec_from_pt(conn0, 0) -> PCMU
- mgcp_codec_find_convertible(conn1, PCMU) -> PCMU -> 0
- mgcp_codec_from_pt(conn1, 0) -> PCMU
- mgcp_codec_find_convertible(conn0, PCMU) -> PCMU -> 0
- mgcp_codec_from_pt(conn0, 111) -> GSM-HR-08
- mgcp_codec_find_convertible(conn1, GSM-HR-08) -> GSM-HR-08 -> 97
- mgcp_codec_from_pt(conn1, 97) -> GSM-HR-08
- mgcp_codec_find_convertible(conn0, GSM-HR-08) -> GSM-HR-08 -> 111
- mgcp_codec_from_pt(conn0, 123) -> NO RESULT
#11: match FOO/8000/1 and FOO as identical, 8k and single channel are implicit
- add codecs on conn0:
0: 0 PCMU/8000/1 -> rc=0
@ -1414,13 +1453,19 @@ Testing mgcp_codec_pt_translate()
0: 97 GSM-HR-08 -> rc=0
1: 0 PCMU -> rc=0
2: 96 AMR octet-aligned=1 -> rc=0
- mgcp_codec_pt_translate(conn0, conn1, 112) -> 96
- mgcp_codec_pt_translate(conn1, conn0, 96) -> 112
- mgcp_codec_pt_translate(conn0, conn1, 0) -> 0
- mgcp_codec_pt_translate(conn1, conn0, 0) -> 0
- mgcp_codec_pt_translate(conn0, conn1, 111) -> 97
- mgcp_codec_pt_translate(conn1, conn0, 97) -> 111
- mgcp_codec_pt_translate(conn0, conn1, 123) -> -22
- mgcp_codec_from_pt(conn0, 112) -> AMR
- mgcp_codec_find_convertible(conn1, AMR) -> AMR -> 96
- mgcp_codec_from_pt(conn1, 96) -> AMR
- mgcp_codec_find_convertible(conn0, AMR) -> AMR -> 112
- mgcp_codec_from_pt(conn0, 0) -> PCMU
- mgcp_codec_find_convertible(conn1, PCMU) -> PCMU -> 0
- mgcp_codec_from_pt(conn1, 0) -> PCMU
- mgcp_codec_find_convertible(conn0, PCMU) -> PCMU -> 0
- mgcp_codec_from_pt(conn0, 111) -> GSM-HR-08
- mgcp_codec_find_convertible(conn1, GSM-HR-08) -> GSM-HR-08 -> 97
- mgcp_codec_from_pt(conn1, 97) -> GSM-HR-08
- mgcp_codec_find_convertible(conn0, GSM-HR-08) -> GSM-HR-08 -> 111
- mgcp_codec_from_pt(conn0, 123) -> NO RESULT
#12: test whether channel number matching is waterproof
- add codecs on conn0:
0: 111 GSM-HR-08/8000 -> rc=0
@ -1429,10 +1474,12 @@ Testing mgcp_codec_pt_translate()
- add codecs on conn1:
0: 122 GSM-HR-08/8000/2 -> rc=-22
1: 121 GSM-HR-08/8000/1 -> rc=0
- mgcp_codec_pt_translate(conn0, conn1, 111) -> 121
- mgcp_codec_pt_translate(conn1, conn0, 121) -> 111
- mgcp_codec_pt_translate(conn0, conn1, 112) -> -22
- mgcp_codec_pt_translate(conn0, conn1, 113) -> -22
- mgcp_codec_from_pt(conn0, 111) -> GSM-HR-08
- mgcp_codec_find_convertible(conn1, GSM-HR-08) -> GSM-HR-08 -> 121
- mgcp_codec_from_pt(conn1, 121) -> GSM-HR-08
- mgcp_codec_find_convertible(conn0, GSM-HR-08) -> GSM-HR-08 -> 111
- mgcp_codec_from_pt(conn0, 112) -> NO RESULT
- mgcp_codec_from_pt(conn0, 113) -> NO RESULT
Testing test_conn_id_matching
needle='23AB' found '000023AB'