<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
 namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="place"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Monaco;
        panose-1:0 0 0 0 0 0 0 0 0 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=purple style='word-wrap: break-word;
-webkit-nbsp-mode: space;-webkit-line-break: after-white-space'>

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Thanks for putting comments in the code. Is
there possibly a place on the wiki where this script might be appropriate?<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>-MC<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<div style='border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt'>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
freeswitch-users-bounces@lists.freeswitch.org
[mailto:freeswitch-users-bounces@lists.freeswitch.org] <b><span
style='font-weight:bold'>On Behalf Of </span></b>Noah Silverman<br>
<b><span style='font-weight:bold'>Sent:</span></b> Thursday, October 09, 2008
3:11 PM<br>
<b><span style='font-weight:bold'>To:</span></b>
Freeswitch-users@lists.freeswitch.org<br>
<b><span style='font-weight:bold'>Subject:</span></b> [Freeswitch-users] Insert
CDR into Mysql</span></font><o:p></o:p></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Hi,<o:p></o:p></span></font></p>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>I managed to write a really short perl script to insert cdr records
into mysql. &nbsp;I wanted to share it with the group...<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Just call this from cron at whatever frequency you want to update your
records.<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>DISCLAIMER: &nbsp;THIS IS A &quot;QUICK AND DIRTY&quot; SCRIPT.
&nbsp;IT HAS NO BUILT IN ERROR CHECKING AND WAS JUST DESIGNED TO WORK FOR MY
BASIC SETUP. &nbsp;YOU MAY NEED TO HEAVILY MODIFY IT TO WORK FOR YOU...<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>-Noah<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>-----------------------------------------------------------<o:p></o:p></span></font></p>

</div>

<div>

<div>

<p class=MsoNormal><font size=1 face=Monaco><span style='font-size:8.5pt;
font-family:Monaco'>#!/usr/local/bin/perl<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=1 color="#a020f0" face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:#A020F0'>use </span></font><font
size=1 face=Monaco><span style='font-size:8.5pt;font-family:Monaco'>DBI;<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=1 color="#a020f0" face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:#A020F0'>use </span></font><font
size=1 face=Monaco><span style='font-size:8.5pt;font-family:Monaco'>Text::ParseWords;<o:p></o:p></span></font></p>

</div>

<div style='min-height: 15px'>

<p class=MsoNormal><font size=1 face=Monaco><span style='font-size:8.5pt;
font-family:Monaco'><o:p>&nbsp;</o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=1 face=Monaco><span style='font-size:8.5pt;
font-family:Monaco'>#connect to database and define path to your log files<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=1 color=black face=Monaco><span style='font-size:
8.5pt;font-family:Monaco;color:black'>$</span></font><font size=1
color="#a000f0" face=Monaco><span style='font-size:8.5pt;font-family:Monaco;
color:#A000F0'>dbh</span></font><font size=1 color=black face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:black'> </span></font><font
size=1 color="#b22200" face=Monaco><span style='font-size:8.5pt;font-family:
Monaco;color:#B22200'>= </span></font><font size=1 color=black face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:black'>DBI</span></font><font
size=1 color="#b22200" face=Monaco><span style='font-size:8.5pt;font-family:
Monaco;color:#B22200'>-&gt;</span></font><font size=1 color="#a000f0"
face=Monaco><span style='font-size:8.5pt;font-family:Monaco;color:#A000F0'>connect</span></font><font
size=1 color="#b22200" face=Monaco><span style='font-size:8.5pt;font-family:
Monaco;color:#B22200'>( </span></font><font size=1 color=blue face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:blue'>'DBI:mysql:freeswitch'</span></font><font
size=1 color="#b22200" face=Monaco><span style='font-size:8.5pt;font-family:
Monaco;color:#B22200'>, </span></font><font size=1 color=blue face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:blue'>'username'</span></font><font
size=1 color="#b22200" face=Monaco><span style='font-size:8.5pt;font-family:
Monaco;color:#B22200'>, </span></font><font size=1 color=blue face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:blue'>'password' </span></font><font
size=1 color="#b22200" face=Monaco><span style='font-size:8.5pt;font-family:
Monaco;color:#B22200'>) or </span></font><font size=1 color="#a020f0"
face=Monaco><span style='font-size:8.5pt;font-family:Monaco;color:#A020F0'>die </span></font><font
size=1 color=blue face=Monaco><span style='font-size:8.5pt;font-family:Monaco;
color:blue'>&quot;connect error&quot;</span></font><font size=1 color=black
face=Monaco><span style='font-size:8.5pt;font-family:Monaco;color:black'>;</span></font><font
size=1 color=blue face=Monaco><span style='font-size:8.5pt;font-family:Monaco;
color:blue'><o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=1 color=black face=Monaco><span style='font-size:
8.5pt;font-family:Monaco;color:black'>$</span></font><font size=1
color="#a000f0" face=Monaco><span style='font-size:8.5pt;font-family:Monaco;
color:#A000F0'>LOG_DIR</span></font><font size=1 color=black face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:black'> </span></font><font
size=1 color="#b22200" face=Monaco><span style='font-size:8.5pt;font-family:
Monaco;color:#B22200'>= </span></font><font size=1 color=blue face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:blue'>&quot;/usr/local/freeswitch/log/cdr-csv&quot;</span></font><font
size=1 color=black face=Monaco><span style='font-size:8.5pt;font-family:Monaco;
color:black'>;</span></font><font size=1 color=blue face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:blue'><o:p></o:p></span></font></p>

