<div dir="ltr">I&#39;d just like to mention.. there&#39;s already several CDR handler mods written in C that may suit your needs already..<div><a href="http://wiki.freeswitch.org/wiki/Cdr">http://wiki.freeswitch.org/wiki/Cdr</a></div>

<div><br></div><div><div dir="ltr"><span style="font-family:Verdana,Arial,Helvetica,sans-serif"><span style="font-size:small">-Avi</span></span></div>
<br><br><div class="gmail_quote">On Thu, Dec 8, 2011 at 3:33 AM, Michael Collins <span dir="ltr">&lt;<a href="mailto:msc@freeswitch.org">msc@freeswitch.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Nice! I&#39;ll add that to my recipe. :)<div><span class="HOEnZb"><font color="#888888">-MC</font></span><div><div class="h5"><br><br><div class="gmail_quote">On Wed, Dec 7, 2011 at 5:15 PM, Anthony Minessale <span dir="ltr">&lt;<a href="mailto:anthony.minessale@gmail.com" target="_blank">anthony.minessale@gmail.com</a>&gt;</span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Wait, there&#39;s more!<div><br></div><div>if you have channel variable hangup_complete_with_xml=true , then the body of that event will be a full XML CDR</div>


<div><br></div><div><br><div><br><div class="gmail_quote">On Wed, Dec 7, 2011 at 6:51 PM, Michael Collins <span dir="ltr">&lt;<a href="mailto:msc@freeswitch.org" target="_blank">msc@freeswitch.org</a>&gt;</span> wrote:<br>



<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">well, actually it is possible because in the upcoming FS cookbook I have this exact recipe! You&#39;ll have to buy the book to get the full monty, but here&#39;s the example script from that recipe, which will also be freely downloadable from Packt&#39;s web site once the CB is done:<div>




<br></div><div><div><font face="&#39;courier new&#39;, monospace" size="1">#!/usr/bin/perl                                                                                                                                                 </font></div>




<div><font face="&#39;courier new&#39;, monospace" size="1"># <a href="http://handle_cdr.pl" target="_blank">handle_cdr.pl</a>                                                                                                                                                 </font></div>




<div><font face="&#39;courier new&#39;, monospace" size="1"># Connect to event socket, listen for CHANNEL_HANGUP_COMPLETE events                                                                                       </font></div>




<div><font face="&#39;courier new&#39;, monospace" size="1"># Uses event data to create custom CDRs                                                                                                                         </font></div>




<div><font face="&#39;courier new&#39;, monospace" size="1">use strict;</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">use warnings;</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">use lib &#39;/usr/src/freeswitch.git/libs/esl/perl&#39;;</font></div>




<div><font face="&#39;courier new&#39;, monospace" size="1">use ESL;</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">my $host = &quot;localhost&quot;;</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">my $port = &quot;8021&quot;;</font></div>




<div><font face="&#39;courier new&#39;, monospace" size="1">my $pass = &quot;ClueCon&quot;;</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">my $con  = new ESL::ESLconnection($host, $port, $pass);</font></div>




<div><font face="&#39;courier new&#39;, monospace" size="1">if ( ! $con ) {</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">    die &quot;Unable to establish connection to FreeSWITCH.\n&quot;;</font></div>




<div><font face="&#39;courier new&#39;, monospace" size="1">}</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">## Listen for events, filter in only CHANNEL_HANGUP_COMPLETE                                                                                                    </font></div>




<div><font face="&#39;courier new&#39;, monospace" size="1">$con-&gt;events(&#39;plain&#39;,&#39;all&#39;);</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">$con-&gt;filter(&#39;Event-Name&#39;,&#39;CHANNEL_HANGUP_COMPLETE&#39;);</font></div>




<div><font face="&#39;courier new&#39;, monospace" size="1">print &quot;Connected to FreeSWITCH $host:$port and waiting for events...\n\n&quot;;</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">while (1) {</font></div>




<div><font face="&#39;courier new&#39;, monospace" size="1">my @raw_data = split &quot;\n&quot;,$e-&gt;serialize();</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">    my %cdr;</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">    foreach my $item ( @raw_data ) {</font></div>




<div><font face="&#39;courier new&#39;, monospace" size="1">        #print &quot;$item\n&quot;;                                                                                                                                       </font></div>




<div><font face="&#39;courier new&#39;, monospace" size="1">        my ($header, $value) = split &#39;: &#39;, $item;</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">        $header =~ s/^variable_//;</font></div>




<div><font face="&#39;courier new&#39;, monospace" size="1">        $cdr{$header} = $value</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">    }</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">    # %cdr contains a complete list of channel variables</font></div>




<div><font face="&#39;courier new&#39;, monospace" size="1">    print &quot;New CDR: &quot;;</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">    print $cdr{uuid} . &#39;, &#39; . $cdr{direction} . &#39;, &#39;;</font></div>




<div><font face="&#39;courier new&#39;, monospace" size="1">    print $cdr{answer_epoch} . &#39;, &#39; . $cdr{end_epoch} . &#39;, &#39;;</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">    print $cdr{hangup_cause} . &quot;\n&quot;;</font></div>




<div><font face="&#39;courier new&#39;, monospace" size="1">}</font></div><div><br></div><div><br></div><div>-MC</div><br><div class="gmail_quote"><div><div></div><div>On Wed, Dec 7, 2011 at 6:15 AM, Tux Tux <span dir="ltr">&lt;<a href="mailto:tha_tux@hotmail.com" target="_blank">tha_tux@hotmail.com</a>&gt;</span> wrote:<br>




</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div></div><div>



<div><div dir="ltr">
Hi,<br><br>Is it possible to request the CDR via a ESL event?<br><br>I found the possibilities to save it to disk and/or database but not to get it via the ESL.<br>Maybe this is because the CDR can grow large in size, but I want to be certain.<br>




<br>Thanks,<br>Nico<br><br>                                               </div></div>
<br></div></div>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br></div>
<br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Anthony Minessale II<br><br>FreeSWITCH <a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org/</a><br>ClueCon <a href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com/</a><br>



Twitter: <a href="http://twitter.com/FreeSWITCH_wire" target="_blank">http://twitter.com/FreeSWITCH_wire</a><br><br>AIM: anthm<br><a href="mailto:MSN%3Aanthony_minessale@hotmail.com" target="_blank">MSN:anthony_minessale@hotmail.com</a><br>


GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com" target="_blank">PAYPAL:anthony.minessale@gmail.com</a><br>
IRC: <a href="http://irc.freenode.net" target="_blank">irc.freenode.net</a> #freeswitch<br><br>FreeSWITCH Developer Conference<br><a href="mailto:sip%3A888@conference.freeswitch.org" target="_blank">sip:888@conference.freeswitch.org</a><br>


<a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org" target="_blank">googletalk:conf+888@conference.freeswitch.org</a><br>
pstn:<a href="tel:%2B19193869900" value="+19193869900" target="_blank">+19193869900</a><br>
</div></div>
<br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br></div></div></div>
<br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br></div></div>