Attention is currently required from: dexter.
dexter uploaded patch set #2 to this change.
mgcp_client_fsm: allow the same codec multiple times in ptmap
Ih struct mgcp_conn_peer, the API user is supposed to fill in the codecs
he which to used and optionally a payload type map (ptmap) that is used
to assign a user defined payload type number for each codec (in case
ptmap is not used, than the IANA/3GPP assigned payload type numbers
apply).
Unfortunately ptmap works like a simple lookup table. When a payload
type is looked up for a specific codec, then the lookup table is
searched for the codec and the payload type of the first entry that is
found is returned. This works fine as long as the same codec is not
apparing twice, which different payload type numbers.
What seems to be a corner case on the first look turns out to be a
common case with AMR, where a bandwith-efficient mode and an
octet-aligned mode may be specified. Then we need to specify AMR twice,
but with different payload type numbers in ptmap.
So, let's equip the function that does the mapping (map_pt_to_codec)
with a memory, so that it can checkmark entries it has already mapped.
This will allow us to put the same codec type multiple times in ptmap
and as long as the order in ptmap matches the order used in codecs the
mapping will be consistent.
Related: OS#6171
Change-Id: Ie13ce59d3165936a16e16588b4d58f0ce7e0ae67
---
M include/osmocom/mgcp_client/mgcp_client.h
M include/osmocom/mgcp_client/mgcp_client_fsm.h
M src/libosmo-mgcp-client/mgcp_client.c
M tests/mgcp_client/mgcp_client_test.c
M tests/mgcp_client/mgcp_client_test.ok
5 files changed, 113 insertions(+), 8 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/49/34349/2
To view, visit change 34349. To unsubscribe, or for help writing mail filters, visit settings.