summaryrefslogtreecommitdiff
path: root/res
diff options
context:
space:
mode:
authorMatthew Jordan <mjordan@digium.com>2013-06-17 03:00:38 +0000
committerMatthew Jordan <mjordan@digium.com>2013-06-17 03:00:38 +0000
commit6258bbe7bd1885ac5dec095ed0c4490c83a99f44 (patch)
treeff2794f730ca55903a09b9fe7f73f45169a71386 /res
parent67e35c7b4748c3cef954820a2b182e2a5edf8d98 (diff)
Update Asterisk's CDRs for the new bridging framework
This patch is the initial push to update Asterisk's CDR engine for the new bridging framework. This patch guts the existing CDR engine and builds the new on top of messages coming across Stasis. As changes in channel state and bridge state are detected, CDRs are built and dispatched accordingly. This fundamentally changes CDRs in a few ways. (1) CDRs are now *very* reflective of the actual state of channels and bridges. This means CDRs track well with what an actual channel is doing - which is useful in transfer scenarios (which were previously difficult to pin down). It does, however, mean that CDRs cannot be 'fooled'. Previous behavior in Asterisk allowed for CDR applications, channels, and other properties to be spoofed in parts of the code - this no longer works. (2) CDRs have defined behavior in multi-party scenarios. This behavior will not be what everyone wants, but it is a defined behavior and as such, it is predictable. (3) The CDR manipulation functions and applications have been overhauled. Major changes have been made to ResetCDR and ForkCDR in particular. Many of the options for these two applications no longer made any sense with the new framework and the (slightly) more immutable nature of CDRs. There are a plethora of other changes. For a full description of CDR behavior, see the CDR specification on the Asterisk wiki. (closes issue ASTERISK-21196) Review: https://reviewboard.asterisk.org/r/2486/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391947 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res')
-rw-r--r--res/res_agi.c5
-rw-r--r--res/res_config_sqlite.c4
-rw-r--r--res/res_monitor.c10
-rw-r--r--res/res_stasis_answer.c3
4 files changed, 4 insertions, 18 deletions
diff --git a/res/res_agi.c b/res/res_agi.c
index 486310dd6..a841f3623 100644
--- a/res/res_agi.c
+++ b/res/res_agi.c
@@ -3625,11 +3625,6 @@ static enum agi_result agi_handle_command(struct ast_channel *chan, AGI *agi, ch
the module we are using */
if (c->mod != ast_module_info->self)
ast_module_ref(c->mod);
- /* If the AGI command being executed is an actual application (using agi exec)
- the app field will be updated in pbx_exec via handle_exec */
- if (ast_channel_cdr(chan) && !ast_check_hangup(chan) && strcasecmp(argv[0], "EXEC"))
- ast_cdr_setapp(ast_channel_cdr(chan), "AGI", buf);
-
res = c->handler(chan, agi, argc, argv);
if (c->mod != ast_module_info->self)
ast_module_unref(c->mod);
diff --git a/res/res_config_sqlite.c b/res/res_config_sqlite.c
index e648f941b..7d5fd83e6 100644
--- a/res/res_config_sqlite.c
+++ b/res/res_config_sqlite.c
@@ -791,7 +791,7 @@ static int cdr_handler(struct ast_cdr *cdr)
AST_RWLIST_TRAVERSE(&(tbl->columns), col, list) {
if (col->isint) {
- ast_cdr_getvar(cdr, col->name, &tmp, workspace, sizeof(workspace), 0, 1);
+ ast_cdr_format_var(cdr, col->name, &tmp, workspace, sizeof(workspace), 1);
if (!tmp) {
continue;
}
@@ -800,7 +800,7 @@ static int cdr_handler(struct ast_cdr *cdr)
ast_str_append(&sql2, 0, "%s%d", first ? "" : ",", scannum);
}
} else {
- ast_cdr_getvar(cdr, col->name, &tmp, workspace, sizeof(workspace), 0, 0);
+ ast_cdr_format_var(cdr, col->name, &tmp, workspace, sizeof(workspace), 0);
if (!tmp) {
continue;
}
diff --git a/res/res_monitor.c b/res/res_monitor.c
index f1da4ec83..b5225010e 100644
--- a/res/res_monitor.c
+++ b/res/res_monitor.c
@@ -692,18 +692,10 @@ static int start_monitor_exec(struct ast_channel *chan, const char *data)
}
if (!ast_strlen_zero(urlprefix) && !ast_strlen_zero(args.fname_base)) {
- struct ast_cdr *chan_cdr;
snprintf(tmp, sizeof(tmp), "%s/%s.%s", urlprefix, args.fname_base,
((strcmp(args.format, "gsm")) ? "wav" : "gsm"));
ast_channel_lock(chan);
- if (!ast_channel_cdr(chan)) {
- if (!(chan_cdr = ast_cdr_alloc())) {
- ast_channel_unlock(chan);
- return -1;
- }
- ast_channel_cdr_set(chan, chan_cdr);
- }
- ast_cdr_setuserfield(chan, tmp);
+ ast_cdr_setuserfield(ast_channel_name(chan), tmp);
ast_channel_unlock(chan);
}
if (waitforbridge) {
diff --git a/res/res_stasis_answer.c b/res/res_stasis_answer.c
index b7534b93d..53d4b06e2 100644
--- a/res/res_stasis_answer.c
+++ b/res/res_stasis_answer.c
@@ -42,10 +42,9 @@ static void *app_control_answer(struct stasis_app_control *control,
struct ast_channel *chan, void *data)
{
const int delay = 0;
- const int cdr_answer = 1;
ast_debug(3, "%s: Answering",
stasis_app_control_get_channel_id(control));
- return __ast_answer(chan, delay, cdr_answer) == 0 ? &OK : &FAIL;
+ return __ast_answer(chan, delay) == 0 ? &OK : &FAIL;
}
int stasis_app_control_answer(struct stasis_app_control *control)