summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlle Johansson <oej@edvina.net>2009-09-09 20:09:31 +0000
committerOlle Johansson <oej@edvina.net>2009-09-09 20:09:31 +0000
commitb6122d1a00e5dfe08f0687fe8799ce4e525c6c10 (patch)
tree4f0f28fb3c70c2377d521acb8a343d8457c81fb2
parent1ed1eb277e50dd1535e2d850a29f1ed6f055ec22 (diff)
Don't report transfer success until we actually know. 1xx messages are not final.
Related to #12713 Patch by oej A big thank you to file for finally fixing the transfer() dialplan application. I've been waiting for years for this. Great work! git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@217482 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r--channels/chan_sip.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index a497317a2..3ed2e06f2 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -19506,12 +19506,15 @@ static int handle_request_notify(struct sip_pvt *p, struct sip_request *req, str
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 */
@@ -19527,11 +19530,11 @@ static int handle_request_notify(struct sip_pvt *p, struct sip_request *req, str
success = FALSE;
break;
}
- if (!success) {
+ if (success == FALSE) {
ast_log(LOG_NOTICE, "Transfer failed. Sorry. Nothing further to do with this call\n");
}
- if (p->owner) {
+ if (p->owner && success != -1) {
enum ast_control_transfer message = success ? AST_TRANSFER_SUCCESS : AST_TRANSFER_FAILED;
ast_queue_control_data(p->owner, AST_CONTROL_TRANSFER, &message, sizeof(message));
}