[asterisk-commits] file: branch file/bridging r99360 - in /team/file/bridging: include/asterisk/...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Jan 22 10:39:40 CST 2008
Author: file
Date: Mon Jan 21 12:19:34 2008
New Revision: 99360
URL: http://svn.digium.com/view/asterisk?view=rev&rev=99360
Log:
Rip out feature code. This is going to be rewritten shortly.
Modified:
team/file/bridging/include/asterisk/bridging.h
team/file/bridging/main/bridging.c
Change Statistics:
team/file/bridging/include/asterisk/bridging.h | 2
team/file/bridging/main/bridging.c | 81 -------------
2 files changed, 83 deletions(-)
Modified: team/file/bridging/include/asterisk/bridging.h
URL: http://svn.digium.com/view/asterisk/team/file/bridging/include/asterisk/bridging.h?view=diff&rev=99360&r1=99359&r2=99360
==============================================================================
--- team/file/bridging/include/asterisk/bridging.h (original)
+++ team/file/bridging/include/asterisk/bridging.h Mon Jan 21 12:19:34 2008
@@ -121,8 +121,6 @@
int fds[4]; /*! Additional file descriptors to look at */
int suspended:1; /*! Is this bridged channel suspended from the bridge or not? */
int muted:1; /*! Is this bridged channel muted or not? */
- int go_feature; /*! Once a DTMF end has been received, start the feature */
- char dtmfq[8]; /*! DTMF queue for features */
struct ast_bridge_features *features; /*! Enabled features information */
AST_LIST_ENTRY(ast_bridge_channel) list; /*! Linked list information */
};
Modified: team/file/bridging/main/bridging.c
URL: http://svn.digium.com/view/asterisk/team/file/bridging/main/bridging.c?view=diff&rev=99360&r1=99359&r2=99360
==============================================================================
--- team/file/bridging/main/bridging.c (original)
+++ team/file/bridging/main/bridging.c Mon Jan 21 12:19:34 2008
@@ -123,60 +123,6 @@
return bridge_channel;
}
-/*! \brief Internal function for handling DTMF frames when features are present on a bridge channel */
-static struct ast_frame *bridge_handle_feature_dtmf(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel, struct ast_frame *frame)
-{
- struct ast_bridge_features *features = (bridge_channel->features ? bridge_channel->features : &bridge->features);
- struct ast_bridge_features_hook *hook = NULL;
-
- /* features will always be non-NULL, so just see if it is usable. If it is not we just pass back the frame and be happy. */
- if (!features->usable) {
- ast_debug(1, "No usable features enabled on bridge channel %p participating in bridge %p\n", bridge_channel, bridge);
- return frame;
- }
-
- /* DTMF end frames are handled a lil' bit differently */
- if (frame->frametype == AST_FRAME_DTMF_END) {
- /* See if the begin matched a DTMF feature, if not simply return it */
- if (ast_strlen_zero(bridge_channel->dtmfq)) {
- ast_debug(1, "DTMF feature queue on %p is empty, no feature was matched in the begin... just returning the frame.\n", bridge_channel);
- return frame;
- } else if (bridge_channel->go_feature) {
- ast_debug(1, "DTMF feature matched on %p, going to execute the feature.\n", bridge_channel);
- /* Tell the bridge thread that something is up... */
- ast_bridge_rebuild(bridge);
- ast_bridge_change_state(bridge_channel, AST_BRIDGE_CHANNEL_STATE_FEATURE);
- }
- /* Drop the frame and return NULL, nothing else to do */
- ast_frfree(frame);
- return NULL;
- }
-
- /* Add the DTMF coming in to the queue for easy matching */
- bridge_channel->dtmfq[strlen(bridge_channel->dtmfq)] = frame->subclass;
- ast_debug(1, "DTMF frame queue on %p is now %s\n", bridge_channel, bridge_channel->dtmfq);
-
- /* See if the current DTMF stream in the queue matches or is close to a hook */
- AST_LIST_TRAVERSE(&features->hooks, hook, list) {
- /* See if the DTMF stream matches the hook */
- if (!strcmp(hook->dtmf, bridge_channel->dtmfq)) {
- ast_debug(1, "Bridge channel %p DTMF stream matches hook %p\n", bridge_channel, hook);
- bridge_channel->go_feature = 1;
- ast_frfree(frame);
- return NULL;
- } else if (!strncmp(hook->dtmf, bridge_channel->dtmfq, strlen(bridge_channel->dtmfq))) {
- ast_debug(1, "Bridge channel %p DTMF stream CAN match hook %p\n", bridge_channel, hook);
- ast_frfree(frame);
- return NULL;
- }
- }
-
- /* Alas... nothing matched so dump the DTMF queue and move on, for now */
- bridge_channel->dtmfq[0] = '\0';
-
- return frame;
-}
-
/*! \brief Internal function to see whether a bridge should dissolve, and if so do it */
static void bridge_check_dissolve(struct ast_bridge *bridge)
{
@@ -211,9 +157,6 @@
/* Perform bridge dissolving stuff if needed */
bridge_check_dissolve(bridge);
} else {
- /* If this is DTMF pass it off to the feature handling code so it can determine whether to withhold it or let it through */
- if (frame->frametype == AST_FRAME_DTMF_BEGIN || frame->frametype == AST_FRAME_DTMF_END)
- frame = bridge_handle_feature_dtmf(bridge, bridge_channel, frame);
/* Simply write the frame out to the bridge technology if it still exists */
if (frame)
bridge->technology->write(bridge, bridge_channel, frame);
@@ -678,30 +621,6 @@
/*! \brief Internal function that executes a feature on a bridge channel */
static void bridge_channel_feature(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel)
{
- struct ast_bridge_features *features = (bridge_channel->features ? bridge_channel->features : &bridge->features);
- ast_bridge_features_hook_callback callback = NULL;
- void *hook_pvt = NULL;
-
- if (bridge_channel->go_feature == 1) {
- struct ast_bridge_features_hook *hook = NULL;
- /* Look for the matching hook, we know it matched because we got this far */
- AST_LIST_TRAVERSE(&features->hooks, hook, list) {
- if (!strcmp(hook->dtmf, bridge_channel->dtmfq)) {
- callback = hook->callback;
- hook_pvt = hook->hook_pvt;
- break;
- }
- }
- } else if (bridge_channel->go_feature == 2) {
- }
-
- /* Wipe out the current DTMF queue, no longer needed and stop the indication to execute a feature... having it still be on would be bad */
- bridge_channel->dtmfq[0] = '\0';
- bridge_channel->go_feature = 0;
-
- /* Execute the function callback, it is up to that callback to release the bridge lock when doing things */
- callback(bridge, bridge_channel);
-
return;
}
More information about the asterisk-commits
mailing list