diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2015-08-19 14:43:35 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2015-08-19 15:44:44 +0200 |
commit | ceef936ea894781a14584efc9256856cca6d1c0f (patch) | |
tree | 0be10a903b15d6723e98a4488c2dde1ee55ae8a6 /openbsc/src/libmgcp/mgcp_sdp.c | |
parent | 57e95a22f02b5b2ec781d9bc977c785a6e6f1166 (diff) |
mgcp: Add transcoding from PCMU as well
Use the existing ulaw encode/decode to support PCMU as well.
The MERA VoIP switch has some severe issues with the GSM codec
and it appears easier to enable transcoding for it.
The mera switch doesn't appear to cope with codec change
between a SIP 180 trying and the 200 ok connection result.
Inserting the codec is touching too many places. Ideally we
should have the transcoding function as pointer in the struct
as well but the arguments differ.. so it is not a direct way
forward.
Diffstat (limited to 'openbsc/src/libmgcp/mgcp_sdp.c')
-rw-r--r-- | openbsc/src/libmgcp/mgcp_sdp.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/openbsc/src/libmgcp/mgcp_sdp.c b/openbsc/src/libmgcp/mgcp_sdp.c index aa4ef3054..b64894496 100644 --- a/openbsc/src/libmgcp/mgcp_sdp.c +++ b/openbsc/src/libmgcp/mgcp_sdp.c @@ -54,6 +54,7 @@ int mgcp_set_audio_info(void *ctx, struct mgcp_rtp_codec *codec, if (!audio_name) { switch (payload_type) { + case 0: audio_name = "PCMU/8000/1"; break; case 3: audio_name = "GSM/8000/1"; break; case 8: audio_name = "PCMA/8000/1"; break; case 18: audio_name = "G729/8000/1"; break; @@ -89,6 +90,8 @@ int mgcp_set_audio_info(void *ctx, struct mgcp_rtp_codec *codec, payload_type = 3; else if (!strcmp(audio_codec, "PCMA")) payload_type = 8; + else if (!strcmp(audio_codec, "PCMU")) + payload_type = 0; else if (!strcmp(audio_codec, "G729")) payload_type = 18; } @@ -109,6 +112,11 @@ void codecs_initialize(void *ctx, struct sdp_rtp_map *codecs, int used) for (i = 0; i < used; ++i) { switch (codecs[i].payload_type) { + case 0: + codecs[i].codec_name = "PCMU"; + codecs[i].rate = 8000; + codecs[i].channels = 1; + break; case 3: codecs[i].codec_name = "GSM"; codecs[i].rate = 8000; |