[asterisk-commits] oej: branch oej/pinedanish-copybridgeflags-1.6.0 r226530 - in /team/oej/pined...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Oct 29 12:26:41 CDT 2009


Author: oej
Date: Thu Oct 29 12:26:37 2009
New Revision: 226530

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=226530
Log:
Adding code developed today for sending AST_CONTROL_BRIDGEPARAM upstream.

*** NOT TESTED. NO WARRANTYS. DON'T CALL MY MOTHER FOR SUPPORT. Thanks.

Modified:
    team/oej/pinedanish-copybridgeflags-1.6.0/apps/app_dial.c
    team/oej/pinedanish-copybridgeflags-1.6.0/channels/chan_local.c
    team/oej/pinedanish-copybridgeflags-1.6.0/include/asterisk/channel.h
    team/oej/pinedanish-copybridgeflags-1.6.0/include/asterisk/frame.h
    team/oej/pinedanish-copybridgeflags-1.6.0/main/channel.c
    team/oej/pinedanish-copybridgeflags-1.6.0/main/features.c

Modified: team/oej/pinedanish-copybridgeflags-1.6.0/apps/app_dial.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/pinedanish-copybridgeflags-1.6.0/apps/app_dial.c?view=diff&rev=226530&r1=226529&r2=226530
==============================================================================
--- team/oej/pinedanish-copybridgeflags-1.6.0/apps/app_dial.c (original)
+++ team/oej/pinedanish-copybridgeflags-1.6.0/apps/app_dial.c Thu Oct 29 12:26:37 2009
@@ -1946,7 +1946,11 @@
 
 				ast_channel_setoption(chan, AST_OPTION_OPRMODE, &oprmode, sizeof(oprmode), 0);
 			}
+			ast_copy_flags(&peer->bridgeflags, &config.features_callee,
+				AST_FEATURE_REDIRECT | AST_FEATURE_DISCONNECT |
+				AST_FEATURE_AUTOMON | AST_FEATURE_PARKCALL | AST_FEATURE_AUTOMIXMON);
 			res = ast_bridge_call(chan, peer, &config);
+			//peer->bridgeflags =  { 0 } ;	/* Reset bridgeflags */
 		}
 
 		strcpy(peer->context, chan->context);

Modified: team/oej/pinedanish-copybridgeflags-1.6.0/channels/chan_local.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/pinedanish-copybridgeflags-1.6.0/channels/chan_local.c?view=diff&rev=226530&r1=226529&r2=226530
==============================================================================
--- team/oej/pinedanish-copybridgeflags-1.6.0/channels/chan_local.c (original)
+++ team/oej/pinedanish-copybridgeflags-1.6.0/channels/chan_local.c Thu Oct 29 12:26:37 2009
@@ -287,6 +287,9 @@
 						ast_channel_masquerade(p->owner, p->chan->_bridge);
 						ast_set_flag(p, LOCAL_ALREADY_MASQED);
 					}
+					/* Now, tell the owner's bridge that we had some interesting parameters in the bridge that
+					   will disappear soon, so that we don't drop them */
+					ast_queue_control_data(p->owner, AST_CONTROL_BRIDGEPARAM, &p->chan->bridgeflags, sizeof(p->chan->bridgeflags));
 					ast_channel_unlock(p->owner);
 				}
 				ast_channel_unlock(p->chan->_bridge);

Modified: team/oej/pinedanish-copybridgeflags-1.6.0/include/asterisk/channel.h
URL: http://svnview.digium.com/svn/asterisk/team/oej/pinedanish-copybridgeflags-1.6.0/include/asterisk/channel.h?view=diff&rev=226530&r1=226529&r2=226530
==============================================================================
--- team/oej/pinedanish-copybridgeflags-1.6.0/include/asterisk/channel.h (original)
+++ team/oej/pinedanish-copybridgeflags-1.6.0/include/asterisk/channel.h Thu Oct 29 12:26:37 2009
@@ -534,6 +534,7 @@
 	struct ast_epoll_data *epfd_data[AST_MAX_FDS];
 #endif
 	int visible_indication;                         /*!< Indication currently playing on the channel */
+	struct ast_flags bridgeflags;			/*!< Flags set for channel when creating bridge */
 };
 
 /*! \brief ast_channel_tech Properties */

