diff options
author | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2011-02-07 17:36:56 +0000 |
---|---|---|
committer | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2011-02-07 17:36:56 +0000 |
commit | 177925ab968f095566a6010292262e938ab44d72 (patch) | |
tree | ab05a09a441a641a8e0cd461ab586b8b8ed36bb5 /main | |
parent | 1ae68512cde0584caa62e2ef0d80e404eeccd2a9 (diff) |
Rearrange a bit of code in the generic CC recall operation.
By waiting to call the callback macro after the CC_INTERFACES,
extension, priority, and context have been set, this information
can be accessed more easily within the callback macro.
Reported by Philippe Lindheimer.
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.8@306575 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r-- | main/ccss.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/main/ccss.c b/main/ccss.c index 23eef4a08..942d1d1eb 100644 --- a/main/ccss.c +++ b/main/ccss.c @@ -2495,15 +2495,7 @@ static void *generic_recall(void *data) ast_cc_failed(agent->core_id, "Failed to call back device %s/%s", tech, target); return NULL; } - if (!ast_strlen_zero(callback_macro)) { - ast_log_dynamic_level(cc_logger_level, "Core %d: There's a callback macro configured for agent %s\n", - agent->core_id, agent->device_name); - if (ast_app_run_macro(NULL, chan, callback_macro, NULL)) { - ast_cc_failed(agent->core_id, "Callback macro to %s failed. Maybe a hangup?", agent->device_name); - ast_hangup(chan); - return NULL; - } - } + /* We have a channel. It's time now to set up the datastore of recalled CC interfaces. * This will be a common task for all recall functions. If it were possible, I'd have * the core do it automatically, but alas I cannot. Instead, I will provide a public @@ -2515,6 +2507,16 @@ static void *generic_recall(void *data) ast_copy_string(chan->exten, generic_pvt->exten, sizeof(chan->exten)); ast_copy_string(chan->context, generic_pvt->context, sizeof(chan->context)); chan->priority = 1; + + if (!ast_strlen_zero(callback_macro)) { + ast_log_dynamic_level(cc_logger_level, "Core %d: There's a callback macro configured for agent %s\n", + agent->core_id, agent->device_name); + if (ast_app_run_macro(NULL, chan, callback_macro, NULL)) { + ast_cc_failed(agent->core_id, "Callback macro to %s failed. Maybe a hangup?", agent->device_name); + ast_hangup(chan); + return NULL; + } + } ast_cc_agent_recalling(agent->core_id, "Generic agent %s is recalling", agent->device_name); ast_pbx_start(chan); return NULL; |