[asterisk-users] Change codec when dial from SIP to DAHDI

Matthew Jordan mjordan at digium.com
Thu Sep 25 07:46:56 CDT 2014

On Wed, Sep 24, 2014 at 10:20 PM, d tbsky <tbskyd at gmail.com> wrote:
> hi:
>     I Have tried asterisk 1.6.2, 1.8, 11, 12, 13. all versions behave
> the same => transcode in the middle even two legs use the same code.
>  but I found an article which seems to solve this kind of problem:
>     https://wiki.asterisk.org/wiki/display/AST/Media+Format+Rewrite

That article is in the development section of the wiki. While that
doesn't mean any of the information there is necessarily wrong, its
purpose was to coordinate development efforts, not to define behavior
for end-users.

In this particular case, portions of that page only affect chan_pjsip:


The Offer/Answer use cases below only apply to chan_pjsip. chan_sip,
for better or worse, has its own fun rules about what codecs are
offered and when.

/* add_sdp: */

        /* Now, start adding audio codecs. These are added in this order:
           - First what was requested by the calling channel
           - Then preferences in order from sip.conf device config for
this peer/user
           - Then other codecs in capabilities, including video

Changing chan_sip is fraught with peril. As such, we're going to try
and give the power/flexibility of how things are offered/answered to
where we can better maintain/control the behaviour, which means


We worked to make sure that we *didn't* change the offer/answer rules
in chan_sip. The fact that we did a lot work under the hood and things
managed to remain the same was the goal.

chan_pjsip does use a different set of rules for how it offers its
codecs, and should generally follow what it outlined on that wiki


Matthew Jordan
Digium, Inc. | Engineering Manager
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at: http://digium.com & http://asterisk.org

More information about the asterisk-users mailing list