mirror of
https://github.com/asterisk/asterisk.git
synced 2026-05-04 20:33:53 +00:00
app_macro: Remove deprecated module.
For most modules that interacted with app_macro, this change is limited to no longer looking for the current context from the macrocontext when set. Additionally, the following modules are impacted: app_dial - no longer supports M^ connected/redirecting macro app_minivm - samples written using macro will no longer work. The sample needs a re-write app_queue - can no longer a macro on the called party's channel. Use gosub which is currently supported ccss - no callback macro, gosub only app_voicemail - no macro support channel - remove macrocontext and priority, no connected line or redirection macro options options - stdexten is deprecated to gosub as the default and only pbx - removed macrolock pbx_dundi - no longer look for macro snmp - removed macro context, exten, and priority ASTERISK-30304 Change-Id: I830daab293117179b8d61bd4df0d971a1b3d07f6
This commit is contained in:
committed by
Friendly Automation
parent
6ecec51e6a
commit
e8f548c155
47
main/ccss.c
47
main/ccss.c
@@ -167,7 +167,6 @@ struct ast_cc_config_params {
|
||||
unsigned int cc_recall_timer;
|
||||
unsigned int cc_max_agents;
|
||||
unsigned int cc_max_monitors;
|
||||
char cc_callback_macro[AST_MAX_EXTENSION];
|
||||
char cc_callback_sub[AST_MAX_EXTENSION];
|
||||
char cc_agent_dialstring[AST_MAX_EXTENSION];
|
||||
};
|
||||
@@ -669,7 +668,6 @@ static const struct ast_cc_config_params cc_default_params = {
|
||||
.cc_recall_timer = CC_RECALL_TIMER_DEFAULT,
|
||||
.cc_max_agents = CC_MAX_AGENTS_DEFAULT,
|
||||
.cc_max_monitors = CC_MAX_MONITORS_DEFAULT,
|
||||
.cc_callback_macro = "",
|
||||
.cc_callback_sub = "",
|
||||
.cc_agent_dialstring = "",
|
||||
};
|
||||
@@ -762,9 +760,7 @@ int ast_cc_get_param(struct ast_cc_config_params *params, const char * const nam
|
||||
{
|
||||
const char *value = NULL;
|
||||
|
||||
if (!strcasecmp(name, "cc_callback_macro")) {
|
||||
value = ast_get_cc_callback_macro(params);
|
||||
} else if (!strcasecmp(name, "cc_callback_sub")) {
|
||||
if (!strcasecmp(name, "cc_callback_sub")) {
|
||||
value = ast_get_cc_callback_sub(params);
|
||||
} else if (!strcasecmp(name, "cc_agent_policy")) {
|
||||
value = agent_policy_to_str(ast_get_cc_agent_policy(params));
|
||||
@@ -812,9 +808,6 @@ int ast_cc_set_param(struct ast_cc_config_params *params, const char * const nam
|
||||
return ast_set_cc_monitor_policy(params, str_to_monitor_policy(value));
|
||||
} else if (!strcasecmp(name, "cc_agent_dialstring")) {
|
||||
ast_set_cc_agent_dialstring(params, value);
|
||||
} else if (!strcasecmp(name, "cc_callback_macro")) {
|
||||
ast_set_cc_callback_macro(params, value);
|
||||
return 0;
|
||||
} else if (!strcasecmp(name, "cc_callback_sub")) {
|
||||
ast_set_cc_callback_sub(params, value);
|
||||
return 0;
|
||||
@@ -853,7 +846,6 @@ int ast_cc_is_config_param(const char * const name)
|
||||
!strcasecmp(name, "ccbs_available_timer") ||
|
||||
!strcasecmp(name, "cc_max_agents") ||
|
||||
!strcasecmp(name, "cc_max_monitors") ||
|
||||
!strcasecmp(name, "cc_callback_macro") ||
|
||||
!strcasecmp(name, "cc_callback_sub") ||
|
||||
!strcasecmp(name, "cc_agent_dialstring") ||
|
||||
!strcasecmp(name, "cc_recall_timer"));
|
||||
@@ -992,26 +984,11 @@ void ast_set_cc_max_monitors(struct ast_cc_config_params *config, unsigned int v
|
||||
config->cc_max_monitors = value;
|
||||
}
|
||||
|
||||
const char *ast_get_cc_callback_macro(struct ast_cc_config_params *config)
|
||||
{
|
||||
return config->cc_callback_macro;
|
||||
}
|
||||
|
||||
const char *ast_get_cc_callback_sub(struct ast_cc_config_params *config)
|
||||
{
|
||||
return config->cc_callback_sub;
|
||||
}
|
||||
|
||||
void ast_set_cc_callback_macro(struct ast_cc_config_params *config, const char * const value)
|
||||
{
|
||||
ast_log(LOG_WARNING, "Usage of cc_callback_macro is deprecated. Please use cc_callback_sub instead.\n");
|
||||
if (ast_strlen_zero(value)) {
|
||||
config->cc_callback_macro[0] = '\0';
|
||||
} else {
|
||||
ast_copy_string(config->cc_callback_macro, value, sizeof(config->cc_callback_macro));
|
||||
}
|
||||
}
|
||||
|
||||
void ast_set_cc_callback_sub(struct ast_cc_config_params *config, const char * const value)
|
||||
{
|
||||
if (ast_strlen_zero(value)) {
|
||||
@@ -2156,7 +2133,7 @@ static int cc_interfaces_datastore_init(struct ast_channel *chan) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!(monitor = cc_extension_monitor_init(S_OR(ast_channel_macroexten(chan), ast_channel_exten(chan)), S_OR(ast_channel_macrocontext(chan), ast_channel_context(chan)), 0))) {
|
||||
if (!(monitor = cc_extension_monitor_init(ast_channel_exten(chan), ast_channel_context(chan), 0))) {
|
||||
ast_free(interfaces);
|
||||
return -1;
|
||||
}
|
||||
@@ -2465,8 +2442,9 @@ int ast_cc_call_init(struct ast_channel *chan, int *ignore_cc)
|
||||
}
|
||||
|
||||
/* Situation 2 has occurred */
|
||||
if (!(monitor = cc_extension_monitor_init(S_OR(ast_channel_macroexten(chan), ast_channel_exten(chan)),
|
||||
S_OR(ast_channel_macrocontext(chan), ast_channel_context(chan)), interfaces->dial_parent_id))) {
|
||||
if (!(monitor = cc_extension_monitor_init(ast_channel_exten(chan),
|
||||
ast_channel_context(chan),
|
||||
interfaces->dial_parent_id))) {
|
||||
return -1;
|
||||
}
|
||||
monitor->core_id = interfaces->core_id;
|
||||
@@ -2681,8 +2659,8 @@ static int cc_generic_agent_init(struct ast_cc_agent *agent, struct ast_channel
|
||||
if (ast_channel_caller(chan)->id.name.valid && ast_channel_caller(chan)->id.name.str) {
|
||||
ast_copy_string(generic_pvt->cid_name, ast_channel_caller(chan)->id.name.str, sizeof(generic_pvt->cid_name));
|
||||
}
|
||||
ast_copy_string(generic_pvt->exten, S_OR(ast_channel_macroexten(chan), ast_channel_exten(chan)), sizeof(generic_pvt->exten));
|
||||
ast_copy_string(generic_pvt->context, S_OR(ast_channel_macrocontext(chan), ast_channel_context(chan)), sizeof(generic_pvt->context));
|
||||
ast_copy_string(generic_pvt->exten, ast_channel_exten(chan), sizeof(generic_pvt->exten));
|
||||
ast_copy_string(generic_pvt->context, ast_channel_context(chan), sizeof(generic_pvt->context));
|
||||
agent->private_data = generic_pvt;
|
||||
ast_set_flag(agent, AST_CC_AGENT_SKIP_OFFER);
|
||||
return 0;
|
||||
@@ -2822,7 +2800,6 @@ static void *generic_recall(void *data)
|
||||
char *target;
|
||||
int reason;
|
||||
struct ast_channel *chan;
|
||||
const char *callback_macro = ast_get_cc_callback_macro(agent->cc_params);
|
||||
const char *callback_sub = ast_get_cc_callback_sub(agent->cc_params);
|
||||
unsigned int recall_timer = ast_get_cc_recall_timer(agent->cc_params) * 1000;
|
||||
struct ast_format_cap *tmp_cap = ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_DEFAULT);
|
||||
@@ -2863,16 +2840,6 @@ static void *generic_recall(void *data)
|
||||
pbx_builtin_setvar_helper(chan, "CC_EXTEN", generic_pvt->exten);
|
||||
pbx_builtin_setvar_helper(chan, "CC_CONTEXT", generic_pvt->context);
|
||||
|
||||
if (!ast_strlen_zero(callback_macro)) {
|
||||
ast_log_dynamic_level(cc_logger_level, "Core %u: There's a callback macro configured for agent %s\n",
|
||||
agent->core_id, agent->device_name);
|
||||
if (ast_app_exec_macro(NULL, chan, callback_macro)) {
|
||||
ast_cc_failed(agent->core_id, "Callback macro to %s failed. Maybe a hangup?", agent->device_name);
|
||||
ast_hangup(chan);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (!ast_strlen_zero(callback_sub)) {
|
||||
ast_log_dynamic_level(cc_logger_level, "Core %u: There's a callback subroutine configured for agent %s\n",
|
||||
agent->core_id, agent->device_name);
|
||||
|
||||
Reference in New Issue
Block a user