[asterisk-commits] mmichelson: branch mmichelson/features_config r390703 - in /team/mmichelson/f...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Jun 6 15:11:27 CDT 2013
Author: mmichelson
Date: Thu Jun 6 15:11:25 2013
New Revision: 390703
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=390703
Log:
Address latest review feedback aside from XML documentation of config options.
Config options documentation will be handled as a separate review since features
configuration is blocking other work from being completed.
Modified:
team/mmichelson/features_config/include/asterisk/features_config.h
team/mmichelson/features_config/main/bridging.c
team/mmichelson/features_config/main/features.c
team/mmichelson/features_config/main/features_config.c
team/mmichelson/features_config/main/manager.c
Modified: team/mmichelson/features_config/include/asterisk/features_config.h
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/features_config/include/asterisk/features_config.h?view=diff&rev=390703&r1=390702&r2=390703
==============================================================================
--- team/mmichelson/features_config/include/asterisk/features_config.h (original)
+++ team/mmichelson/features_config/include/asterisk/features_config.h Thu Jun 6 15:11:25 2013
@@ -27,6 +27,10 @@
* \brief General features configuration items
*/
struct ast_features_general_config {
+ AST_DECLARE_STRING_FIELDS(
+ /*! Sound played when automon or automixmon features are used */
+ AST_STRING_FIELD(courtesytone);
+ );
/*! Milliseconds allowed between digit presses when entering feature code */
unsigned int featuredigittimeout;
};
Modified: team/mmichelson/features_config/main/bridging.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/features_config/main/bridging.c?view=diff&rev=390703&r1=390702&r2=390703
==============================================================================
--- team/mmichelson/features_config/main/bridging.c (original)
+++ team/mmichelson/features_config/main/bridging.c Thu Jun 6 15:11:25 2013
@@ -1922,6 +1922,7 @@
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;
Modified: team/mmichelson/features_config/main/features.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/features_config/main/features.c?view=diff&rev=390703&r1=390702&r2=390703
==============================================================================
--- team/mmichelson/features_config/main/features.c (original)
+++ team/mmichelson/features_config/main/features.c Thu Jun 6 15:11:25 2013
@@ -76,6 +76,7 @@
#include "asterisk/bridging_basic.h"
#include "asterisk/features_config.h"
+/* BUGBUG TEST_FRAMEWORK is disabled because parking tests no longer work. */
#undef TEST_FRAMEWORK
/*
@@ -3242,9 +3243,9 @@
res = 0;
if (ast_test_flag(flags, AST_FEATURE_REDIRECT)) {
+ /* Add atxfer and blind transfer. */
if (!builtin_feature_get_exten(chan, "blindxfer", dtmf, sizeof(dtmf))
&& !ast_strlen_zero(dtmf)) {
- /* Add atxfer and blind transfer. */
/* BUGBUG need to supply a blind transfer structure and destructor to use other than defaults */
res |= ast_bridge_features_enable(features, AST_BRIDGE_BUILTIN_BLINDTRANSFER, dtmf,
NULL, NULL, AST_BRIDGE_HOOK_REMOVE_ON_PULL);
@@ -4389,10 +4390,16 @@
RAII_VAR(struct ast_bridge *, chan_bridge, NULL, ao2_cleanup);
RAII_VAR(struct ast_features_xfer_config *, xfer_cfg, NULL, ao2_cleanup);
struct ast_channel *bridge_chan = NULL;
+ const char *tone = NULL;
ast_channel_lock(chan);
chan_bridge = ast_channel_get_bridge(chan);
xfer_cfg = ast_get_chan_features_xfer_config(chan);
+ if (!xfer_cfg) {
+ ast_log(LOG_ERROR, "Unable to determine what tone to play to channel.\n");
+ } else {
+ tone = ast_strdupa(xfer_cfg->xfersound);
+ }
ast_channel_unlock(chan);
if (chan_bridge) {
@@ -4417,7 +4424,7 @@
}
}
- if (play_tone && !ast_strlen_zero(xfer_cfg->xfersound)) {
+ if (play_tone && !ast_strlen_zero(tone)) {
struct ast_channel *play_chan = bridge_chan ?: chan;
RAII_VAR(struct ast_bridge_channel *, play_bridge_channel, NULL, ao2_cleanup);
@@ -4429,7 +4436,7 @@
ast_log(LOG_WARNING, "Unable to play tone for channel %s. Unable to get bridge channel\n",
ast_channel_name(play_chan));
} else {
- ast_bridge_channel_queue_playfile(play_bridge_channel, NULL, xfer_cfg->xfersound, NULL);
+ ast_bridge_channel_queue_playfile(play_bridge_channel, NULL, tone, NULL);
}
}
return 0;
Modified: team/mmichelson/features_config/main/features_config.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/features_config/main/features_config.c?view=diff&rev=390703&r1=390702&r2=390703
==============================================================================
--- team/mmichelson/features_config/main/features_config.c (original)
+++ team/mmichelson/features_config/main/features_config.c Thu Jun 6 15:11:25 2013
@@ -26,6 +26,7 @@
#include "asterisk/app.h"
#include "asterisk/cli.h"
+/* BUGBUG XML Documentation is still needed for configuration options */
/*** DOCUMENTATION
<function name="FEATURE" language="en_US">
<synopsis>
@@ -50,6 +51,7 @@
<enum name="pickupexten"><para>Digits used for picking up ringing calls</para></enum>
<enum name="pickupsound"><para>Sound to play to picker when a call is picked up</para></enum>
<enum name="pickupfailsound"><para>Sound to play to picker when a call cannot be picked up</para></enum>
+ <enum name="courtesytone"><para>Sound to play when automon or automixmon is activated</para></enum>
</enumlist>
</parameter>
</syntax>
@@ -472,7 +474,8 @@
static void general_copy(struct ast_features_general_config *dest, const struct ast_features_general_config *src)
{
- *dest = *src;
+ ast_string_fields_copy(dest, src);
+ dest->featuredigittimeout = src->featuredigittimeout;
}
static void xfer_copy(struct ast_features_xfer_config *dest, const struct ast_features_xfer_config *src)
@@ -533,6 +536,8 @@
if (!strcasecmp(name, "featuredigittimeout")) {
res = ast_parse_arg(value, PARSE_INT32, &general->featuredigittimeout);
+ } else if (!strcasecmp(name, "courtesytone")) {
+ ast_string_field_set(general, courtesytone, value);
} else {
/* Unrecognized option */
res = -1;
@@ -548,6 +553,8 @@
if (!strcasecmp(field, "featuredigittimeout")) {
snprintf(buf, len, "%u", general->featuredigittimeout);
+ } else if (!strcasecmp(field, "courtesytone")) {
+ ast_copy_string(buf, general->courtesytone, len);
} else {
/* Unrecognized option */
res = -1;
@@ -674,7 +681,9 @@
} else if (!strcasecmp(name, "atxfer")) {
ast_string_field_set(featuremap, atxfer, value);
} else if (!strcasecmp(name, "automixmon")) {
- ast_string_field_set(featuremap, atxfer, value);
+ ast_string_field_set(featuremap, automixmon, value);
+ } else if (!strcasecmp(name, "parkcall")) {
+ ast_string_field_set(featuremap, parkcall, value);
} else {
/* Unrecognized option */
res = -1;
@@ -698,6 +707,8 @@
ast_copy_string(buf, featuremap->atxfer, len);
} else if (!strcasecmp(field, "automixmon")) {
ast_copy_string(buf, featuremap->automixmon, len);
+ } else if (!strcasecmp(field, "parkcall")) {
+ ast_copy_string(buf, featuremap->parkcall, len);
} else {
/* Unrecognized option */
res = -1;
@@ -1069,6 +1080,7 @@
args.app_data = ast_strip_quoted(args.app_data, "\"", "\"");
}
+ /* Allow caller and callee to be specified for backwards compatibility */
if (!strcasecmp(args.activate_on, "self") || !strcasecmp(args.activate_on, "caller")) {
activate_on_self = 1;
} else if (!strcasecmp(args.activate_on, "peer") || !strcasecmp(args.activate_on, "callee")) {
@@ -1325,6 +1337,8 @@
aco_option_register_custom(&cfg_info, "featuredigittimeout", ACO_EXACT, global_options,
__stringify(DEFAULT_FEATURE_DIGIT_TIMEOUT), general_handler, 0);
+ aco_option_register_custom(&cfg_info, "courtesytone", ACO_EXACT, global_options,
+ __stringify(DEFAULT_COURTESY_TONE), general_handler, 0);
aco_option_register_custom(&cfg_info, "transferdigittimeout", ACO_EXACT, global_options,
__stringify(DEFAULT_TRANSFER_DIGIT_TIMEOUT), xfer_handler, 0)
Modified: team/mmichelson/features_config/main/manager.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/features_config/main/manager.c?view=diff&rev=390703&r1=390702&r2=390703
==============================================================================
--- team/mmichelson/features_config/main/manager.c (original)
+++ team/mmichelson/features_config/main/manager.c Thu Jun 6 15:11:25 2013
@@ -4067,7 +4067,8 @@
}
ast_channel_lock(chan);
- if (ast_get_builtin_feature(chan, "atxfer", feature_code, sizeof(feature_code))) {
+ if (ast_get_builtin_feature(chan, "atxfer", feature_code, sizeof(feature_code)) ||
+ ast_strlen_zero(feature_code)) {
ast_channel_unlock(chan);
astman_send_error(s, m, "No attended transfer feature code found");
ast_channel_unref(chan);
More information about the asterisk-commits
mailing list