Fix errors in cdr_custom that cause reference errors when non-CDR variable
authorSean Bright <sean@malleable.com>
Sat, 23 May 2009 15:16:59 +0000 (15:16 +0000)
committerSean Bright <sean@malleable.com>
Sat, 23 May 2009 15:16:59 +0000 (15:16 +0000)
commit1d28f5acd4230ed43db823a74de8090da0b40d73
treef93be12015092be0313c89a4ca53a0163454d059
parent57eedf97d03440fc179e48bf581facae7aca1c43
Fix errors in cdr_custom that cause reference errors when non-CDR variable
substitution is done.

cdr_custom was creating a ast_channel struct directly and passing it into the
core for variable substition.  This was fine as long as the format string
contained only calls to the CDR() function.  Doing something like ${EPOCH} on
the other hand tried to lock the channel, which would fail and throw an error
because the passed channel hadn't been allocated as an ao2 object.  So now we
create the dummy channel with ast_channel_alloc, and everything works as
expected.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@196520 65c4cc65-6c06-0410-ace0-fbb531ad65f3
cdr/cdr_custom.c