summaryrefslogtreecommitdiff
path: root/main/bridging.c
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2013-06-06 21:40:35 +0000
committerMark Michelson <mmichelson@digium.com>2013-06-06 21:40:35 +0000
commit2dc8a060064f359a17f5ebcd515d85fe5203c019 (patch)
treefca012b9378a2a005fea30278f7d2a6129251b1f /main/bridging.c
parent5f740572d081330fb43462eba5b0f495d8e56df1 (diff)
Refactor the features configuration scheme.
Features configuration is handled in its own API in features_config.h and features_config.c. This way, features configuration is accessible to anything that needs it. In addition, features configuration has been altered to be more channel-oriented. Most callers of features API code will be supplying a channel so that the individual channel's settings will be acquired rather than the global setting. Missing from this commit is XML documentation for the features configuration. That will be handled in a separate commit. Review: https://reviewboard.asterisk.org/r/2578/ (issue ASTERISK-21542) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390751 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/bridging.c')
-rw-r--r--main/bridging.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/main/bridging.c b/main/bridging.c
index 93db3b0ef..c59638736 100644
--- a/main/bridging.c
+++ b/main/bridging.c
@@ -61,6 +61,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/cli.h"
#include "asterisk/parking.h"
#include "asterisk/core_local.h"
+#include "asterisk/features_config.h"
/*! All bridges container. */
static struct ao2_container *bridges;
@@ -1914,6 +1915,18 @@ static void bridge_channel_feature(struct ast_bridge_channel *bridge_channel)
struct ast_bridge_hook *hook = NULL;
char dtmf[MAXIMUM_DTMF_FEATURE_STRING] = "";
size_t dtmf_len = 0;
+ unsigned int digit_timeout;
+ RAII_VAR(struct ast_features_general_config *, gen_cfg, NULL, ao2_cleanup);
+
+ ast_channel_lock(bridge_channel->chan);
+ gen_cfg = ast_get_chan_features_general_config(bridge_channel->chan);
+ if (!gen_cfg) {
+ ast_log(LOG_ERROR, "Unable to retrieve features configuration.\n");
+ ast_channel_unlock(bridge_channel->chan);
+ return;
+ }
+ digit_timeout = gen_cfg->featuredigittimeout;
+ ast_channel_unlock(bridge_channel->chan);
/* The channel is now under our control and we don't really want any begin frames to do our DTMF matching so disable 'em at the core level */
ast_set_flag(ast_channel_flags(bridge_channel->chan), AST_FLAG_END_DTMF_ONLY);
@@ -1923,7 +1936,7 @@ static void bridge_channel_feature(struct ast_bridge_channel *bridge_channel)
int res;
/* If the above timed out simply exit */
- res = ast_waitfordigit(bridge_channel->chan, 3000);
+ res = ast_waitfordigit(bridge_channel->chan, digit_timeout);
if (!res) {
ast_debug(1, "DTMF feature string collection on %p(%s) timed out\n",
bridge_channel, ast_channel_name(bridge_channel->chan));