summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2007-01-11 05:54:14 +0000
committerJoshua Colp <jcolp@digium.com>2007-01-11 05:54:14 +0000
commit469cf8ab2ab119f943a6a45588f5355558f268a3 (patch)
tree9debdbe613e0a62a07258a4271d1126a21f76551 /channels
parent4942fd94d2201b92eed4c08d88313a98dab0ff2d (diff)
Merged revisions 50468 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r50468 | file | 2007-01-11 00:53:09 -0500 (Thu, 11 Jan 2007) | 2 lines Remove check for channel state as it can definitely be something other then ring, and also clean up the code a bit. This should solve the parking issues and maybe some attended transfer issues people have been seeing. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@50469 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c45
1 files changed, 19 insertions, 26 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 010a4085d..4d50044aa 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -13765,7 +13765,6 @@ static int local_attended_transfer(struct sip_pvt *transferer, struct sip_dual *
/* Chan 2: Call from Asterisk to target */
int res = 0;
struct sip_pvt *targetcall_pvt;
- int error = 0;
/* Check if the call ID of the replaces header does exist locally */
if (!(targetcall_pvt = get_sip_pvt_byid_locked(transferer->refer->replaces_callid, transferer->refer->replaces_callid_totag,
@@ -13793,39 +13792,33 @@ static int local_attended_transfer(struct sip_pvt *transferer, struct sip_dual *
if (!targetcall_pvt->owner) { /* No active channel */
if (option_debug > 3)
ast_log(LOG_DEBUG, "SIP attended transfer: Error: No owner of target call\n");
- error = 1;
- }
- /* We have a channel, find the bridge */
- target.chan1 = targetcall_pvt->owner; /* Transferer to Asterisk */
-
- if (!error) {
- target.chan2 = ast_bridged_channel(targetcall_pvt->owner); /* Asterisk to target */
-
- if (!target.chan2 || !(target.chan2->_state == AST_STATE_UP || target.chan2->_state == AST_STATE_RINGING) ) {
- /* Wrong state of new channel */
- if (option_debug > 3) {
- if (target.chan2)
- ast_log(LOG_DEBUG, "SIP attended transfer: Error: Wrong state of target call: %s\n", ast_state2str(target.chan2->_state));
- else if (target.chan1->_state != AST_STATE_RING)
- ast_log(LOG_DEBUG, "SIP attended transfer: Error: No target channel\n");
- else
- ast_log(LOG_DEBUG, "SIP attended transfer: Attempting transfer in ringing state\n");
- }
- if (target.chan1->_state != AST_STATE_RING)
- error = 1;
- }
- }
- if (error) { /* Cancel transfer */
+ /* Cancel transfer */
transmit_notify_with_sipfrag(transferer, seqno, "503 Service Unavailable", TRUE);
append_history(transferer, "Xfer", "Refer failed");
- ast_clear_flag(&transferer->flags[0], SIP_GOTREFER);
+ ast_clear_flag(&transferer->flags[0], SIP_GOTREFER);
transferer->refer->status = REFER_FAILED;
sip_pvt_unlock(targetcall_pvt);
ast_channel_unlock(current->chan1);
- ast_channel_unlock(target.chan1);
+ ast_channel_unlock(targetcall_pvt->owner);
return -1;
}
+ /* We have a channel, find the bridge */
+ target.chan1 = targetcall_pvt->owner; /* Transferer to Asterisk */
+ target.chan2 = ast_bridged_channel(targetcall_pvt->owner); /* Asterisk to target */
+
+ if (!target.chan2 || !(target.chan2->_state == AST_STATE_UP || target.chan2->_state == AST_STATE_RINGING) ) {
+ /* Wrong state of new channel */
+ if (option_debug > 3) {
+ if (target.chan2)
+ ast_log(LOG_DEBUG, "SIP attended transfer: Error: Wrong state of target call: %s\n", ast_state2str(target.chan2->_state));
+ else if (target.chan1->_state != AST_STATE_RING)
+ ast_log(LOG_DEBUG, "SIP attended transfer: Error: No target channel\n");
+ else
+ ast_log(LOG_DEBUG, "SIP attended transfer: Attempting transfer in ringing state\n");
+ }
+ }
+
/* Transfer */
if (option_debug > 3 && sipdebug) {
if (current->chan2) /* We have two bridges */