[Asterisk-Dev] CDR Events

Darren Smith data at barrysworld.com
Thu Aug 28 07:11:45 MST 2003


Hi

Unless i've terribly broken my asterisk box (always possible :D) i've stumbled across a problem with the current CDR handling for Dial.

Imagine the scenario where users want to divert their extension elsewhere, as a test for this I added:

exten => 666,1,Dial(Zap/0/<my_home_number>)

now that dial string could be anything, dialling some foreign country or expensive mobile etc.

If I dial '666' from my SIP phone, asterisk obviously reads extensions.conf, looks up '666' and Dials out my ZAP port to my home line.

If I answer the call naturally asterisk lets me speak to myself :-)

Once I hang up however, a CDR event is generated that looks like the following:

<Start Of CDR Record>
CLID        : <SIP PHONE NUMBER>
SRC         :<SIP PHONE NUMBER>
DST         : 666
DCONTEXT    : customer
CHANNEL     : SIP/<SIP PHONE NUMBER>-886a
DSTCHANNEL  : Zap/1-1
LASTAPP     : Dial
LASTDATA    : Zap/0/<MY HOME NUMBER>
DURATION    : 7
BILLSEC     : 4
DISPOSITON  : 4
AMAFLAGS    : 3
ACCOUNTCODE : 4130
POSTED      : 1
UNIQUEID    : 1062076803.0
<End of CDR Record>

Now, should asterisk return TWO cdr events in the above example?

I.e 

<SIP_PHONE> -> 666 

then

 666 -> <HOME NUMBER> ?

It would be a lot easier from a billing point of view?

Of course in this example, a billing app can parse the 'LASTDATA' field and extract what number it dialled but it's very messy.

Now imagine they've added &'s to the Dial string, how do we know which call answered? etc.

Do I bill them for a call to Russia? or did the person in Australia answer?

Food for thought.

Regards

Darren Smith
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20030828/55a48bb0/attachment.htm


More information about the asterisk-dev mailing list