Skip to content

Correction of the remote_first codec preference setting, REF 14632

Wenpeng Song requested to merge 14632-codec-negotiation-issue into devel

According to asterisk doc:

  • prefer: < pending | configured >
    pending - The codec list in the received SDP answer.
    configured - The codec list from the endpoint.

  • operation : < union | intersect | only_preferred | only_nonpreferred >
    union - Merge the lists with the preferred codecs first.
    intersect - Only common codecs with the preferred codecs first.
    only_preferred - Use only the preferred codecs.
    only_nonpreferred - Use only the non-preferred codecs.

  • keep : < all | first > - all - After the operation, keep all codecs.
    first - After the operation, keep only the first codec.

But in current Asterisk implementation, the remote_first which we currently used for incoming preference has been interrupted wrongly with option "union"(merge).

This leading to the issue that unsupported codec could also got an valid joint cap during ast_sip_session_create_joint_call_cap even if there has no common codec(local codec will be used), but then failure in the later stage which given the 500 SDP negotiation failed response and hangup.

After this correction, unsupported codec will not receiving an valid joint cap during ast_sip_session_create_joint_call_cap if there has no common codec, then a 488 Not Acceptable Here response will be send as expected.

This also improve the behavior when an incoming call has no common codec at all: INVITE-100(Trying)-488(Not Acceptable Here)-ACK, will not have 180(Ringing) in this case.

Edited by Wenpeng Song

Merge request reports