Wait, there'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"><<a href="mailto:msc@freeswitch.org">msc@freeswitch.org</a>></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'll have to buy the book to get the full monty, but here's the example script from that recipe, which will also be freely downloadable from Packt's web site once the CB is done:<div>
<br></div><div><div><font face="'courier new', monospace" size="1">#!/usr/bin/perl </font></div>
<div><font face="'courier new', monospace" size="1"># <a href="http://handle_cdr.pl" target="_blank">handle_cdr.pl</a> </font></div>
<div><font face="'courier new', monospace" size="1"># Connect to event socket, listen for CHANNEL_HANGUP_COMPLETE events </font></div>
<div><font face="'courier new', monospace" size="1"># Uses event data to create custom CDRs </font></div>
<div><font face="'courier new', monospace" size="1">use strict;</font></div><div><font face="'courier new', monospace" size="1">use warnings;</font></div><div><font face="'courier new', monospace" size="1">use lib '/usr/src/freeswitch.git/libs/esl/perl';</font></div>
<div><font face="'courier new', monospace" size="1">use ESL;</font></div><div><font face="'courier new', monospace" size="1">my $host = "localhost";</font></div><div><font face="'courier new', monospace" size="1">my $port = "8021";</font></div>
<div><font face="'courier new', monospace" size="1">my $pass = "ClueCon";</font></div><div><font face="'courier new', monospace" size="1">my $con = new ESL::ESLconnection($host, $port, $pass);</font></div>
<div><font face="'courier new', monospace" size="1">if ( ! $con ) {</font></div><div><font face="'courier new', monospace" size="1"> die "Unable to establish connection to FreeSWITCH.\n";</font></div>
<div><font face="'courier new', monospace" size="1">}</font></div><div><font face="'courier new', monospace" size="1">## Listen for events, filter in only CHANNEL_HANGUP_COMPLETE </font></div>
<div><font face="'courier new', monospace" size="1">$con->events('plain','all');</font></div><div><font face="'courier new', monospace" size="1">$con->filter('Event-Name','CHANNEL_HANGUP_COMPLETE');</font></div>
<div><font face="'courier new', monospace" size="1">print "Connected to FreeSWITCH $host:$port and waiting for events...\n\n";</font></div><div><font face="'courier new', monospace" size="1">while (1) {</font></div>
<div><font face="'courier new', monospace" size="1">my @raw_data = split "\n",$e->serialize();</font></div><div><font face="'courier new', monospace" size="1"> my %cdr;</font></div><div><font face="'courier new', monospace" size="1"> foreach my $item ( @raw_data ) {</font></div>
<div><font face="'courier new', monospace" size="1"> #print "$item\n"; </font></div>
<div><font face="'courier new', monospace" size="1"> my ($header, $value) = split ': ', $item;</font></div><div><font face="'courier new', monospace" size="1"> $header =~ s/^variable_//;</font></div>
<div><font face="'courier new', monospace" size="1"> $cdr{$header} = $value</font></div><div><font face="'courier new', monospace" size="1"> }</font></div><div><font face="'courier new', monospace" size="1"> # %cdr contains a complete list of channel variables</font></div>
<div><font face="'courier new', monospace" size="1"> print "New CDR: ";</font></div><div><font face="'courier new', monospace" size="1"> print $cdr{uuid} . ', ' . $cdr{direction} . ', ';</font></div>
<div><font face="'courier new', monospace" size="1"> print $cdr{answer_epoch} . ', ' . $cdr{end_epoch} . ', ';</font></div><div><font face="'courier new', monospace" size="1"> print $cdr{hangup_cause} . "\n";</font></div>
<div><font face="'courier new', monospace" size="1">}</font></div><div><br></div><div><br></div><div>-MC</div><br><div class="gmail_quote"><div><div></div><div class="h5">On Wed, Dec 7, 2011 at 6:15 AM, Tux Tux <span dir="ltr"><<a href="mailto:tha_tux@hotmail.com" target="_blank">tha_tux@hotmail.com</a>></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 class="h5">
<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">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><br clear="all"><div><br></div>-- <br>Anthony Minessale II<br><br>FreeSWITCH <a href="http://www.freeswitch.org/">http://www.freeswitch.org/</a><br>ClueCon <a href="http://www.cluecon.com/">http://www.cluecon.com/</a><br>
Twitter: <a href="http://twitter.com/FreeSWITCH_wire">http://twitter.com/FreeSWITCH_wire</a><br><br>AIM: anthm<br><a href="mailto:MSN%3Aanthony_minessale@hotmail.com">MSN:anthony_minessale@hotmail.com</a><br>GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com">PAYPAL:anthony.minessale@gmail.com</a><br>
IRC: <a href="http://irc.freenode.net">irc.freenode.net</a> #freeswitch<br><br>FreeSWITCH Developer Conference<br><a href="mailto:sip%3A888@conference.freeswitch.org">sip:888@conference.freeswitch.org</a><br><a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org">googletalk:conf+888@conference.freeswitch.org</a><br>
pstn:+19193869900<br>
</div></div>