[SR-Users] RTPengine - Transcoding example available?

Richard Fuchs rfuchs at sipwise.com
Tue Feb 20 20:00:45 CET 2018

On 2018-02-20 05:46 AM, Denys Pozniak wrote:
> Hello!
> Please explain how to achive next:
> Side A supports:
> Side B supports:
> I need to transcode in direction A->B from PCMA to OPUS?
> So should be like this:
> A(PCMA) -> (PCMA)Rtpengine(OPUS)->B(OPUS)
> I configured like this:
> rtpengine_offer("codec-mask-PCMA codec-transcode-opus");
> rtpengine_answer("codec-mask-opus codec-transcode-PCMA");
> But leg from Rtpengine to A has wrong codec (OPUS):
> https://drive.google.com/file/d/14GAIt8lL7Igj9S95b_RS6CXtmGVhjLa1/view

You don't need to put any transcoding options into rtpengine_answer() - 
they should all go into rtpengine_offer()

Since A supports all codecs that B supports except PCMU, you can add 
PCMU into the offer going to B with:

rtpengine_offer("... transcode-PCMU")

But most likely both sides will end up talking Opus (without 
transcoding) since they both support it and it's listed first. If B ends 
up talking PCMU to rtpengine, it will transcode it to Opus as A doesn't 
support PCMA and Opus is first in its list. If either side ends up 
talking PCMA, it's also passed through without transcoding since both 
sides support it.

If you want to force PCMA on A's side and Opus on B's side, you need to:

1) accept PCMA from A, but don't offer it to B: codec-mask-PCMA
2) ignore that Opus was offered from A: codec-strip-opus
3) offer Opus to B: transcode-opus

Make sure you update your rtpengine code base as this use case has only 
just been implemented (previously the `transcode` option would simply 
negate the `codec-strip` which is not what you want). Full example:

rtpengine_offer("... ICE=remove codec-mask-PCMA codec-strip-opus 


More information about the sr-users mailing list