Skip to content
Snippets Groups Projects
Commit d520d238 authored by Olle Johansson's avatar Olle Johansson
Browse files

- Fix more problems in transfer code (thanks Tholo!)

- Add debug for hangup not in UP state


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@32137 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent b93938de
No related branches found
No related tags found
No related merge requests found
...@@ -2908,8 +2908,11 @@ static int sip_hangup(struct ast_channel *ast) ...@@ -2908,8 +2908,11 @@ static int sip_hangup(struct ast_channel *ast)
return 0; return 0;
} }
/* If the call is not UP, we need to send CANCEL instead of BYE */ /* If the call is not UP, we need to send CANCEL instead of BYE */
if (ast->_state != AST_STATE_UP) if (ast->_state != AST_STATE_UP) {
needcancel = TRUE; needcancel = TRUE;
if (option_debug > 3)
ast_log(LOG_DEBUG, "Hanging up channel in state %s (not UP)\n", ast_state2str(ast->_state));
}
   
/* Disconnect */ /* Disconnect */
p = ast->tech_pvt; p = ast->tech_pvt;
...@@ -7318,23 +7321,23 @@ static int get_refer_info(struct sip_pvt *transferer, struct sip_request *outgoi ...@@ -7318,23 +7321,23 @@ static int get_refer_info(struct sip_pvt *transferer, struct sip_request *outgoi
   
/* Check for arguments in the refer_to header */ /* Check for arguments in the refer_to header */
if ((ptr = strchr(refer_to, '?'))) { /* Search for arguments */ if ((ptr = strchr(refer_to, '?'))) { /* Search for arguments */
*ptr = '\0'; *ptr++ = '\0';
ptr++;
if (!strncasecmp(ptr, "REPLACES=", 9)) { if (!strncasecmp(ptr, "REPLACES=", 9)) {
char *to, *from; char *to = NULL, *from = NULL;
   
/* This is an attended transfer */ /* This is an attended transfer */
referdata->attendedtransfer = 1; referdata->attendedtransfer = 1;
strncpy(referdata->replaces_callid, ptr+9, sizeof(referdata->replaces_callid)); strncpy(referdata->replaces_callid, ptr+9, sizeof(referdata->replaces_callid));
ast_uri_decode(referdata->replaces_callid); ast_uri_decode(referdata->replaces_callid);
if ((ptr = strchr(referdata->replaces_callid, ';'))) /* Remove options */ { if ((ptr = strchr(referdata->replaces_callid, ';'))) /* Find options */ {
*ptr = '\0'; *ptr++ = '\0';
ptr++;
} }
   
/* Find the different tags before we destroy the string */ if (ptr) {
to = strcasestr(ptr, "to-tag="); /* Find the different tags before we destroy the string */
from = strcasestr(ptr, "from-tag="); to = strcasestr(ptr, "to-tag=");
from = strcasestr(ptr, "from-tag=");
}
   
/* Grab the to header */ /* Grab the to header */
if (to) { if (to) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment