[asterisk-users] Inquiry:Asterisk different codec schemes?

Kevin P. Fleming kpfleming at digium.com
Mon Jan 4 07:46:38 CST 2010


hadi motamedi wrote:

> Sorry . I didn't get the point clearly . In the SIP Invite message , it
> says "my audio endpoint is IP x.x.x.x port x, and I can use codecs
> A,B,C". The remote endpoint responds with a 200 OK, saying "my audio
> stream is at IP y.y.y.y port y, and I choose codec B". Can you please do
> me favor and let me know if my understanding is right or not ?
> Thank you

No, you are not understanding the SDP offer/answer model properly. If
one endpoint offers codecs A, B and C in its SDP, it is willing to
*receive* media in those formats. The receiver of that offer can choose
to send media to the offerer in any of those formats, at any time. If
the answering endpoint includes only codec B in its SDP, then it is
willing to *receive* only codec B. In that scenario, it is possible for
media to flow from endpoint 1 to endpoint 2 using codec B, and from
endpoint 2 to endpoint 1 using codec A (or C), but this will not happen
if Asterisk is an endpoint in this scenario.

When Asterisk receives a media frame, if the format of that frame is not
the format that it is currently sending to the other endpoint, it will
switch to that format automatically. If it cannot do so because the
other endpoint did not offer to receive that format, then the call's
audio will probably fail. This is the reason why I responded before that
Asterisk does not support asymmetric formats in a media session.

In reality, it is extremely uncommon for a SIP endpoint to want to send
media in a format that it is not also willing to receive; in fact, I
can't say I've ever seen this situation arise in any testing I've done
or in any issues reported in our issue tracker.

-- 
Kevin P. Fleming
Digium, Inc. | Director of Software Technologies
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
skype: kpfleming | jabber: kpfleming at digium.com
Check us out at www.digium.com & www.asterisk.org



More information about the asterisk-users mailing list