</div>

<div style='min-height: 15px'>

<p class=MsoNormal><font size=1 face=Monaco><span style='font-size:8.5pt;
font-family:Monaco'><o:p>&nbsp;</o:p></span></font></p>

</div>

<div style='min-height: 15px'>

<p class=MsoNormal><font size=1 face=Monaco><span style='font-size:8.5pt;
font-family:Monaco'><o:p>&nbsp;</o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=1 color="#b20022" face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:#B20022'>#Make Freeswitch
rotate the log files<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=1 color="#a000f0" face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:#A000F0'>system</span></font><font
size=1 color="#b22200" face=Monaco><span style='font-size:8.5pt;font-family:
Monaco;color:#B22200'>(</span></font><font size=1 color=blue face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:blue'>&quot;killall -HUP
freeswitch&quot;</span></font><font size=1 color=black face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:black'>);</span></font><font
size=1 color=blue face=Monaco><span style='font-size:8.5pt;font-family:Monaco;
color:blue'><o:p></o:p></span></font></p>

</div>

<div style='min-height: 15px'>

<p class=MsoNormal><font size=1 face=Monaco><span style='font-size:8.5pt;
font-family:Monaco'><o:p>&nbsp;</o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=1 color="#b20022" face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:#B20022'>#prepare the insert
statement - You may have to change this depending on the log file definintion
in your freeswitch config.<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=1 color=black face=Monaco><span style='font-size:
8.5pt;font-family:Monaco;color:black'>$</span></font><font size=1
color="#a000f0" face=Monaco><span style='font-size:8.5pt;font-family:Monaco;
color:#A000F0'>insert_sql</span></font><font size=1 color=black face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:black'> </span></font><font
size=1 color="#b22200" face=Monaco><span style='font-size:8.5pt;font-family:
Monaco;color:#B22200'>= </span></font><font size=1 color=black face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:black'>$</span></font><font
size=1 color="#a000f0" face=Monaco><span style='font-size:8.5pt;font-family:
Monaco;color:#A000F0'>dbh</span></font><font size=1 color="#b22200"
face=Monaco><span style='font-size:8.5pt;font-family:Monaco;color:#B22200'>-&gt;</span></font><font
size=1 color=black face=Monaco><span style='font-size:8.5pt;font-family:Monaco;
color:black'>prepare</span></font><font size=1 color="#b22200" face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:#B22200'>(</span></font><font
size=1 color=blue face=Monaco><span style='font-size:8.5pt;font-family:Monaco;
color:blue'>&quot;insert into cdr (caller_id_name, caller_id_number,
destination_number, context, start_timestamp, answer_timestamp, end_timestamp,
duration, billsec, hangup_cause, uuid, bleg_uuid, accountcode) values
(?,?,?,?,?,?,?,?,?,?,?,?,?)&quot;</span></font><font size=1 color="#b22200"
face=Monaco><span style='font-size:8.5pt;font-family:Monaco;color:#B22200'>);</span></font><font
size=1 color=blue face=Monaco><span style='font-size:8.5pt;font-family:Monaco;
color:blue'><o:p></o:p></span></font></p>

