diff options
-rw-r--r-- | channels/sig_pri.c | 2 | ||||
-rw-r--r-- | main/pbx.c | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/channels/sig_pri.c b/channels/sig_pri.c index 63b84e5f9..76f8f41e0 100644 --- a/channels/sig_pri.c +++ b/channels/sig_pri.c @@ -2515,7 +2515,6 @@ static void *pri_dchannel(void *vpri) sig_pri_handle_subcmds(pri, chanpos, e->e, e->ring.channel, e->ring.subcmds, e->ring.call); - ast_cdr_update(c); } if (c && !ast_pthread_create_detached(&threadid, NULL, pri_ss_thread, pri->pvts[chanpos])) { ast_verb(3, "Accepting overlap call from '%s' to '%s' on channel %d/%d, span %d\n", @@ -2618,7 +2617,6 @@ static void *pri_dchannel(void *vpri) sig_pri_handle_subcmds(pri, chanpos, e->e, e->ring.channel, e->ring.subcmds, e->ring.call); - ast_cdr_update(c); } if (c && !ast_pbx_start(c)) { ast_verb(3, "Accepting call from '%s' to '%s' on channel %d/%d, span %d\n", diff --git a/main/pbx.c b/main/pbx.c index 6f67abaea..1b6e498f5 100644 --- a/main/pbx.c +++ b/main/pbx.c @@ -4628,6 +4628,10 @@ static enum ast_pbx_result __ast_pbx_run(struct ast_channel *c, ast_copy_string(c->context, "default", sizeof(c->context)); } } + if (c->cdr) { + /* allow CDR variables that have been collected after channel was created to be visible during call */ + ast_cdr_update(c); + } for (;;) { char dst_exten[256]; /* buffer to accumulate digits */ int pos = 0; /* XXX should check bounds */ |