]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Update CDR variables as pbx starts
authorAlec L Davis <sivad.a@paradise.net.nz>
Wed, 20 Jan 2010 09:37:54 +0000 (09:37 +0000)
committerAlec L Davis <sivad.a@paradise.net.nz>
Wed, 20 Jan 2010 09:37:54 +0000 (09:37 +0000)
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.6.0@241457 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/pbx.c

index 0bcac1a0a8dd0f2fa5894983dfe83e592bad01dd..d86d44df3e0fdfbeef5c7c373f0b4f330ade29fb 100644 (file)
@@ -3686,6 +3686,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 */