Asymmetric_rtp_codec=yes usage

Hi - I’m playing around with asymmetric_rtp_codec=yes in an attempt to get different codecs used in both directions of the same call on 2 back-to-back Asterisk 13.27.1 systems.

I either get the call successfully setup - but the same codec used in both directions. Or the call fails because the 2 endpoints don’t have overlapping codecs.

Possibly I’m misunderstanding how this is supposed to work.

Does anyone have a working example of how to setup this up, or can point me in the right direction, I’d appreciate it.

Thanks in advance.

This option does a few things:

  1. If we’re sending media and it’s one of the negotiated codecs, then we just send it and don’t transcode to what is currently being received.

  2. If we receive media of a different codec we don’t switch what we’re sending.

In practice this works poorly (which is why it isn’t on by default) with either the remote side just sticking to one, or freaking out at receiving a different codec.

Hi Josh,

I got a bit further with it and have succeeded in getting different codecs used in both directions. But the actual codec used depend in the codec used by the local SIP client (on asterisk1) that originated the call.

Can I force Asterisk to output using a specific codec in each direction?

i.e. If asterisk1 is configured to allow (opus, ulaw) and asterisk2 is configured to allow (ulaw, opus) I would like someway to force opus to be used asterisk1->asterisk2 and ulaw to be used in the other direction, regardless of the codecs used by the local SIP client (on asterisk1) that may have originated the call.

Is this configurable somehow (via dialplan possibly)?

There isn’t dialplan options to control such things. The only stuff that exists is for the media offer itself[1]. What you are using is not something that many (if any) people do in practice for the reasons I stated previously, so it’s not something that has been fully explored.

[1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+16+Function_PJSIP_MEDIA_OFFER

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.