[asterisk-dev] CDR
Steve Murphy
murf at digium.com
Thu Jul 26 11:00:32 CDT 2007
On Thu, 2007-07-26 at 12:33 -0300, Ian Esper wrote:
> Hi,
>
> I am working on a cdr, and I can't get the channel, it worked on 1.2,
Then, I assume you are running this code in either 1.4, or trunk?
> here is the code:
>
> chan = ast_channel_walk_locked(NULL);
> while (chan && chan->cdr != cdr) {
> ast_mutex_unlock(&chan->lock);
> chan = ast_channel_walk_locked(chan);
> }
> if (chan) {
> dst = pbx_builtin_getvar_helper(chan, "DESTINATION");
> if (dst && strcmp(dst, cdr->lastdata) == 0) {
> dst = pbx_builtin_getvar_helper(chan, "FIRSTLEN");
> first = strtoul(dst, &end, 10);
> dst = pbx_builtin_getvar_helper(chan, "RESTLEN");
> rest = strtoul(dst, &end, 10);
> dst = pbx_builtin_getvar_helper(chan, "STARTCOST");
> start = strtof(dst, &end);
> dst = pbx_builtin_getvar_helper(chan, "PERIODCOST");
> each = strtof(dst, &end);
> dst = pbx_builtin_getvar_helper(chan, "TRIALCOST");
> trial = strtof(dst, &end);
> }
> ast_mutex_unlock(&chan->lock);
> }
>
> What is wrong and what could I do?
CDR's are always attached to channels, but channels can be masqueraded
and zombied in the course of a bridge... usually via transfers. CDR's
can also
be copied and chained; you are only inspecting the first cdr in the
list.
Tell us more about the disappearing CDR. Are transfers/parking/etc
involved? Does it always happen? When does it not happen?
murf
>
> Thanks
>
> Ian Esper
>
>
--
Steve Murphy
Software Developer
Digium
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3227 bytes
Desc: not available
Url : http://lists.digium.com/pipermail/asterisk-dev/attachments/20070726/aa784111/attachment.bin
More information about the asterisk-dev
mailing list