chan_sip: Always process updated SDP on media source change

Fixes no-audio issues when the media source is changed and
strictrtp is enabled (default).

If the peer media source changes, the SDP session version also changes.
If it is lower than the one we had stored, chan_sip would ignore it.

This changeset keeps track of the remote media origin identifier,
comparing that as well. If it changes, the session version needn't be
higher for us to accept the SDP.

Common scenario where this would've caused problems: a separate media
gateway that informs the caller about premium rates before handing off
the call to the final destination.

(An alternative fix would be to set ignoresdpversion=yes on the peer.)

ASTERISK-28686

Change-Id: I88fdbc5aeb777b583e7738c084254c482a7776ee
This commit is contained in:
Walter Doekes
2020-01-13 11:13:41 +01:00
parent eb1ec0498d
commit ad9a40a539
2 changed files with 47 additions and 18 deletions

View File

@@ -1052,6 +1052,7 @@ struct sip_pvt {
AST_STRING_FIELD(last_presence_message); /*!< The last presence message for a subscription */
AST_STRING_FIELD(msg_body); /*!< Text for a MESSAGE body */
AST_STRING_FIELD(tel_phone_context); /*!< The phone-context portion of a TEL URI */
AST_STRING_FIELD(sessionunique_remote); /*!< Remote UA's SDP Session unique parts */
);
char via[128]; /*!< Via: header */
int maxforwards; /*!< SIP Loop prevention */