res_pjsip_session: Add ability to accept multiple sdp answers

pjproject by default currently will follow media forked during an INVITE
on outbound calls if the To tag is different on a subsequent response as
that on an earlier response.  We handle this correctly.  There have
been reported cases where the To tag is the same but we still need to
follow the media.  The pjproject patch in this commit adds the
capability to sip_inv and also adds the capability to control it at
runtime.  The original "different tag" behavior was always controllable
at runtime but we never did anything with it and left it to default to
TRUE.

So, along with the pjproject patch, this commit adds options to both the
system and endpoint objects to control the two behaviors, and a small
logic change to session_inv_on_media_update in res_pjsip_session to
control the behavior at the endpoint level.

The default behavior for "different tags" remains the same at TRUE and
the default for "same tag" is FALSE.

Change-Id: I64d071942b79adb2f0a4e13137389b19404fe3d6
ASTERISK-27936
Reported-by: Ross Beer
This commit is contained in:
George Joseph
2018-06-18 20:22:17 -06:00
parent 017b7849bc
commit 880fbff6b7
13 changed files with 505 additions and 0 deletions

24
CHANGES
View File

@@ -141,6 +141,30 @@ app_confbridge
ConfbridgeWelcome has been added that will send a list of all
current participants to a new participant.
res_pjsip
------------------
* Two new options have been added to the system and endpoint objects to
control whether, on outbound calls, Asterisk will accept updated SDP answers
during the initial INVITE transaction when 100rel is not in effect.
This usually happens when the INVITE is forked to multiple UASs and more
than one sends an SDP answer or when a single UAS needs to change a media
port to switch from custom ringback to the actual media destination.
The 'follow_early_media_forked' option sets whether Asterisk will accept
the updated SDP when the To tag on the subsequent response is different than
that on the the previous response. This usually occurs in the forked INVITE
scenario. The default value is "yes" which is the current behavior.
The 'accept_multiple_sdp_answers' flag sets whether Asterisk will accept the
updated SDP when the To tag on the subsequent response is the same as that
on the previous response. This can occur when a UAS needs to switch media
ports from custom ringback to the final media path. The default value is
"no" which is the current behavior.
These options have to be enabled system-wide in the system config section
of pjsip.conf as well as on individual endpoints that require the
functionality.
------------------------------------------------------------------------------
--- Functionality changes from Asterisk 15.3.0 to Asterisk 15.4.0 ------------
------------------------------------------------------------------------------