</div>

<div style='min-height: 15px'>

<p class=MsoNormal><font size=1 face=Monaco><span style='font-size:8.5pt;
font-family:Monaco'><o:p>&nbsp;</o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=1 color="#b20022" face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:#B20022'>#get a list of all the
Master files with a datestamp on the end.&nbsp; (These are created when log
files rotated above)<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=1 face=Monaco><span style='font-size:8.5pt;
font-family:Monaco'>@<font color="#a000f0"><span style='color:#A000F0'>log_files</span></font>
<font color="#b22200"><span style='color:#B22200'>= </span></font>&lt;$LOG_DIR/Master.csv.*&gt;<font
color="#b22200"><span style='color:#B22200'>;&nbsp;</span></font><o:p></o:p></span></font></p>

</div>

<div style='min-height: 15px'>

<p class=MsoNormal><font size=1 face=Monaco><span style='font-size:8.5pt;
font-family:Monaco'><o:p>&nbsp;</o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=1 color="#b20022" face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:#B20022'>#<st1:place w:st="on">Loop</st1:place>
through the files and insert into the table;<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=1 color="#a020f0" face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:#A020F0'>foreach </span></font><font
size=1 color=black face=Monaco><span style='font-size:8.5pt;font-family:Monaco;
color:black'>$</span></font><font size=1 color="#a000f0" face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:#A000F0'>file</span></font><font
size=1 color=black face=Monaco><span style='font-size:8.5pt;font-family:Monaco;
color:black'> </span></font><font size=1 color="#b22200" face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:#B22200'>(</span></font><font
size=1 color=black face=Monaco><span style='font-size:8.5pt;font-family:Monaco;
color:black'>@</span></font><font size=1 color="#a000f0" face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:#A000F0'>log_files</span></font><font
size=1 color="#b22200" face=Monaco><span style='font-size:8.5pt;font-family:
Monaco;color:#B22200'>){</span></font><font size=1 color="#a000f0" face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:#A000F0'><o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><span class=apple-tab-span><font size=1 color="#b22200"
face=Monaco><span style='font-size:8.5pt;font-family:Monaco;color:#B22200'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></font></span><font
size=1 color="#a000f0" face=Monaco><span style='font-size:8.5pt;font-family:
Monaco;color:#A000F0'>print </span></font><font size=1 color=blue face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:blue'>&quot;$file\n&quot;</span></font><font
size=1 color="#b22200" face=Monaco><span style='font-size:8.5pt;font-family:
Monaco;color:#B22200'>;</span></font><font size=1 color=blue face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:blue'><o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=1 color="#b22200" face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:#B22200'>&nbsp;<span
class=apple-tab-span>&nbsp;&nbsp;&nbsp;&nbsp; </span></span></font><font size=1 color="#a000f0"
face=Monaco><span style='font-size:8.5pt;font-family:Monaco;color:#A000F0'>open</span></font><font
size=1 color="#b22200" face=Monaco><span style='font-size:8.5pt;font-family:
Monaco;color:#B22200'>(</span></font><font size=1 color=black face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:black'>IN</span></font><font
size=1 color="#b22200" face=Monaco><span style='font-size:8.5pt;font-family:
Monaco;color:#B22200'>, </span></font><font size=1 color=black face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:black'>$</span></font><font
size=1 color="#a000f0" face=Monaco><span style='font-size:8.5pt;font-family:
Monaco;color:#A000F0'>file</span></font><font size=1 color="#b22200"
face=Monaco><span style='font-size:8.5pt;font-family:Monaco;color:#B22200'>) or
</span></font><font size=1 color="#a020f0" face=Monaco><span style='font-size:
8.5pt;font-family:Monaco;color:#A020F0'>die </span></font><font size=1
color=blue face=Monaco><span style='font-size:8.5pt;font-family:Monaco;
color:blue'>&quot;cant open $file\n&quot;</span></font><font size=1
color="#b22200" face=Monaco><span style='font-size:8.5pt;font-family:Monaco;
color:#B22200'>;</span></font><font size=1 color=blue face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:blue'><o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=1 color="#b22200" face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:#B22200'>&nbsp;<span
class=apple-tab-span>&nbsp;&nbsp;&nbsp;&nbsp; </span></span></font><font size=1 color="#a020f0"
face=Monaco><span style='font-size:8.5pt;font-family:Monaco;color:#A020F0'>while
</span></font><font size=1 color="#b22200" face=Monaco><span style='font-size:
8.5pt;font-family:Monaco;color:#B22200'>(</span></font><font size=1
color=black face=Monaco><span style='font-size:8.5pt;font-family:Monaco;
color:black'>&lt;IN&gt;</span></font><font size=1 color="#b22200" face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:#B22200'>){</span></font><font
size=1 color="#a020f0" face=Monaco><span style='font-size:8.5pt;font-family:
Monaco;color:#A020F0'><o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=1 color="#b22200" face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:#B22200'>&nbsp;<span
class=apple-tab-span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>(</span></font><font size=1
color=black face=Monaco><span style='font-size:8.5pt;font-family:Monaco;
color:black'>$</span></font><font size=1 color="#a000f0" face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:#A000F0'>caller_id_name</span></font><font
size=1 color="#b22200" face=Monaco><span style='font-size:8.5pt;font-family:
Monaco;color:#B22200'>, </span></font><font size=1 color=black face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:black'>$</span></font><font
size=1 color="#a000f0" face=Monaco><span style='font-size:8.5pt;font-family:
Monaco;color:#A000F0'>caller_id_number</span></font><font size=1 color="#b22200"
face=Monaco><span style='font-size:8.5pt;font-family:Monaco;color:#B22200'>, </span></font><font
size=1 color=black face=Monaco><span style='font-size:8.5pt;font-family:Monaco;
color:black'>$</span></font><font size=1 color="#a000f0" face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:#A000F0'>destination_number</span></font><font
size=1 color="#b22200" face=Monaco><span style='font-size:8.5pt;font-family:
Monaco;color:#B22200'>, </span></font><font size=1 color=black face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:black'>$</span></font><font
size=1 color="#a000f0" face=Monaco><span style='font-size:8.5pt;font-family:
Monaco;color:#A000F0'>context</span></font><font size=1 color="#b22200"
face=Monaco><span style='font-size:8.5pt;font-family:Monaco;color:#B22200'>, </span></font><font
size=1 color=black face=Monaco><span style='font-size:8.5pt;font-family:Monaco;
color:black'>$</span></font><font size=1 color="#a000f0" face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:#A000F0'>start_stamp</span></font><font
size=1 color="#b22200" face=Monaco><span style='font-size:8.5pt;font-family:
Monaco;color:#B22200'>, </span></font><font size=1 color=black face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:black'>$</span></font><font
size=1 color="#a000f0" face=Monaco><span style='font-size:8.5pt;font-family:
Monaco;color:#A000F0'>answer_stamp</span></font><font size=1 color="#b22200"
face=Monaco><span style='font-size:8.5pt;font-family:Monaco;color:#B22200'>, </span></font><font
size=1 color=black face=Monaco><span style='font-size:8.5pt;font-family:Monaco;
color:black'>$</span></font><font size=1 color="#a000f0" face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:#A000F0'>end_stamp</span></font><font
size=1 color="#b22200" face=Monaco><span style='font-size:8.5pt;font-family:
Monaco;color:#B22200'>, </span></font><font size=1 color=black face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:black'>$</span></font><font
size=1 color="#a000f0" face=Monaco><span style='font-size:8.5pt;font-family:
Monaco;color:#A000F0'>duration</span></font><font size=1 color="#b22200"
face=Monaco><span style='font-size:8.5pt;font-family:Monaco;color:#B22200'>, </span></font><font
size=1 color=black face=Monaco><span style='font-size:8.5pt;font-family:Monaco;
color:black'>$</span></font><font size=1 color="#a000f0" face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:#A000F0'>billsec</span></font><font
size=1 color="#b22200" face=Monaco><span style='font-size:8.5pt;font-family:
Monaco;color:#B22200'>, </span></font><font size=1 color=black face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:black'>$</span></font><font
size=1 color="#a000f0" face=Monaco><span style='font-size:8.5pt;font-family:
Monaco;color:#A000F0'>hangup_cause</span></font><font size=1 color="#b22200"
face=Monaco><span style='font-size:8.5pt;font-family:Monaco;color:#B22200'>, </span></font><font
size=1 color=black face=Monaco><span style='font-size:8.5pt;font-family:Monaco;
color:black'>$</span></font><font size=1 color="#a000f0" face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:#A000F0'>uuid</span></font><font
size=1 color="#b22200" face=Monaco><span style='font-size:8.5pt;font-family:
Monaco;color:#B22200'>, </span></font><font size=1 color=black face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:black'>$</span></font><font
size=1 color="#a000f0" face=Monaco><span style='font-size:8.5pt;font-family:
Monaco;color:#A000F0'>bleg_uuid</span></font><font size=1 color="#b22200"
face=Monaco><span style='font-size:8.5pt;font-family:Monaco;color:#B22200'>, </span></font><font
size=1 color=black face=Monaco><span style='font-size:8.5pt;font-family:Monaco;
color:black'>$</span></font><font size=1 color="#a000f0" face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:#A000F0'>accountcode</span></font><font
size=1 color="#b22200" face=Monaco><span style='font-size:8.5pt;font-family:
Monaco;color:#B22200'>, </span></font><font size=1 color=black face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:black'>$</span></font><font
size=1 color="#a000f0" face=Monaco><span style='font-size:8.5pt;font-family:
Monaco;color:#A000F0'>read_codec</span></font><font size=1 color="#b22200"
face=Monaco><span style='font-size:8.5pt;font-family:Monaco;color:#B22200'>, </span></font><font
size=1 color=black face=Monaco><span style='font-size:8.5pt;font-family:Monaco;
color:black'>$</span></font><font size=1 color="#a000f0" face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:#A000F0'>write_codec</span></font><font
size=1 color="#b22200" face=Monaco><span style='font-size:8.5pt;font-family:
Monaco;color:#B22200'>) = </span></font><font size=1 color=black face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:black'>quotewords</span></font><font
size=1 color="#b22200" face=Monaco><span style='font-size:8.5pt;font-family:
Monaco;color:#B22200'>(</span></font><font size=1 color=blue face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:blue'>&quot;,&quot;</span></font><font
size=1 color="#b22200" face=Monaco><span style='font-size:8.5pt;font-family:
Monaco;color:#B22200'>, </span></font><font size=1 color="#a02000" face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:#A02000'>0</span></font><font
size=1 color="#b22200" face=Monaco><span style='font-size:8.5pt;font-family:
Monaco;color:#B22200'>, </span></font><font size=1 color=black face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:black'>$</span></font><font
size=1 color="#a000f0" face=Monaco><span style='font-size:8.5pt;font-family:
Monaco;color:#A000F0'>_</span></font><font size=1 color="#b22200" face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:#B22200'>);;</span></font><font
size=1 color="#a000f0" face=Monaco><span style='font-size:8.5pt;font-family:
Monaco;color:#A000F0'><o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=1 color="#b22200" face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:#B22200'>&nbsp;<span
class=apple-tab-span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></font><font size=1 color=black
face=Monaco><span style='font-size:8.5pt;font-family:Monaco;color:black'>$</span></font><font
size=1 color="#a000f0" face=Monaco><span style='font-size:8.5pt;font-family:
Monaco;color:#A000F0'>insert_sql</span></font><font size=1 color="#b22200"
face=Monaco><span style='font-size:8.5pt;font-family:Monaco;color:#B22200'>-&gt;</span></font><font
size=1 color=black face=Monaco><span style='font-size:8.5pt;font-family:Monaco;
color:black'>execute</span></font><font size=1 color="#b22200" face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:#B22200'>(</span></font><font
size=1 color=black face=Monaco><span style='font-size:8.5pt;font-family:Monaco;
color:black'>$</span></font><font size=1 color="#a000f0" face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:#A000F0'>caller_id_name</span></font><font
size=1 color="#b22200" face=Monaco><span style='font-size:8.5pt;font-family:
Monaco;color:#B22200'>, </span></font><font size=1 color=black face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:black'>$</span></font><font
size=1 color="#a000f0" face=Monaco><span style='font-size:8.5pt;font-family:
Monaco;color:#A000F0'>caller_id_number</span></font><font size=1 color="#b22200"
face=Monaco><span style='font-size:8.5pt;font-family:Monaco;color:#B22200'>, </span></font><font
size=1 color=black face=Monaco><span style='font-size:8.5pt;font-family:Monaco;
color:black'>$</span></font><font size=1 color="#a000f0" face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:#A000F0'>destination_number</span></font><font
size=1 color="#b22200" face=Monaco><span style='font-size:8.5pt;font-family:
Monaco;color:#B22200'>, </span></font><font size=1 color=black face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:black'>$</span></font><font
size=1 color="#a000f0" face=Monaco><span style='font-size:8.5pt;font-family:
Monaco;color:#A000F0'>context</span></font><font size=1 color="#b22200"
face=Monaco><span style='font-size:8.5pt;font-family:Monaco;color:#B22200'>, </span></font><font
size=1 color=black face=Monaco><span style='font-size:8.5pt;font-family:Monaco;
color:black'>$</span></font><font size=1 color="#a000f0" face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:#A000F0'>start_stamp</span></font><font
size=1 color="#b22200" face=Monaco><span style='font-size:8.5pt;font-family:
Monaco;color:#B22200'>, </span></font><font size=1 color=black face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:black'>$</span></font><font
size=1 color="#a000f0" face=Monaco><span style='font-size:8.5pt;font-family:
Monaco;color:#A000F0'>answer_stamp</span></font><font size=1 color="#b22200"
face=Monaco><span style='font-size:8.5pt;font-family:Monaco;color:#B22200'>, </span></font><font
size=1 color=black face=Monaco><span style='font-size:8.5pt;font-family:Monaco;
color:black'>$</span></font><font size=1 color="#a000f0" face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:#A000F0'>end_stamp</span></font><font
size=1 color="#b22200" face=Monaco><span style='font-size:8.5pt;font-family:
Monaco;color:#B22200'>, </span></font><font size=1 color=black face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:black'>$</span></font><font
size=1 color="#a000f0" face=Monaco><span style='font-size:8.5pt;font-family:
Monaco;color:#A000F0'>duration</span></font><font size=1 color="#b22200"
face=Monaco><span style='font-size:8.5pt;font-family:Monaco;color:#B22200'>, </span></font><font
size=1 color=black face=Monaco><span style='font-size:8.5pt;font-family:Monaco;
color:black'>$</span></font><font size=1 color="#a000f0" face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:#A000F0'>billsec</span></font><font
size=1 color="#b22200" face=Monaco><span style='font-size:8.5pt;font-family:
Monaco;color:#B22200'>, </span></font><font size=1 color=black face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:black'>$</span></font><font
size=1 color="#a000f0" face=Monaco><span style='font-size:8.5pt;font-family:
Monaco;color:#A000F0'>hangup_cause</span></font><font size=1 color="#b22200"
face=Monaco><span style='font-size:8.5pt;font-family:Monaco;color:#B22200'>, </span></font><font
size=1 color=black face=Monaco><span style='font-size:8.5pt;font-family:Monaco;
color:black'>$</span></font><font size=1 color="#a000f0" face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:#A000F0'>uuid</span></font><font
size=1 color="#b22200" face=Monaco><span style='font-size:8.5pt;font-family:
Monaco;color:#B22200'>, </span></font><font size=1 color=black face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:black'>$</span></font><font
size=1 color="#a000f0" face=Monaco><span style='font-size:8.5pt;font-family:
Monaco;color:#A000F0'>bleg_uuid</span></font><font size=1 color="#b22200"
face=Monaco><span style='font-size:8.5pt;font-family:Monaco;color:#B22200'>, </span></font><font
size=1 color=black face=Monaco><span style='font-size:8.5pt;font-family:Monaco;
color:black'>$</span></font><font size=1 color="#a000f0" face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:#A000F0'>accountcode</span></font><font
size=1 color="#b22200" face=Monaco><span style='font-size:8.5pt;font-family:
Monaco;color:#B22200'>);<span class=apple-tab-span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></font><font
size=1 color="#a000f0" face=Monaco><span style='font-size:8.5pt;font-family:
Monaco;color:#A000F0'><o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=1 color="#b22200" face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:#B22200'>&nbsp;<span
class=apple-tab-span>&nbsp;&nbsp;&nbsp;&nbsp; </span>}<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=1 color="#b22200" face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:#B22200'>&nbsp;<span
class=apple-tab-span>&nbsp;&nbsp;&nbsp;&nbsp; </span></span></font><font size=1 color="#b20022"
face=Monaco><span style='font-size:8.5pt;font-family:Monaco;color:#B20022'>#Delete
the log file since we've finished with it.<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=1 color=black face=Monaco><span style='font-size:
8.5pt;font-family:Monaco;color:black'>&nbsp;<span class=apple-tab-span>&nbsp;&nbsp;&nbsp;&nbsp; </span></span></font><font
size=1 color="#a000f0" face=Monaco><span style='font-size:8.5pt;font-family:
Monaco;color:#A000F0'>close</span></font><font size=1 color="#b22200"
face=Monaco><span style='font-size:8.5pt;font-family:Monaco;color:#B22200'>(</span></font><font
size=1 color=black face=Monaco><span style='font-size:8.5pt;font-family:Monaco;
color:black'>IN</span></font><font size=1 color="#b22200" face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:#B22200'>);</span></font><font
size=1 color="#a000f0" face=Monaco><span style='font-size:8.5pt;font-family:
Monaco;color:#A000F0'><o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=1 color="#b22200" face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:#B22200'>&nbsp;<span
class=apple-tab-span>&nbsp;&nbsp;&nbsp;&nbsp; </span></span></font><font size=1 color="#a000f0"
face=Monaco><span style='font-size:8.5pt;font-family:Monaco;color:#A000F0'>unlink</span></font><font
size=1 color="#b22200" face=Monaco><span style='font-size:8.5pt;font-family:
Monaco;color:#B22200'>(</span></font><font size=1 color=black face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:black'>$</span></font><font
size=1 color="#a000f0" face=Monaco><span style='font-size:8.5pt;font-family:
Monaco;color:#A000F0'>file</span></font><font size=1 color="#b22200"
face=Monaco><span style='font-size:8.5pt;font-family:Monaco;color:#B22200'>);</span></font><font
size=1 color="#a000f0" face=Monaco><span style='font-size:8.5pt;font-family:
Monaco;color:#A000F0'><o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=1 color="#b22200" face=Monaco><span
style='font-size:8.5pt;font-family:Monaco;color:#B22200'>}<o:p></o:p></span></font></p>

</div>

<div style='min-height: 15px'>

<p class=MsoNormal><font size=1 face=Monaco><span style='font-size:8.5pt;
font-family:Monaco'><o:p>&nbsp;</o:p></span></font></p>

</div>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

</div>

</div>

</div>

</body>

</html>