codec_negotiation: Implement outgoing_call_offer_pref
authorGeorge Joseph <gjoseph@digium.com>
Fri, 13 Mar 2020 19:40:46 +0000 (13:40 -0600)
committerFriendly Automation <jenkins2@gerrit.asterisk.org>
Mon, 6 Apr 2020 13:00:49 +0000 (08:00 -0500)
commit2ee455958ee200a03afb9ee01b0034a8ccbe4f39
treed7cfc02fd567e530caaee5f0572853c04065c5ef
parent57a457c26ca00edbd44da71efa0fd20c26c8d293
codec_negotiation: Implement outgoing_call_offer_pref

Based on this new endpoint setting, a joint list of preferred codecs
between those received from the Asterisk core (remote), and those
specified in the endpoint's "allow" parameter (local) is created and
is used to create the outgoing SDP offer.

* Add outgoing_call_offer_pref to pjsip_configuration (endpoint)

* Add "call_direction" to res_pjsip_session.

* Update pjsip_session_caps.c to make the functions more generic
  so they could be used for both incoming and outgoing.

* Update ast_sip_session_create_outgoing to create the
  pending_media_state->topology with the results of
  ast_sip_session_create_joint_call_stream().

* The endpoint "preferred_codec_only" option now automatically sets
  AST_SIP_CALL_CODEC_PREF_FIRST in incoming_call_offer_pref.

* A helper function ast_stream_get_format_count() was added to
  streams to return the current count of formats.

ASTERISK-28777

Change-Id: Id4ec0b4a906c2ae5885bf947f101c59059935437
13 files changed:
configs/samples/pjsip.conf.sample
doc/CHANGES-staging/res_pjsip_call_offer_pref.txt [new file with mode: 0644]
doc/CHANGES-staging/res_pjsip_incoming_call_offer_pref.txt [deleted file]
include/asterisk/res_pjsip.h
include/asterisk/res_pjsip_session.h
include/asterisk/res_pjsip_session_caps.h
include/asterisk/stream.h
main/stream.c
res/res_pjsip.c
res/res_pjsip/pjsip_configuration.c
res/res_pjsip_sdp_rtp.c
res/res_pjsip_session.c
res/res_pjsip_session/pjsip_session_caps.c