summaryrefslogtreecommitdiff
path: root/channels/chan_pjsip.c
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2014-09-27 12:43:36 +0000
committerJoshua Colp <jcolp@digium.com>2014-09-27 12:43:36 +0000
commit19ffbb1e64d82cc0f6b710ad99e792c78deeb9af (patch)
treeec10046210c055fa4a31440cf8e957095bff1b1a /channels/chan_pjsip.c
parent5a77eb347617b16818b62e3f4917ad3d796dc0f3 (diff)
res_pjsip_session: Add additional checks for delaying session refreshes.
There are certain situations which no checks existed for which need to prevent session refreshes. This includes sending a session refresh with SDP before SDP negotiation has completed and sending a session refresh before the dialog itself has been established. Checks for these have been added. Additionally COLP related UPDATEs were including SDP when it is not needed. Review: https://reviewboard.asterisk.org/r/4008/ ........ Merged revisions 424056 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@424057 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_pjsip.c')
-rw-r--r--channels/chan_pjsip.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/channels/chan_pjsip.c b/channels/chan_pjsip.c
index 1ca580699..b8fb35c35 100644
--- a/channels/chan_pjsip.c
+++ b/channels/chan_pjsip.c
@@ -1081,12 +1081,16 @@ static int update_connected_line_information(void *data)
}
} else {
enum ast_sip_session_refresh_method method = session->endpoint->id.refresh_method;
+ int generate_new_sdp;
struct ast_party_id connected_id;
if (session->inv_session->invite_tsx && (session->inv_session->options & PJSIP_INV_SUPPORT_UPDATE)) {
method = AST_SIP_SESSION_REFRESH_METHOD_UPDATE;
}
+ /* Only the INVITE method actually needs SDP, UPDATE can do without */
+ generate_new_sdp = (method == AST_SIP_SESSION_REFRESH_METHOD_INVITE);
+
/*
* We can get away with a shallow copy here because we are
* not looking at strings.
@@ -1099,7 +1103,7 @@ static int update_connected_line_information(void *data)
(session->endpoint->id.trust_outbound ||
((connected_id.name.presentation & AST_PRES_RESTRICTION) == AST_PRES_ALLOWED &&
(connected_id.number.presentation & AST_PRES_RESTRICTION) == AST_PRES_ALLOWED))) {
- ast_sip_session_refresh(session, NULL, NULL, NULL, method, 1);
+ ast_sip_session_refresh(session, NULL, NULL, NULL, method, generate_new_sdp);
}
}