<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1226" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Unless i've terribly broken my asterisk box (always
possible :D) i've stumbled across a problem with the current CDR handling for
Dial.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Imagine the scenario where users want to divert
their extension elsewhere, as a test for this I added:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>exten =>
666,1,Dial(Zap/0/<my_home_number>)</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>now that dial string could be anything, dialling
some foreign country or expensive mobile etc.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>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.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>If I answer the call naturally asterisk lets me
speak to myself :-)</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Once I hang up however, a CDR event is generated
that looks like the following:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2><Start Of CDR Record></FONT></DIV>
<DIV><FONT face=Arial size=2>CLID :
<SIP PHONE NUMBER><BR>SRC
:<SIP PHONE NUMBER></FONT></DIV>
<DIV><FONT face=Arial size=2>DST
: 666<BR>DCONTEXT :
customer<BR>CHANNEL : SIP/<SIP PHONE
NUMBER>-886a<BR>DSTCHANNEL : Zap/1-1<BR>LASTAPP
: Dial<BR>LASTDATA : Zap/0/<MY HOME
NUMBER><BR>DURATION : 7<BR>BILLSEC
: 4<BR>DISPOSITON : 4<BR>AMAFLAGS : 3<BR>ACCOUNTCODE :
4130<BR>POSTED : 1<BR>UNIQUEID :
1062076803.0<BR><End of CDR Record></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Now, should asterisk return TWO cdr events in the
above example?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I.e </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2><SIP_PHONE> -> 666 </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>then</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> 666 -> <HOME NUMBER> ?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>It would be a lot easier from a billing point
of view?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Of course in this example, a billing app can parse
the 'LASTDATA' field and extract what number it dialled but it's very
messy.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Now imagine they've added &'s to the Dial
string, how do we know which call answered? etc.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Do I bill them for a call to Russia? or did
the person in Australia answer?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Food for thought.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Regards</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Darren Smith</FONT><FONT face=Arial
size=2></DIV></FONT></BODY></HTML>