mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-15 00:41:02 +00:00
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
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user