[svn-commits] oej: branch 1.4 r47199 - /branches/1.4/channels/chan_sip.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Sat Nov 4 11:32:03 MST 2006


Author: oej
Date: Sat Nov  4 12:32:02 2006
New Revision: 47199

URL: http://svn.digium.com/view/asterisk?rev=47199&view=rev
Log:
Issue #8284: Fixes to Invite/replaces and transfer from "john"
Thank you!

Modified:
    branches/1.4/channels/chan_sip.c

Modified: branches/1.4/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/chan_sip.c?rev=47199&r1=47198&r2=47199&view=diff
==============================================================================
--- branches/1.4/channels/chan_sip.c (original)
+++ branches/1.4/channels/chan_sip.c Sat Nov  4 12:32:02 2006
@@ -13683,27 +13683,20 @@
 		pbx_builtin_setvar_helper(current.chan2, "SIPTRANSFER", "yes");
 		/* One for the new channel */
 		pbx_builtin_setvar_helper(current.chan2, "_SIPTRANSFER", "yes");
-		if (p->refer->referred_by)
+		/* Attended transfer to remote host, prepare headers for the INVITE */
+		if (p->refer->referred_by) 
 			pbx_builtin_setvar_helper(current.chan2, "_SIPTRANSFER_REFERER", p->refer->referred_by);
-		if (p->refer->referred_by)
-		/* Attended transfer to remote host, prepare headers for the INVITE */
-		pbx_builtin_setvar_helper(current.chan2, "_SIPTRANSFER_REFERER", p->refer->referred_by);
-	}
-	/* Generate an URI-encoded string */
+	}
+	/* Generate a Replaces string to be used in the INVITE during attended transfer */
 	if (p->refer->replaces_callid && !ast_strlen_zero(p->refer->replaces_callid)) {
 		char tempheader[BUFSIZ];
-		char tempheader2[BUFSIZ];
 		snprintf(tempheader, sizeof(tempheader), "%s%s%s%s%s", p->refer->replaces_callid, 
 				p->refer->replaces_callid_totag ? ";to-tag=" : "", 
 				p->refer->replaces_callid_totag, 
 				p->refer->replaces_callid_fromtag ? ";from-tag=" : "",
 				p->refer->replaces_callid_fromtag);
-
-		/* Convert it to URL encoding, also convert reserved strings */
-		ast_uri_encode(tempheader, tempheader2, sizeof(tempheader2), 1);
-
 		if (current.chan2)
-			pbx_builtin_setvar_helper(current.chan2, "_SIPTRANSFER_REPLACES", tempheader2);
+			pbx_builtin_setvar_helper(current.chan2, "_SIPTRANSFER_REPLACES", tempheader);
 	}
 	/* Must release lock now, because it will not longer
     	   be accessible after the transfer! */
@@ -13715,7 +13708,7 @@
 
 	/* FAKE ringing if not attended transfer */
 	if (!p->refer->attendedtransfer)
-		transmit_notify_with_sipfrag(p, seqno, "183 Ringing", FALSE);
+		transmit_notify_with_sipfrag(p, seqno, "183 Ringing", FALSE); 
 		
 	/* For blind transfer, this will lead to a new call */
 	/* For attended transfer to remote host, this will lead to
@@ -13729,7 +13722,6 @@
 		   * Let the new channel masq into this channel
 		   Please add that code here :-)
 		*/
-		transmit_response(p, "202 Accepted", req);
 		p->refer->status = REFER_FAILED;
 		transmit_notify_with_sipfrag(p, seqno, "503 Service Unavailable (can't handle one-legged xfers)", TRUE);
 		ast_clear_flag(&p->flags[0], SIP_GOTREFER);	



More information about the svn-commits mailing list