Bug #3442
openfix int mgcp_codec_decide() in mgcp_codec.c
0%
Description
The function mgcp_codec_decide() selects the codec that is later returned with the MGCP response in MGCP. The response is generated from rtp->codec, which is set by mgcp_codec_decide().
Unfortunately, the current implementation of mgcp_codec_decide() makes no sense at all. It only causes no trouble at the moment because endp->tcfg->no_audio_transcoding is set to 0, which means that transcoding is turned on at the moment even though we do not support trans coding.
mgcp_codec_decide() should be revised in the following way:
We remove rtp->codec, because Technically an MGW does not have one selected codec, it knows about several codecs and may make choices based on its transcoding capabilities and policies. In practice this would mean that mgcp_codec_decide() removes all the unsupported codecs from rtp->codecs[]. The functions that generate the SDP will then find only the selected codecs and return them. At the moment we can only return one codec from inside the SDP because we use rtp->codec as data source.
Since we do not support transcoding at the moment there will not be much in mgcp_codec_decide(), endp->tcfg->no_audio_transcoding is set to 0 we can display a warning that tells the user that transcoding is not supported yet.
Updated by dexter almost 6 years ago
We need to fix mgcp_write_response_sdp() first, so that it can send multiple payload type numbers and rtpmap lines.
I have done some preliminary cleanup here, it does not change the functionality yet:
https://gerrit.osmocom.org/#/c/osmo-mgw/+/10310 mgcp_sdp: restructure mgcp_write_response_sdp() (rtpmap)
https://gerrit.osmocom.org/#/c/osmo-mgw/+/10320 mgcp_sdp: restructure mgcp_write_response_sdp() (audio)