Modified: team/oej/pinedanish-copybridgeflags-1.6.0/include/asterisk/frame.h
URL: http://svnview.digium.com/svn/asterisk/team/oej/pinedanish-copybridgeflags-1.6.0/include/asterisk/frame.h?view=diff&rev=226530&r1=226529&r2=226530
==============================================================================
--- team/oej/pinedanish-copybridgeflags-1.6.0/include/asterisk/frame.h (original)
+++ team/oej/pinedanish-copybridgeflags-1.6.0/include/asterisk/frame.h Thu Oct 29 12:26:37 2009
@@ -302,6 +302,7 @@
 	_XXX_AST_CONTROL_T38 = 19,	/*!< T38 state change request/notification \deprecated This is no longer supported. Use AST_CONTROL_T38_PARAMETERS instead. */
 	AST_CONTROL_SRCUPDATE = 20,     /*!< Indicate source of media has changed */
 	AST_CONTROL_T38_PARAMETERS = 24, /*!< T38 state change request/notification with parameters */
+	AST_CONTROL_BRIDGEPARAM = 25,	/*!< Bridge parameter update after masquerade */
 };
 
 enum ast_control_t38 {

Modified: team/oej/pinedanish-copybridgeflags-1.6.0/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/pinedanish-copybridgeflags-1.6.0/main/channel.c?view=diff&rev=226530&r1=226529&r2=226530
==============================================================================
--- team/oej/pinedanish-copybridgeflags-1.6.0/main/channel.c (original)
+++ team/oej/pinedanish-copybridgeflags-1.6.0/main/channel.c Thu Oct 29 12:26:37 2009
@@ -3065,6 +3065,7 @@
 	case AST_CONTROL_OFFHOOK:
 	case AST_CONTROL_TAKEOFFHOOK:
 	case AST_CONTROL_ANSWER:
+	case AST_CONTROL_BRIDGEPARAM:
 	case AST_CONTROL_HANGUP:
 	case AST_CONTROL_T38_PARAMETERS:
 	case _XXX_AST_CONTROL_T38:
@@ -3131,6 +3132,7 @@
 	case _XXX_AST_CONTROL_T38:
 		/* deprecated T.38 control frame */
 		return -1;
+	case AST_CONTROL_BRIDGEPARAM:
 	case AST_CONTROL_T38_PARAMETERS:
 		/* there is no way to provide 'default' behavior for these
 		 * control frames, so we need to return failure, but there

Modified: team/oej/pinedanish-copybridgeflags-1.6.0/main/features.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/pinedanish-copybridgeflags-1.6.0/main/features.c?view=diff&rev=226530&r1=226529&r2=226530
==============================================================================
--- team/oej/pinedanish-copybridgeflags-1.6.0/main/features.c (original)
+++ team/oej/pinedanish-copybridgeflags-1.6.0/main/features.c Thu Oct 29 12:26:37 2009
@@ -2420,6 +2420,7 @@
 		/* many things should be sent to the 'other' channel */
 		other = (who == chan) ? peer : chan;
 		if (f->frametype == AST_FRAME_CONTROL) {
+			struct ast_flags *param;
 			switch (f->subclass) {
 			case AST_CONTROL_RINGING:
 			case AST_CONTROL_FLASH:
@@ -2429,6 +2430,25 @@
 			case AST_CONTROL_HOLD:
 			case AST_CONTROL_UNHOLD:
 				ast_indicate_data(other, f->subclass, f->data, f->datalen);
+				break;
+			case AST_CONTROL_BRIDGEPARAM:
+				/* We are getting an bridge update from chan_local before masquerade, update this bridge with the params */
+				/* We want to update the peer side, the outbound channel, with it */
+				param = (struct ast_flags *) f->data;
+				
+				if (ast_test_flag(param, AST_FEATURE_REDIRECT)) {
+                                	ast_set_flag(&(config->features_callee), AST_FEATURE_REDIRECT);
+					ast_debug(2, "--- Setting Transfer flag on callee in bridge! \n");
+				}
+				if (ast_test_flag(param, AST_FEATURE_DISCONNECT))
+                                	ast_set_flag(&(config->features_callee), AST_FEATURE_DISCONNECT);
+				if (ast_test_flag(param, AST_FEATURE_AUTOMON))
+                                	ast_set_flag(&(config->features_callee), AST_FEATURE_AUTOMON);
+				if (ast_test_flag(param, AST_FEATURE_AUTOMIXMON))
+                                	ast_set_flag(&(config->features_callee), AST_FEATURE_AUTOMIXMON);
+				if (ast_test_flag(param, AST_FEATURE_PARKCALL))
+                                	ast_set_flag(&(config->features_callee), AST_FEATURE_PARKCALL);
+				ast_debug(2, "--- Setting updated bridge flags from chan_local in this bridge for incoming channel %s\n", chan->name);
 				break;
 			case AST_CONTROL_OPTION:
 				aoh = f->data;




More information about the asterisk-commits mailing list