[asterisk-commits] kpfleming: branch kpfleming/cfwd-loop-fix r84688 - in /team/kpfleming/cfwd-lo...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Oct 4 15:01:41 CDT 2007


Author: kpfleming
Date: Thu Oct  4 15:01:41 2007
New Revision: 84688

URL: http://svn.digium.com/view/asterisk?view=rev&rev=84688
Log:
push my work in progress up to the server so i can continue on another computer

Added:
    team/kpfleming/cfwd-loop-fix/
      - copied from r84687, branches/1.4/
Modified:
    team/kpfleming/cfwd-loop-fix/apps/app_dial.c
    team/kpfleming/cfwd-loop-fix/channels/chan_local.c
    team/kpfleming/cfwd-loop-fix/include/asterisk/channel.h

Modified: team/kpfleming/cfwd-loop-fix/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/kpfleming/cfwd-loop-fix/apps/app_dial.c?view=diff&rev=84688&r1=84687&r2=84688
==============================================================================
--- team/kpfleming/cfwd-loop-fix/apps/app_dial.c (original)
+++ team/kpfleming/cfwd-loop-fix/apps/app_dial.c Thu Oct  4 15:01:41 2007
@@ -543,6 +543,7 @@
 					if (c->cid.cid_rdnis) 
 						free(c->cid.cid_rdnis);
 					c->cid.cid_rdnis = ast_strdup(S_OR(in->macroexten, in->exten));
+					ast_set_flag(c, AST_FLAG_CAN_CALLFORWARD);
 					if (ast_call(c, tmpchan, 0)) {
 						ast_log(LOG_NOTICE, "Failed to dial on local channel for call forward to '%s'\n", tmpchan);
 						ast_clear_flag(o, DIAL_STILLGOING);	
@@ -594,6 +595,7 @@
 					/* If call has been answered, then the eventual hangup is likely to be normal hangup */
 					in->hangupcause = AST_CAUSE_NORMAL_CLEARING;
 					c->hangupcause = AST_CAUSE_NORMAL_CLEARING;
+					ast_clear_flag(c, AST_FLAG_CAN_CALLFORWARD);
 					break;
 				case AST_CONTROL_BUSY:
 					if (option_verbose > 2)
@@ -1216,6 +1218,10 @@
 		else
 			ast_copy_string(tmp->chan->exten, chan->exten, sizeof(tmp->chan->exten));
 
+		/* If a call forwarding destination should appear for this channel
+		   after starting the call, we want to get it */
+		ast_set_flag(tmp->chan, AST_FLAG_CAN_CALLFORWARD);
+
 		/* Place the call, but don't wait on the answer */
 		res = ast_call(tmp->chan, numsubst, 0);
 

Modified: team/kpfleming/cfwd-loop-fix/channels/chan_local.c
URL: http://svn.digium.com/view/asterisk/team/kpfleming/cfwd-loop-fix/channels/chan_local.c?view=diff&rev=84688&r1=84687&r2=84688
==============================================================================
--- team/kpfleming/cfwd-loop-fix/channels/chan_local.c (original)
+++ team/kpfleming/cfwd-loop-fix/channels/chan_local.c Thu Oct  4 15:01:41 2007
@@ -468,6 +468,11 @@
 		}
 	}
 
+	/* if the incoming channel is owned by an application that can handle
+	   call forwarding, then we should set that on the outgoing channel as well
+	*/
+	ast_set2_flag(p->chan, ast_test_flag(p->owner, AST_FLAG_CAN_CALLFORWARD), AST_FLAG_CAN_CALLFORWARD);
+
 	/* Start switch on sub channel */
 	if (!(res = ast_pbx_start(p->chan)))
 		ast_set_flag(p, LOCAL_LAUNCHED_PBX);

Modified: team/kpfleming/cfwd-loop-fix/include/asterisk/channel.h
URL: http://svn.digium.com/view/asterisk/team/kpfleming/cfwd-loop-fix/include/asterisk/channel.h?view=diff&rev=84688&r1=84687&r2=84688
==============================================================================
--- team/kpfleming/cfwd-loop-fix/include/asterisk/channel.h (original)
+++ team/kpfleming/cfwd-loop-fix/include/asterisk/channel.h Thu Oct  4 15:01:41 2007
@@ -487,6 +487,10 @@
 	/*! This flag indicates that on a masquerade, an active stream should not
 	 *  be carried over */
 	AST_FLAG_MASQ_NOSTREAM = (1 << 15),
+	/*! This flag indicates that this channel is owned by an application
+	  that can process the contents of the 'call_forward' element of the
+	  channel structure */
+	AST_FLAG_CAN_CALLFORWARD = (1 << 16),
 };
 
 /*! \brief ast_bridge_config flags */




More information about the asterisk-commits mailing list