aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_sip.c
diff options
context:
space:
mode:
authormnicholson <mnicholson@f38db490-d61c-443f-a65b-d21fe96a405b>2010-08-18 13:11:38 +0000
committermnicholson <mnicholson@f38db490-d61c-443f-a65b-d21fe96a405b>2010-08-18 13:11:38 +0000
commit3baae21d2a25ff18d5531e29986120a69e48e6d4 (patch)
tree075f4de53f02f28c45c97c378fe62c68dc06b385 /channels/chan_sip.c
parente12c5b73febc676aa1d3772ddbd7e91cca21cfeb (diff)
Merged revisions 282639 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r282639 | mnicholson | 2010-08-18 08:10:39 -0500 (Wed, 18 Aug 2010) | 13 lines Properly handle 200 and unknown responses conatined in NOTIFY requests received in response to REFER requests. This patch fixes the way asterisk handles NOTIFY requests received in response to REFER requests. These changes to NOTIFY handler were first introduced in r217482. This new change properly handles the 200 response by queueing an AST_TRANSFER_SUCCESS control frame and also prevents that control frame from being queued when provisional and unknown responses are received. (issue #17486) Reported by: davidw Tested by: mnicholson (issue #12713) Reported by: davidw Review: https://reviewboard.asterisk.org/r/860/ ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@282640 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r--channels/chan_sip.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index db1837ac8..7d96267be 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -20365,18 +20365,8 @@ static int handle_request_notify(struct sip_pvt *p, struct sip_request *req, str
*sep++ = '\0'; /* Response string */
respcode = atoi(code);
switch (respcode) {
- case 100: /* Trying: */
- case 101: /* dialog establishment */
- /* Don't do anything yet */
- success = -1; /* Wait */
- break;
- case 183: /* Ringing: */
- /* Don't do anything yet */
- success = -1; /* Wait */
- break;
case 200: /* OK: The new call is up, hangup this call */
/* Hangup the call that we are replacing */
- success = -1; /* Wait */
break;
case 301: /* Moved permenantly */
case 302: /* Moved temporarily */
@@ -20384,13 +20374,24 @@ static int handle_request_notify(struct sip_pvt *p, struct sip_request *req, str
success = FALSE;
break;
case 503: /* Service Unavailable: The new call failed */
- /* Cancel transfer, continue the call */
+ case 603: /* Declined: Not accepted */
+ /* Cancel transfer, continue the current call */
success = FALSE;
break;
- case 603: /* Declined: Not accepted */
+ case 0: /* Parse error */
/* Cancel transfer, continue the current call */
+ ast_log(LOG_NOTICE, "Error parsing sipfrag in NOTIFY in response to REFER.\n");
success = FALSE;
break;
+ default:
+ if (respcode < 200) {
+ /* ignore provisional responses */
+ success = -1;
+ } else {
+ ast_log(LOG_NOTICE, "Got unknown code '%d' in NOTIFY in response to REFER.\n", respcode);
+ success = FALSE;
+ }
+ break;
}
if (success == FALSE) {
ast_log(LOG_NOTICE, "Transfer failed. Sorry. Nothing further to do with this call\n");