diff options
author | Mark Michelson <mmichelson@digium.com> | 2013-06-06 21:40:35 +0000 |
---|---|---|
committer | Mark Michelson <mmichelson@digium.com> | 2013-06-06 21:40:35 +0000 |
commit | 2dc8a060064f359a17f5ebcd515d85fe5203c019 (patch) | |
tree | fca012b9378a2a005fea30278f7d2a6129251b1f /channels/chan_mgcp.c | |
parent | 5f740572d081330fb43462eba5b0f495d8e56df1 (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 'channels/chan_mgcp.c')
-rw-r--r-- | channels/chan_mgcp.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/channels/chan_mgcp.c b/channels/chan_mgcp.c index df82061b8..9080dbaf0 100644 --- a/channels/chan_mgcp.c +++ b/channels/chan_mgcp.c @@ -84,6 +84,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/pktccops.h" #include "asterisk/stasis.h" #include "asterisk/bridging.h" +#include "asterisk/features_config.h" /* * Define to work around buggy dlink MGCP phone firmware which @@ -2971,9 +2972,21 @@ static void *mgcp_ss(void *data) int res= 0; int getforward = 0; int loop_pause = 100; + RAII_VAR(struct ast_features_pickup_config *, pickup_cfg, NULL, ao2_cleanup); + const char *pickupexten; len = strlen(p->dtmf_buf); + ast_channel_lock(chan); + pickup_cfg = ast_get_chan_features_pickup_config(chan); + if (!pickup_cfg) { + ast_log(LOG_ERROR, "Unable to retrieve pickup configuration options. Unable to detect call pickup extension\n"); + pickupexten = ""; + } else { + pickupexten = ast_strdupa(pickup_cfg->pickupexten); + } + ast_channel_unlock(chan); + while (len < AST_MAX_EXTENSION - 1) { ast_debug(1, "Dtmf buffer '%s' for '%s@%s'\n", p->dtmf_buf, p->name, p->parent->name); res = 1; /* Assume that we will get a digit */ @@ -3065,7 +3078,7 @@ static void *mgcp_ss(void *data) len = 0; memset(p->dtmf_buf, 0, sizeof(p->dtmf_buf)); timeout = firstdigittimeout; - } else if (!strcmp(p->dtmf_buf,ast_pickup_ext())) { + } else if (!strcmp(p->dtmf_buf, pickupexten)) { /* Scan all channels and see if any there * ringing channqels with that have call groups * that equal this channels pickup group |