diff options
author | Alexander Traud <pabstraud@compuserve.com> | 2015-11-06 13:57:15 +0100 |
---|---|---|
committer | Alexander Traud <pabstraud@compuserve.com> | 2015-11-06 13:59:30 +0100 |
commit | 9d6e9173491554c561a0cb13045bb17e5ced9cae (patch) | |
tree | 5211da08fed89e7218aea5345dd45c0bbdb740ea /res | |
parent | f12ebe35848c2ce82e53b332742e83b2b5875502 (diff) |
res_pjsip_sdp_rtp: Enable Opus to be negotiated via SIP/SDP.
In SIP/SDP, Opus has two channels always (see RFC 7587 section 7). The actual
amount of channels is negotiated in-band. Therefore now, the Opus codec and its
attribute rtpmap are registered with two channels.
ASTERISK-24779 #close
Reported by: PowerPBX
Tested by: Alexander Traud
patches:
asterisk-24779.patch submitted by Sean Bright (license #5060)
Change-Id: Ic7ac13cafa1d3450b4fa4987350924b42cbb657b
Diffstat (limited to 'res')
-rw-r--r-- | res/res_pjsip_sdp_rtp.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/res/res_pjsip_sdp_rtp.c b/res/res_pjsip_sdp_rtp.c index a66aebb36..3828f7e78 100644 --- a/res/res_pjsip_sdp_rtp.c +++ b/res/res_pjsip_sdp_rtp.c @@ -396,8 +396,11 @@ static pjmedia_sdp_attr* generate_rtpmap_attr(struct ast_sip_session *session, p rtpmap.pt = media->desc.fmt[media->desc.fmt_count - 1]; rtpmap.clock_rate = ast_rtp_lookup_sample_rate2(asterisk_format, format, code); pj_strdup2(pool, &rtpmap.enc_name, ast_rtp_lookup_mime_subtype2(asterisk_format, format, code, options)); - rtpmap.param.slen = 0; - rtpmap.param.ptr = NULL; + if (!pj_stricmp2(&rtpmap.enc_name, "opus")) { + pj_cstr(&rtpmap.param, "2"); + } else { + pj_cstr(&rtpmap.param, NULL); + } pjmedia_sdp_rtpmap_to_attr(pool, &rtpmap, &attr); |