summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorKevin P. Fleming <kpfleming@digium.com>2009-06-15 20:42:38 +0000
committerKevin P. Fleming <kpfleming@digium.com>2009-06-15 20:42:38 +0000
commit85e57521ab6eee3dc866e5882694f054f98b7186 (patch)
treec017a5551592b3a161dc9bfb9ce377800cfe2483 /channels
parentaaeec3b40f147216f6f550de269653eae38e9916 (diff)
Accept T.38 re-INVITE responses with invalid SDP versions.
This commit changes the 'incoming SDP version' check logic a bit more; when 'ignoresdpversion' is *not* set for a peer, if we initiate a re-INVITE to switch to T.38, we'll always accept the peer's SDP response, even if they don't properly increment the SDP version number as they should. If this situation occurs, a warning message will be generated suggesting that the peer's configuration be changed to include the 'ignoresdpversion' configuration option (although ideally they'd fix their SIP implementation to be RFC compliant). AST-221 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@200689 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c39
1 files changed, 31 insertions, 8 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 100c52c1c..a35dd6409 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -7824,16 +7824,39 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req, int t38action
return -1;
}
- if (ast_test_flag(&p->flags[1], SIP_PAGE2_IGNORESDPVERSION)
- || p->sessionversion_remote < 0
- || p->sessionversion_remote != rua_version) {
-
+ /* we need to check the SDP version number the other end sent us;
+ * our rules for deciding what to accept are a bit complex.
+ *
+ * 1) if 'ignoresdpversion' has been set for this dialog, then
+ * we will just accept whatever they sent and assume it is
+ * a modification of the session, even if it is not
+ * 2) otherwise, if this is the first SDP we've seen from them
+ * we accept it
+ * 3) otherwise, if the new SDP version number is higher than the
+ * old one, we accept it
+ * 4) otherwise, if this SDP is in response to us requesting a switch
+ * to T.38, we accept the SDP, but also generate a warning message
+ * that this peer should have the 'ignoresdpversion' option set,
+ * because it is not following the SDP offer/answer RFC; if we did
+ * not request a switch to T.38, then we stop parsing the SDP, as it
+ * has not changed from the previous version
+ */
+
+ if (ast_test_flag(&p->flags[1], SIP_PAGE2_IGNORESDPVERSION) ||
+ (p->sessionversion_remote < 0) ||
+ (p->sessionversion_remote < rua_version)) {
p->sessionversion_remote = rua_version;
p->session_modify = TRUE;
- } else if (p->sessionversion_remote == rua_version) {
- p->session_modify = FALSE;
- ast_debug(2, "SDP version number same as previous SDP. Not parsing this SDP.\n");
- return 0;
+ } else {
+ if (p->t38.state == T38_LOCAL_REINVITE) {
+ p->sessionversion_remote = rua_version;
+ p->session_modify = TRUE;
+ ast_log(LOG_WARNING, "Call %s responded to our T.38 reinvite without changing SDP version; 'ignoresdpversion' should be set for this peer.\n", p->callid);
+ } else {
+ p->session_modify = FALSE;
+ ast_debug(2, "Call %s responded to our reinvite without changing SDP version; ignoring SDP.\n", p->callid);
+ return 0;
+ }
}
/* Try to find first media stream */