From: Alec L Davis Date: Wed, 20 Jan 2010 09:38:09 +0000 (+0000) Subject: Update CDR variables as pbx starts X-Git-Tag: 1.4.30-rc2~5^2~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8f672dd98bf597327c7f23df14e92266186c0b3f;p=thirdparty%2Fasterisk.git Update CDR variables as pbx starts Allows CDR variables added in cdr.c:set_one_cid to become visable during the call, by executing ast_cdr_update() early in __ast_pbx_run. Based on cdr_update.diff3.txt (issue #16638) Reported by: alecdavis Patches: cdr_update.diff3.txt uploaded by alecdavis (license 585) Tested by: alecdavis git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@241458 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/pbx.c b/main/pbx.c index 986a548d82..18210c5122 100644 --- a/main/pbx.c +++ b/main/pbx.c @@ -2379,6 +2379,10 @@ static int __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 */