[asterisk-dev] CDR

Ian Esper ian at bratech.com.br
Thu Jul 26 11:12:04 CDT 2007


I am using 1.4, and it is the rate_engine, the cdr part it does well,
only this part of the code is not working, this is the part I get the
price parameters to charge for the call to put it on mysql database.


Em Qui, 2007-07-26 às 10:00 -0600, Steve Murphy escreveu:
> 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
> > 
> > 
> 
> _______________________________________________
> --Bandwidth and Colocation Provided by http://www.api-digital.com--
> 
> asterisk-dev mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-dev




More information about the asterisk-dev mailing list