summaryrefslogtreecommitdiff
path: root/main/ccss.c
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2011-02-07 17:55:38 +0000
committerMark Michelson <mmichelson@digium.com>2011-02-07 17:55:38 +0000
commitf4ea670a6a1e509297dbae20c02672490fdcaf8b (patch)
tree80959992027d8034bf74d63b6b7bf413130ba126 /main/ccss.c
parent2db3c9e058dadf82e0577e5a2977b7febbb20539 (diff)
Merged revisions 306575 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r306575 | mmichelson | 2011-02-07 11:36:56 -0600 (Mon, 07 Feb 2011) | 9 lines 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: https://origsvn.digium.com/svn/asterisk/trunk@306576 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/ccss.c')
-rw-r--r--main/ccss.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/main/ccss.c b/main/ccss.c
index fc79a01dd..d0fc1852b 100644
--- a/main/ccss.c
+++ b/main/ccss.c
@@ -2505,16 +2505,7 @@ static void *generic_recall(void *data)
return NULL;
}
ast_format_cap_destroy(tmp_cap);
-
- 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
@@ -2526,6 +2517,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;