<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[Freeswitch-trunk][16974] </title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<div id="header">FreeSWITCH Subversion</div>
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://fisheye.freeswitch.org/changelog/FreeSWITCH?cs=16974">16974</a></dd>
<dt>Author</dt> <dd>nazim</dd>
<dt>Date</dt> <dd>2010-03-12 10:48:13 -0600 (Fri, 12 Mar 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Initial import of xmlcdrd</pre>

<h3>Added Paths</h3>
<ul>
<li>freeswitch/trunk/contrib/nazim/xmlcdrd/</li>
<li><a href="#freeswitchtrunkcontribnazimxmlcdrdAUTHORS">freeswitch/trunk/contrib/nazim/xmlcdrd/AUTHORS</a></li>
<li><a href="#freeswitchtrunkcontribnazimxmlcdrdCOPYING">freeswitch/trunk/contrib/nazim/xmlcdrd/COPYING</a></li>
<li><a href="#freeswitchtrunkcontribnazimxmlcdrdChangeLog">freeswitch/trunk/contrib/nazim/xmlcdrd/ChangeLog</a></li>
<li><a href="#freeswitchtrunkcontribnazimxmlcdrdINSTALL">freeswitch/trunk/contrib/nazim/xmlcdrd/INSTALL</a></li>
<li><a href="#freeswitchtrunkcontribnazimxmlcdrdMakefileam">freeswitch/trunk/contrib/nazim/xmlcdrd/Makefile.am</a></li>
<li><a href="#freeswitchtrunkcontribnazimxmlcdrdNEWS">freeswitch/trunk/contrib/nazim/xmlcdrd/NEWS</a></li>
<li><a href="#freeswitchtrunkcontribnazimxmlcdrdREADME">freeswitch/trunk/contrib/nazim/xmlcdrd/README</a></li>
<li><a href="#freeswitchtrunkcontribnazimxmlcdrdbootstrapsh">freeswitch/trunk/contrib/nazim/xmlcdrd/bootstrap.sh</a></li>
<li>freeswitch/trunk/contrib/nazim/xmlcdrd/conf/</li>
<li><a href="#freeswitchtrunkcontribnazimxmlcdrdconfdb1conf">freeswitch/trunk/contrib/nazim/xmlcdrd/conf/db1.conf</a></li>
<li><a href="#freeswitchtrunkcontribnazimxmlcdrdconflighttpdconfexample">freeswitch/trunk/contrib/nazim/xmlcdrd/conf/lighttpd.conf.example</a></li>
<li><a href="#freeswitchtrunkcontribnazimxmlcdrdconfluaexecconfdist">freeswitch/trunk/contrib/nazim/xmlcdrd/conf/luaexec.conf.dist</a></li>
<li><a href="#freeswitchtrunkcontribnazimxmlcdrdconftestlua">freeswitch/trunk/contrib/nazim/xmlcdrd/conf/test.lua</a></li>
<li><a href="#freeswitchtrunkcontribnazimxmlcdrdconfxmlcdrconfdist">freeswitch/trunk/contrib/nazim/xmlcdrd/conf/xmlcdr.conf.dist</a></li>
<li><a href="#freeswitchtrunkcontribnazimxmlcdrdconfigureac">freeswitch/trunk/contrib/nazim/xmlcdrd/configure.ac</a></li>
<li><a href="#freeswitchtrunkcontribnazimxmlcdrdinstallsh">freeswitch/trunk/contrib/nazim/xmlcdrd/install-sh</a></li>
<li><a href="#freeswitchtrunkcontribnazimxmlcdrdlogc">freeswitch/trunk/contrib/nazim/xmlcdrd/log.c</a></li>
<li><a href="#freeswitchtrunkcontribnazimxmlcdrdlogh">freeswitch/trunk/contrib/nazim/xmlcdrd/log.h</a></li>
<li><a href="#freeswitchtrunkcontribnazimxmlcdrdmainc">freeswitch/trunk/contrib/nazim/xmlcdrd/main.c</a></li>
<li><a href="#freeswitchtrunkcontribnazimxmlcdrdmissing">freeswitch/trunk/contrib/nazim/xmlcdrd/missing</a></li>
<li><a href="#freeswitchtrunkcontribnazimxmlcdrdplugc">freeswitch/trunk/contrib/nazim/xmlcdrd/plug.c</a></li>
<li><a href="#freeswitchtrunkcontribnazimxmlcdrdplugh">freeswitch/trunk/contrib/nazim/xmlcdrd/plug.h</a></li>
<li><a href="#freeswitchtrunkcontribnazimxmlcdrdplugcommonh">freeswitch/trunk/contrib/nazim/xmlcdrd/plugcommon.h</a></li>
<li>freeswitch/trunk/contrib/nazim/xmlcdrd/plugins/</li>
<li>freeswitch/trunk/contrib/nazim/xmlcdrd/plugins/luaexec/</li>
<li><a href="#freeswitchtrunkcontribnazimxmlcdrdpluginsluaexecMakefileam">freeswitch/trunk/contrib/nazim/xmlcdrd/plugins/luaexec/Makefile.am</a></li>
<li><a href="#freeswitchtrunkcontribnazimxmlcdrdpluginsluaexecluaexecc">freeswitch/trunk/contrib/nazim/xmlcdrd/plugins/luaexec/luaexec.c</a></li>
<li>freeswitch/trunk/contrib/nazim/xmlcdrd/plugins/mysqlcdr/</li>
<li><a href="#freeswitchtrunkcontribnazimxmlcdrdpluginsmysqlcdrMakefileam">freeswitch/trunk/contrib/nazim/xmlcdrd/plugins/mysqlcdr/Makefile.am</a></li>
<li><a href="#freeswitchtrunkcontribnazimxmlcdrdpluginsmysqlcdrdbcommonc">freeswitch/trunk/contrib/nazim/xmlcdrd/plugins/mysqlcdr/dbcommon.c</a></li>
<li><a href="#freeswitchtrunkcontribnazimxmlcdrdpluginsmysqlcdrdbcommonh">freeswitch/trunk/contrib/nazim/xmlcdrd/plugins/mysqlcdr/dbcommon.h</a></li>
<li><a href="#freeswitchtrunkcontribnazimxmlcdrdpluginsmysqlcdrmysqlcdrc">freeswitch/trunk/contrib/nazim/xmlcdrd/plugins/mysqlcdr/mysqlcdr.c</a></li>
<li><a href="#freeswitchtrunkcontribnazimxmlcdrdplugldrc">freeswitch/trunk/contrib/nazim/xmlcdrd/plugldr.c</a></li>
<li><a href="#freeswitchtrunkcontribnazimxmlcdrdplugldrh">freeswitch/trunk/contrib/nazim/xmlcdrd/plugldr.h</a></li>
<li>freeswitch/trunk/contrib/nazim/xmlcdrd/scripts/</li>
<li><a href="#freeswitchtrunkcontribnazimxmlcdrdstmtexpc">freeswitch/trunk/contrib/nazim/xmlcdrd/stmtexp.c</a></li>
<li><a href="#freeswitchtrunkcontribnazimxmlcdrdstmtexph">freeswitch/trunk/contrib/nazim/xmlcdrd/stmtexp.h</a></li>
<li><a href="#freeswitchtrunkcontribnazimxmlcdrdstmtexpldrc">freeswitch/trunk/contrib/nazim/xmlcdrd/stmtexpldr.c</a></li>
<li><a href="#freeswitchtrunkcontribnazimxmlcdrdstmtexpldrh">freeswitch/trunk/contrib/nazim/xmlcdrd/stmtexpldr.h</a></li>
<li><a href="#freeswitchtrunkcontribnazimxmlcdrdstmtexptabh">freeswitch/trunk/contrib/nazim/xmlcdrd/stmtexptab.h</a></li>
<li><a href="#freeswitchtrunkcontribnazimxmlcdrdtestxml">freeswitch/trunk/contrib/nazim/xmlcdrd/test.xml</a></li>
<li><a href="#freeswitchtrunkcontribnazimxmlcdrdurldecodec">freeswitch/trunk/contrib/nazim/xmlcdrd/urldecode.c</a></li>
<li><a href="#freeswitchtrunkcontribnazimxmlcdrdurldecodeh">freeswitch/trunk/contrib/nazim/xmlcdrd/urldecode.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="freeswitchtrunkcontribnazimxmlcdrdAUTHORS"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/contrib/nazim/xmlcdrd/AUTHORS (0 => 16974)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/nazim/xmlcdrd/AUTHORS                                (rev 0)
+++ freeswitch/trunk/contrib/nazim/xmlcdrd/AUTHORS        2010-03-12 16:48:13 UTC (rev 16974)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+Nazim Aghabayov 
+mail-to: nazim.aghabayov at buta-tech.com
+
</ins></span></pre></div>
<a id="freeswitchtrunkcontribnazimxmlcdrdCOPYING"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/contrib/nazim/xmlcdrd/COPYING (0 => 16974)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/nazim/xmlcdrd/COPYING                                (rev 0)
+++ freeswitch/trunk/contrib/nazim/xmlcdrd/COPYING        2010-03-12 16:48:13 UTC (rev 16974)
</span><span class="lines">@@ -0,0 +1,471 @@
</span><ins>+                          MOZILLA PUBLIC LICENSE
+                                Version 1.1
+
+                              ---------------
+
+1. Definitions.
+
+     1.0.1. &quot;Commercial Use&quot; means distribution or otherwise making the
+     Covered Code available to a third party.
+
+     1.1. &quot;Contributor&quot; means each entity that creates or contributes to
+     the creation of Modifications.
+
+     1.2. &quot;Contributor Version&quot; means the combination of the Original
+     Code, prior Modifications used by a Contributor, and the Modifications
+     made by that particular Contributor.
+
+     1.3. &quot;Covered Code&quot; means the Original Code or Modifications or the
+     combination of the Original Code and Modifications, in each case
+     including portions thereof.
+
+     1.4. &quot;Electronic Distribution Mechanism&quot; means a mechanism generally
+     accepted in the software development community for the electronic
+     transfer of data.
+
+     1.5. &quot;Executable&quot; means Covered Code in any form other than Source
+     Code.
+
+     1.6. &quot;Initial Developer&quot; means the individual or entity identified
+     as the Initial Developer in the Source Code notice required by Exhibit
+     A.
+
+     1.7. &quot;Larger Work&quot; means a work which combines Covered Code or
+     portions thereof with code not governed by the terms of this License.
+
+     1.8. &quot;License&quot; means this document.
+
+     1.8.1. &quot;Licensable&quot; means having the right to grant, to the maximum
+     extent possible, whether at the time of the initial grant or
+     subsequently acquired, any and all of the rights conveyed herein.
+
+     1.9. &quot;Modifications&quot; means any addition to or deletion from the
+     substance or structure of either the Original Code or any previous
+     Modifications. When Covered Code is released as a series of files, a
+     Modification is:
+          A. Any addition to or deletion from the contents of a file
+          containing Original Code or previous Modifications.
+
+          B. Any new file that contains any part of the Original Code or
+          previous Modifications.
+
+     1.10. &quot;Original Code&quot; means Source Code of computer software code
+     which is described in the Source Code notice required by Exhibit A as
+     Original Code, and which, at the time of its release under this
+     License is not already Covered Code governed by this License.
+
+     1.10.1. &quot;Patent Claims&quot; means any patent claim(s), now owned or
+     hereafter acquired, including without limitation,  method, process,
+     and apparatus claims, in any patent Licensable by grantor.
+
+     1.11. &quot;Source Code&quot; means the preferred form of the Covered Code for
+     making modifications to it, including all modules it contains, plus
+     any associated interface definition files, scripts used to control
+     compilation and installation of an Executable, or source code
+     differential comparisons against either the Original Code or another
+     well known, available Covered Code of the Contributor's choice. The
+     Source Code can be in a compressed or archival form, provided the
+     appropriate decompression or de-archiving software is widely available
+     for no charge.
+
+     1.12. &quot;You&quot; (or &quot;Your&quot;)  means an individual or a legal entity
+     exercising rights under, and complying with all of the terms of, this
+     License or a future version of this License issued under Section 6.1.
+     For legal entities, &quot;You&quot; includes any entity which controls, is
+     controlled by, or is under common control with You. For purposes of
+     this definition, &quot;control&quot; means (a) the power, direct or indirect,
+     to cause the direction or management of such entity, whether by
+     contract or otherwise, or (b) ownership of more than fifty percent
+     (50%) of the outstanding shares or beneficial ownership of such
+     entity.
+
+2. Source Code License.
+
+     2.1. The Initial Developer Grant.
+     The Initial Developer hereby grants You a world-wide, royalty-free,
+     non-exclusive license, subject to third party intellectual property
+     claims:
+          (a)  under intellectual property rights (other than patent or
+          trademark) Licensable by Initial Developer to use, reproduce,
+          modify, display, perform, sublicense and distribute the Original
+          Code (or portions thereof) with or without Modifications, and/or
+          as part of a Larger Work; and
+
+          (b) under Patents Claims infringed by the making, using or
+          selling of Original Code, to make, have made, use, practice,
+          sell, and offer for sale, and/or otherwise dispose of the
+          Original Code (or portions thereof).
+
+          (c) the licenses granted in this Section 2.1(a) and (b) are
+          effective on the date Initial Developer first distributes
+          Original Code under the terms of this License.
+
+          (d) Notwithstanding Section 2.1(b) above, no patent license is
+          granted: 1) for code that You delete from the Original Code; 2)
+          separate from the Original Code;  or 3) for infringements caused
+          by: i) the modification of the Original Code or ii) the
+          combination of the Original Code with other software or devices.
+
+     2.2. Contributor Grant.
+     Subject to third party intellectual property claims, each Contributor
+     hereby grants You a world-wide, royalty-free, non-exclusive license
+
+          (a)  under intellectual property rights (other than patent or
+          trademark) Licensable by Contributor, to use, reproduce, modify,
+          display, perform, sublicense and distribute the Modifications
+          created by such Contributor (or portions thereof) either on an
+          unmodified basis, with other Modifications, as Covered Code
+          and/or as part of a Larger Work; and
+
+          (b) under Patent Claims infringed by the making, using, or
+          selling of  Modifications made by that Contributor either alone
+          and/or in combination with its Contributor Version (or portions
+          of such combination), to make, use, sell, offer for sale, have
+          made, and/or otherwise dispose of: 1) Modifications made by that
+          Contributor (or portions thereof); and 2) the combination of
+          Modifications made by that Contributor with its Contributor
+          Version (or portions of such combination).
+
+          (c) the licenses granted in Sections 2.2(a) and 2.2(b) are
+          effective on the date Contributor first makes Commercial Use of
+          the Covered Code.
+
+          (d)    Notwithstanding Section 2.2(b) above, no patent license is
+          granted: 1) for any code that Contributor has deleted from the
+          Contributor Version; 2)  separate from the Contributor Version;
+          3)  for infringements caused by: i) third party modifications of
+          Contributor Version or ii)  the combination of Modifications made
+          by that Contributor with other software  (except as part of the
+          Contributor Version) or other devices; or 4) under Patent Claims
+          infringed by Covered Code in the absence of Modifications made by
+          that Contributor.
+
+3. Distribution Obligations.
+
+     3.1. Application of License.
+     The Modifications which You create or to which You contribute are
+     governed by the terms of this License, including without limitation
+     Section 2.2. The Source Code version of Covered Code may be
+     distributed only under the terms of this License or a future version
+     of this License released under Section 6.1, and You must include a
+     copy of this License with every copy of the Source Code You
+     distribute. You may not offer or impose any terms on any Source Code
+     version that alters or restricts the applicable version of this
+     License or the recipients' rights hereunder. However, You may include
+     an additional document offering the additional rights described in
+     Section 3.5.
+
+     3.2. Availability of Source Code.
+     Any Modification which You create or to which You contribute must be
+     made available in Source Code form under the terms of this License
+     either on the same media as an Executable version or via an accepted
+     Electronic Distribution Mechanism to anyone to whom you made an
+     Executable version available; and if made available via Electronic
+     Distribution Mechanism, must remain available for at least twelve (12)
+     months after the date it initially became available, or at least six
+     (6) months after a subsequent version of that particular Modification
+     has been made available to such recipients. You are responsible for
+     ensuring that the Source Code version remains available even if the
+     Electronic Distribution Mechanism is maintained by a third party.
+
+     3.3. Description of Modifications.
+     You must cause all Covered Code to which You contribute to contain a
+     file documenting the changes You made to create that Covered Code and
+     the date of any change. You must include a prominent statement that
+     the Modification is derived, directly or indirectly, from Original
+     Code provided by the Initial Developer and including the name of the
+     Initial Developer in (a) the Source Code, and (b) in any notice in an
+     Executable version or related documentation in which You describe the
+     origin or ownership of the Covered Code.
+
+     3.4. Intellectual Property Matters
+          (a) Third Party Claims.
+          If Contributor has knowledge that a license under a third party's
+          intellectual property rights is required to exercise the rights
+          granted by such Contributor under Sections 2.1 or 2.2,
+          Contributor must include a text file with the Source Code
+          distribution titled &quot;LEGAL&quot; which describes the claim and the
+          party making the claim in sufficient detail that a recipient will
+          know whom to contact. If Contributor obtains such knowledge after
+          the Modification is made available as described in Section 3.2,
+          Contributor shall promptly modify the LEGAL file in all copies
+          Contributor makes available thereafter and shall take other steps
+          (such as notifying appropriate mailing lists or newsgroups)
+          reasonably calculated to inform those who received the Covered
+          Code that new knowledge has been obtained.
+
+          (b) Contributor APIs.
+          If Contributor's Modifications include an application programming
+          interface and Contributor has knowledge of patent licenses which
+          are reasonably necessary to implement that API, Contributor must
+          also include this information in the LEGAL file.
+
+               (c)    Representations.
+          Contributor represents that, except as disclosed pursuant to
+          Section 3.4(a) above, Contributor believes that Contributor's
+          Modifications are Contributor's original creation(s) and/or
+          Contributor has sufficient rights to grant the rights conveyed by
+          this License.
+
+     3.5. Required Notices.
+     You must duplicate the notice in Exhibit A in each file of the Source
+     Code.  If it is not possible to put such notice in a particular Source
+     Code file due to its structure, then You must include such notice in a
+     location (such as a relevant directory) where a user would be likely
+     to look for such a notice.  If You created one or more Modification(s)
+     You may add your name as a Contributor to the notice described in
+     Exhibit A.  You must also duplicate this License in any documentation
+     for the Source Code where You describe recipients' rights or ownership
+     rights relating to Covered Code.  You may choose to offer, and to
+     charge a fee for, warranty, support, indemnity or liability
+     obligations to one or more recipients of Covered Code. However, You
+     may do so only on Your own behalf, and not on behalf of the Initial
+     Developer or any Contributor. You must make it absolutely clear than
+     any such warranty, support, indemnity or liability obligation is
+     offered by You alone, and You hereby agree to indemnify the Initial
+     Developer and every Contributor for any liability incurred by the
+     Initial Developer or such Contributor as a result of warranty,
+     support, indemnity or liability terms You offer.
+
+     3.6. Distribution of Executable Versions.
+     You may distribute Covered Code in Executable form only if the
+     requirements of Section 3.1-3.5 have been met for that Covered Code,
+     and if You include a notice stating that the Source Code version of
+     the Covered Code is available under the terms of this License,
+     including a description of how and where You have fulfilled the
+     obligations of Section 3.2. The notice must be conspicuously included
+     in any notice in an Executable version, related documentation or
+     collateral in which You describe recipients' rights relating to the
+     Covered Code. You may distribute the Executable version of Covered
+     Code or ownership rights under a license of Your choice, which may
+     contain terms different from this License, provided that You are in
+     compliance with the terms of this License and that the license for the
+     Executable version does not attempt to limit or alter the recipient's
+     rights in the Source Code version from the rights set forth in this
+     License. If You distribute the Executable version under a different
+     license You must make it absolutely clear that any terms which differ
+     from this License are offered by You alone, not by the Initial
+     Developer or any Contributor. You hereby agree to indemnify the
+     Initial Developer and every Contributor for any liability incurred by
+     the Initial Developer or such Contributor as a result of any such
+     terms You offer.
+
+     3.7. Larger Works.
+     You may create a Larger Work by combining Covered Code with other code
+     not governed by the terms of this License and distribute the Larger
+     Work as a single product. In such a case, You must make sure the
+     requirements of this License are fulfilled for the Covered Code.
+
+4. Inability to Comply Due to Statute or Regulation.
+
+     If it is impossible for You to comply with any of the terms of this
+     License with respect to some or all of the Covered Code due to
+     statute, judicial order, or regulation then You must: (a) comply with
+     the terms of this License to the maximum extent possible; and (b)
+     describe the limitations and the code they affect. Such description
+     must be included in the LEGAL file described in Section 3.4 and must
+     be included with all distributions of the Source Code. Except to the
+     extent prohibited by statute or regulation, such description must be
+     sufficiently detailed for a recipient of ordinary skill to be able to
+     understand it.
+
+5. Application of this License.
+
+     This License applies to code to which the Initial Developer has
+     attached the notice in Exhibit A and to related Covered Code.
+
+6. Versions of the License.
+
+     6.1. New Versions.
+     Netscape Communications Corporation (&quot;Netscape&quot;) may publish revised
+     and/or new versions of the License from time to time. Each version
+     will be given a distinguishing version number.
+
+     6.2. Effect of New Versions.
+     Once Covered Code has been published under a particular version of the
+     License, You may always continue to use it under the terms of that
+     version. You may also choose to use such Covered Code under the terms
+     of any subsequent version of the License published by Netscape. No one
+     other than Netscape has the right to modify the terms applicable to
+     Covered Code created under this License.
+
+     6.3. Derivative Works.
+     If You create or use a modified version of this License (which you may
+     only do in order to apply it to code which is not already Covered Code
+     governed by this License), You must (a) rename Your license so that
+     the phrases &quot;Mozilla&quot;, &quot;MOZILLAPL&quot;, &quot;MOZPL&quot;, &quot;Netscape&quot;,
+     &quot;MPL&quot;, &quot;NPL&quot; or any confusingly similar phrase do not appear in your
+     license (except to note that your license differs from this License)
+     and (b) otherwise make it clear that Your version of the license
+     contains terms which differ from the Mozilla Public License and
+     Netscape Public License. (Filling in the name of the Initial
+     Developer, Original Code or Contributor in the notice described in
+     Exhibit A shall not of themselves be deemed to be modifications of
+     this License.)
+
+7. DISCLAIMER OF WARRANTY.
+
+     COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN &quot;AS IS&quot; BASIS,
+     WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+     WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF
+     DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING.
+     THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE
+     IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT,
+     YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE
+     COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER
+     OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF
+     ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+
+8. TERMINATION.
+
+     8.1.  This License and the rights granted hereunder will terminate
+     automatically if You fail to comply with terms herein and fail to cure
+     such breach within 30 days of becoming aware of the breach. All
+     sublicenses to the Covered Code which are properly granted shall
+     survive any termination of this License. Provisions which, by their
+     nature, must remain in effect beyond the termination of this License
+     shall survive.
+
+     8.2.  If You initiate litigation by asserting a patent infringement
+     claim (excluding declatory judgment actions) against Initial Developer
+     or a Contributor (the Initial Developer or Contributor against whom
+     You file such action is referred to as &quot;Participant&quot;)  alleging that:
+
+     (a)  such Participant's Contributor Version directly or indirectly
+     infringes any patent, then any and all rights granted by such
+     Participant to You under Sections 2.1 and/or 2.2 of this License
+     shall, upon 60 days notice from Participant terminate prospectively,
+     unless if within 60 days after receipt of notice You either: (i)
+     agree in writing to pay Participant a mutually agreeable reasonable
+     royalty for Your past and future use of Modifications made by such
+     Participant, or (ii) withdraw Your litigation claim with respect to
+     the Contributor Version against such Participant.  If within 60 days
+     of notice, a reasonable royalty and payment arrangement are not
+     mutually agreed upon in writing by the parties or the litigation claim
+     is not withdrawn, the rights granted by Participant to You under
+     Sections 2.1 and/or 2.2 automatically terminate at the expiration of
+     the 60 day notice period specified above.
+
+     (b)  any software, hardware, or device, other than such Participant's
+     Contributor Version, directly or indirectly infringes any patent, then
+     any rights granted to You by such Participant under Sections 2.1(b)
+     and 2.2(b) are revoked effective as of the date You first made, used,
+     sold, distributed, or had made, Modifications made by that
+     Participant.
+
+     8.3.  If You assert a patent infringement claim against Participant
+     alleging that such Participant's Contributor Version directly or
+     indirectly infringes any patent where such claim is resolved (such as
+     by license or settlement) prior to the initiation of patent
+     infringement litigation, then the reasonable value of the licenses
+     granted by such Participant under Sections 2.1 or 2.2 shall be taken
+     into account in determining the amount or value of any payment or
+     license.
+
+     8.4.  In the event of termination under Sections 8.1 or 8.2 above,
+     all end user license agreements (excluding distributors and resellers)
+     which have been validly granted by You or any distributor hereunder
+     prior to termination shall survive termination.
+
+9. LIMITATION OF LIABILITY.
+
+     UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
+     (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL
+     DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE,
+     OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR
+     ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY
+     CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL,
+     WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER
+     COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN
+     INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
+     LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
+     RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW
+     PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE
+     EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO
+     THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+
+10. U.S. GOVERNMENT END USERS.
+
+     The Covered Code is a &quot;commercial item,&quot; as that term is defined in
+     48 C.F.R. 2.101 (Oct. 1995), consisting of &quot;commercial computer
+     software&quot; and &quot;commercial computer software documentation,&quot; as such
+     terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48
+     C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995),
+     all U.S. Government End Users acquire Covered Code with only those
+     rights set forth herein.
+
+11. MISCELLANEOUS.
+
+     This License represents the complete agreement concerning subject
+     matter hereof. If any provision of this License is held to be
+     unenforceable, such provision shall be reformed only to the extent
+     necessary to make it enforceable. This License shall be governed by
+     California law provisions (except to the extent applicable law, if
+     any, provides otherwise), excluding its conflict-of-law provisions.
+     With respect to disputes in which at least one party is a citizen of,
+     or an entity chartered or registered to do business in the United
+     States of America, any litigation relating to this License shall be
+     subject to the jurisdiction of the Federal Courts of the Northern
+     District of California, with venue lying in Santa Clara County,
+     California, with the losing party responsible for costs, including
+     without limitation, court costs and reasonable attorneys' fees and
+     expenses. The application of the United Nations Convention on
+     Contracts for the International Sale of Goods is expressly excluded.
+     Any law or regulation which provides that the language of a contract
+     shall be construed against the drafter shall not apply to this
+     License.
+
+12. RESPONSIBILITY FOR CLAIMS.
+
+     As between Initial Developer and the Contributors, each party is
+     responsible for claims and damages arising, directly or indirectly,
+     out of its utilization of rights under this License and You agree to
+     work with Initial Developer and Contributors to distribute such
+     responsibility on an equitable basis. Nothing herein is intended or
+     shall be deemed to constitute any admission of liability.
+
+13. MULTIPLE-LICENSED CODE.
+
+     Initial Developer may designate portions of the Covered Code as
+     &quot;Multiple-Licensed&quot;.  &quot;Multiple-Licensed&quot; means that the Initial
+     Developer permits you to utilize portions of the Covered Code under
+     Your choice of the NPL or the alternative licenses, if any, specified
+     by the Initial Developer in the file described in Exhibit A.
+
+EXHIBIT A -Mozilla Public License.
+
+     ``The contents of this file are subject to the Mozilla Public License
+     Version 1.1 (the &quot;License&quot;); you may not use this file except in
+     compliance with the License. You may obtain a copy of the License at
+     http://www.mozilla.org/MPL/
+
+     Software distributed under the License is distributed on an &quot;AS IS&quot;
+     basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+     License for the specific language governing rights and limitations
+     under the License.
+
+     The Original Code is ______________________________________.
+
+     The Initial Developer of the Original Code is ________________________.
+     Portions created by ______________________ are Copyright (C) ______
+     _______________________. All Rights Reserved.
+
+     Contributor(s): ______________________________________.
+
+     Alternatively, the contents of this file may be used under the terms
+     of the _____ license (the  &quot;[___] License&quot;), in which case the
+     provisions of [______] License are applicable instead of those
+     above.  If you wish to allow use of your version of this file only
+     under the terms of the [____] License and not to allow others to use
+     your version of this file under the MPL, indicate your decision by
+     deleting  the provisions above and replace  them with the notice and
+     other provisions required by the [___] License.  If you do not delete
+     the provisions above, a recipient may use your version of this file
+     under either the MPL or the [___] License.&quot;
+
+     [NOTE: The text of this Exhibit A may differ slightly from the text of
+     the notices in the Source Code files of the Original Code. You should
+     use the text of this Exhibit A rather than the text found in the
+     Original Code Source Code for Your Modifications.]
+
+
</ins></span></pre></div>
<a id="freeswitchtrunkcontribnazimxmlcdrdChangeLog"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/contrib/nazim/xmlcdrd/ChangeLog ( => )</h4>
<pre class="diff"><span>
<span class="info">
Added: freeswitch/trunk/contrib/nazim/xmlcdrd/INSTALL
</span><span class="cx">===================================================================
</span></span></pre></div>
<a id="freeswitchtrunkcontribnazimxmlcdrdMakefileam"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/contrib/nazim/xmlcdrd/Makefile.am (0 => 16974)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/nazim/xmlcdrd/Makefile.am                                (rev 0)
+++ freeswitch/trunk/contrib/nazim/xmlcdrd/Makefile.am        2010-03-12 16:48:13 UTC (rev 16974)
</span><span class="lines">@@ -0,0 +1,79 @@
</span><ins>+SHELL = /bin/sh
+VPATH = @srcdir@
+
+confdir = &quot;/etc/xmlcdrd&quot;
+subdirs = @subdirs@
+top_srcdir = @top_srcdir@
+srcdir = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+bindir = $(exec_prefix)/bin
+infodir = $(prefix)/info
+libdir = $(prefix)/lib
+includedir = $(prefix)/include
+mandir = $(prefix)/man/man1
+snapshot = $(srcdir)/../`date +xmlcdr_%Y%m%d_%H%M`
+
+CC = @CC@
+CPPFLAGS = @CPPFLAGS@
+CFLAGS = $(CPPFLAGS) -fPIC -Wall @CFLAGS@
+LDFLAGS = @LDFLAGS@
+LIBS = @LIBS@
+INCS = @INCS@
+INSTALL = @INSTALL@
+
+all:
+        $(CC) $(CFLAGS) @with_glib2_flags@ -c stmtexpldr.c
+        $(CC) $(CFLAGS) @with_glib2_flags@ -lconfig -c stmtexp.c
+        $(CC) $(CFLAGS) @with_glib2_flags@ -c plug.c
+        $(CC) $(CFLAGS) @with_glib2_flags@ -c plugldr.c
+        $(CC) $(CFLAGS) -c log.c
+        $(CC) $(CFLAGS) `@with_apreq2_config@ --libs --includes` \
+`@with_apr_config@ --libs --includes  --cppflags` @with_glib2_flags@ -c urldecode.c
+
+if BUILDMYSQLCDR
+        $(MAKE) -C plugins/mysqlcdr
+endif
+        
+if BUILDLUAEXEC
+        $(MAKE) -C plugins/luaexec
+endif
+
+        $(CC) $(CFLAGS) \
+ `@with_apreq2_config@  --libs --includes` \
+ `@with_apr_config@ --libs --includes  --cppflags --link-ld ` \
+  @with_glib2_flags@ -lglib-2.0 \
+ `@with_xml2_config@ --cflags --libs` \
+  $(LIBS) \
+ stmtexpldr.o stmtexp.o log.o urldecode.o \
+ plugldr.o plug.o \
+-o xmlcdr.fcgi main.c
+
+
+snapshot:
+        -tar --exclude-vcs -zcf $(snapshot).tgz -R $(srcdir) ; fi 
+
+install:
+        -cp xmlcdr.fcgi $(bindir)/
+        -if [ ! -d $(confdir) ]; then mkdir $(confdir); fi
+        -cp conf/* $(confdir)/
+
+if BUILDMYSQLCDR
+        $(MAKE) -C plugins/mysqlcdr install
+endif
+
+if BUILDLUAEXEC
+        $(MAKE) -C plugins/luaexec install
+endif
+
+
+clean:
+        -rm -f *.o xmlcdr.fcgi
+
+if BUILDMYSQLCDR
+        $(MAKE) -C plugins/mysqlcdr clean
+endif
+
+if BUILDLUAEXEC
+        $(MAKE) -C plugins/luaexec clean
+endif
</ins></span></pre></div>
<a id="freeswitchtrunkcontribnazimxmlcdrdNEWS"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/contrib/nazim/xmlcdrd/NEWS ( => )</h4>
<pre class="diff"><span>
<span class="info">
Added: freeswitch/trunk/contrib/nazim/xmlcdrd/README
</span><span class="cx">===================================================================
</span></span></pre></div>
<a id="freeswitchtrunkcontribnazimxmlcdrdbootstrapsh"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/contrib/nazim/xmlcdrd/bootstrap.sh (0 => 16974)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/nazim/xmlcdrd/bootstrap.sh                                (rev 0)
+++ freeswitch/trunk/contrib/nazim/xmlcdrd/bootstrap.sh        2010-03-12 16:48:13 UTC (rev 16974)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+#!/bin/sh
+
+aclocal
+autoconf
+autoheader
+automake
+rm -rf autom4te*.cache
+
</ins><span class="cx">Property changes on: freeswitch/trunk/contrib/nazim/xmlcdrd/bootstrap.sh
</span><span class="cx">___________________________________________________________________
</span><span class="cx">Name: svn:executable
</span><span class="cx">   + *
</span></span></pre></div>
<a id="freeswitchtrunkcontribnazimxmlcdrdconfdb1conf"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/contrib/nazim/xmlcdrd/conf/db1.conf (0 => 16974)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/nazim/xmlcdrd/conf/db1.conf                                (rev 0)
+++ freeswitch/trunk/contrib/nazim/xmlcdrd/conf/db1.conf        2010-03-12 16:48:13 UTC (rev 16974)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+dbuserid=&quot;ddp&quot;;
+dbpasswd=&quot;password&quot;;
+dbschema=&quot;ddp&quot;;
+dbipaddr=&quot;localhost&quot;;
+dbipport=3306;
+
+
+stmt_template=&quot;insert into cdr (caller_id_number, effective_caller_id_number, destination_number, billsec) values ('$&lt;caller_id_number&gt;','$&lt;effective_caller_id_number&gt;', '$&lt;destination_number&gt;', $&lt;billsec&gt;)&quot;;
+
+
+
+
</ins></span></pre></div>
<a id="freeswitchtrunkcontribnazimxmlcdrdconflighttpdconfexample"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/contrib/nazim/xmlcdrd/conf/lighttpd.conf.example (0 => 16974)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/nazim/xmlcdrd/conf/lighttpd.conf.example                                (rev 0)
+++ freeswitch/trunk/contrib/nazim/xmlcdrd/conf/lighttpd.conf.example        2010-03-12 16:48:13 UTC (rev 16974)
</span><span class="lines">@@ -0,0 +1,57 @@
</span><ins>+## bind to port (default: 80)
+server.port               = 8080
+
+
+server.modules              = ( 
+            &quot;mod_access&quot;,
+            &quot;mod_alias&quot;,
+            &quot;mod_accesslog&quot;,
+            &quot;mod_compress&quot;,
+            &quot;mod_fastcgi&quot;
+ )
+
+fastcgi.debug = 1
+server.document-root       = &quot;/home/nazim/www/&quot;
+server.errorlog            = &quot;/home/nazim/var/log/lighttpd/error.log&quot;
+index-file.names           = ( &quot;index.php&quot;, &quot;index.html&quot;,
+                               &quot;index.htm&quot;, &quot;default.htm&quot;,
+                               &quot;index.lighttpd.html&quot; )
+
+accesslog.filename         = &quot;/home/nazim/var/log/lighttpd/access.log&quot;
+
+url.access-deny            = ( &quot;~&quot;, &quot;.inc&quot; )
+static-file.exclude-extensions = ( &quot;.php&quot;, &quot;.pl&quot;, &quot;.fcgi&quot; )

+server.pid-file            = &quot;/home/nazim/var/run/lighttpd.pid&quot;
+dir-listing.encoding        = &quot;utf-8&quot;
+server.dir-listing          = &quot;enable&quot;
+server.username            = &quot;www-data&quot;
+server.groupname           = &quot;www-data&quot;
+compress.cache-dir          = &quot;/home/nazim/var/cache/lighttpd/compress/&quot;
+compress.filetype           = (&quot;text/plain&quot;, &quot;text/html&quot;, &quot;application/x-javascript&quot;, &quot;text/css&quot;)
+
+include_shell &quot;/usr/share/lighttpd/create-mime.assign.pl&quot;
+include_shell &quot;/usr/share/lighttpd/include-conf-enabled.pl&quot;
+
+$HTTP[&quot;remoteip&quot;] == &quot;127.0.0.1&quot; {
+        alias.url += (
+                &quot;/doc/&quot; =&gt; &quot;/usr/share/doc/&quot;,
+                &quot;/images/&quot; =&gt; &quot;/usr/share/images/&quot;
+        )
+        $HTTP[&quot;url&quot;] =~ &quot;^/doc/|^/images/&quot; {
+                dir-listing.activate = &quot;enable&quot;
+        }
+}
+
+fastcgi.server = (
+ &quot;xmlcdr.fcgi&quot; =&gt;
+    ( &quot;localhost&quot; =&gt;
+        (
+          &quot;socket&quot;   =&gt; &quot;/home/nazim/tmp/lighttpd-cdr-fcgi.socket&quot;,
+          &quot;max-procs&quot; =&gt; 5,
+          &quot;bin-path&quot; =&gt; &quot;/home/nazim/prj/buta/xmlcdr/trunk/xmlcdr.fcgi&quot;,
+          &quot;check-local&quot; =&gt; &quot;disable&quot;
+        )
+    )
+  )
+
</ins></span></pre></div>
<a id="freeswitchtrunkcontribnazimxmlcdrdconfluaexecconfdist"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/contrib/nazim/xmlcdrd/conf/luaexec.conf.dist (0 => 16974)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/nazim/xmlcdrd/conf/luaexec.conf.dist                                (rev 0)
+++ freeswitch/trunk/contrib/nazim/xmlcdrd/conf/luaexec.conf.dist        2010-03-12 16:48:13 UTC (rev 16974)
</span><span class="lines">@@ -0,0 +1,2 @@
</span><ins>+luascript = &quot;/etc/xmlcdrd/test.lua&quot;;
+
</ins></span></pre></div>
<a id="freeswitchtrunkcontribnazimxmlcdrdconftestlua"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/contrib/nazim/xmlcdrd/conf/test.lua (0 => 16974)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/nazim/xmlcdrd/conf/test.lua                                (rev 0)
+++ freeswitch/trunk/contrib/nazim/xmlcdrd/conf/test.lua        2010-03-12 16:48:13 UTC (rev 16974)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+--print(xcdr_varget(&quot;uuid&quot;), xcdr_varget(&quot;billsec&quot;), xcdr_varget(&quot;uuid&quot;) )
+
+uuid = xcdr_varget(&quot;uuid&quot;)
+billsec = xcdr_varget(&quot;billsec&quot;)
+
+
+require &quot;luasql.odbc&quot;
+env = assert(luasql.odbc())
+db_conn = assert(env:connect(&quot;ddp&quot;) )
+db_conn:execute(string.format(&quot;insert into cdr (uuid,billsec) values ('%s', %d)&quot;, uuid, billsec))
+
+db_conn:close()
+env:close()
+
+--local file = assert(io.open(&quot;output.lua&quot;, &quot;w&quot;))
+--file:write(&quot;Hello world\n&quot;)
+--file:close()
+
</ins></span></pre></div>
<a id="freeswitchtrunkcontribnazimxmlcdrdconfxmlcdrconfdist"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/contrib/nazim/xmlcdrd/conf/xmlcdr.conf.dist (0 => 16974)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/nazim/xmlcdrd/conf/xmlcdr.conf.dist                                (rev 0)
+++ freeswitch/trunk/contrib/nazim/xmlcdrd/conf/xmlcdr.conf.dist        2010-03-12 16:48:13 UTC (rev 16974)
</span><span class="lines">@@ -0,0 +1,115 @@
</span><ins>+#Copy this file to /etc/xmlcdrd/xmlcdr.conf
+
+#Variables section
+Variables = (
+
+{
+name = &quot;uuid&quot;;
+var_id = &quot;uuid&quot;;
+xpath = &quot;/cdr/callflow[@profile_index='1']/caller_profile/uuid&quot;;
+}
+,
+{
+name = &quot;context&quot;;
+var_id = &quot;context&quot;;
+xpath = &quot;/cdr/callflow[@profile_index='1']/caller_profile/context&quot;;
+}
+,
+{
+name = &quot;effective_caller_id_number&quot;;
+var_id = &quot;effective_caller_id_number&quot;;
+xpath = &quot;/cdr/variables/effective_caller_id_number&quot;;
+}
+,
+{
+name = &quot;caller_id_number&quot;;
+var_id = &quot;caller_id_number&quot;;
+xpath = &quot;/cdr/callflow[@profile_index='1']/caller_profile/caller_id_number&quot;;
+}
+,
+{
+name = &quot;destination_number&quot;;
+var_id = &quot;destination_number&quot;;
+xpath = &quot;/cdr/callflow[@profile_index='1']/caller_profile/destination_number&quot;;
+}
+,
+{
+name = &quot;profile_destination_number&quot;;
+var_id = &quot;profile_destination_number&quot;;
+xpath = &quot;/cdr/callflow[@profile_index='1']/caller_profile/originatee/originatee_caller_profile/destination_number&quot;;
+}
+,
+{
+name = &quot;callgroup&quot;;
+var_id = &quot;callgroup&quot;;
+xpath = &quot;/cdr/variables/planeta_callgroup&quot;;
+}
+,
+{
+name = &quot;billsec&quot;;
+var_id = &quot;billsec&quot;;
+xpath = &quot;/cdr/variables/billsec&quot;;
+}
+,
+{
+name = &quot;startep&quot;;
+var_id = &quot;startep&quot;;
+xpath = &quot;/cdr/variables/start_epoch&quot;;
+}
+,
+{
+name = &quot;answep&quot;;
+var_id = &quot;answep&quot;;
+xpath = &quot;/cdr/variables/answer_epoch&quot;;
+}
+,
+{
+name = &quot;endep&quot;;
+var_id = &quot;endep&quot;;
+xpath = &quot;/cdr/variables/end_epoch&quot;;
+}
+
+);
+#End of Variables
+
+
+#Plugins directory
+plugin_dir = &quot;/usr/local/lib/xmlcdrd&quot;;
+
+
+
+#Plugins section
+Plugins = (
+
+#Plugin declaration
+{
+  #name is a name of so file without the extension
+  name=&quot;mysqlcdr&quot;;
+
+  #config file for plugin
+  options = &quot;/etc/xmlcdrd/db1.conf&quot;;
+  priority = 10;
+
+  #Metrics control plugin execution
+  #Plugin with no metrics defined will be executed everytime
+  Metrics = (
+        {
+       metric = &quot;destination_number&quot;;
+       regexp = &quot;^6969.*&quot;;
+        }
+  );
+  #end of metrics
+
+},
+{
+  name=&quot;luaexec&quot;;
+  options=&quot;/etc/xmlcdrd/luaexec.conf&quot;;
+  priority=20;
+}
+
+#End of plugin declaration
+#You could define multiple plugins
+#Plugin declarations are separated with comma. See libconfig manual for details.
+
+);
+#End of Plugin section
</ins></span></pre></div>
<a id="freeswitchtrunkcontribnazimxmlcdrdconfigureac"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/contrib/nazim/xmlcdrd/configure.ac (0 => 16974)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/nazim/xmlcdrd/configure.ac                                (rev 0)
+++ freeswitch/trunk/contrib/nazim/xmlcdrd/configure.ac        2010-03-12 16:48:13 UTC (rev 16974)
</span><span class="lines">@@ -0,0 +1,109 @@
</span><ins>+#                                               -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+AC_PREREQ([2.6])
+AC_INIT([xmlcdrd], [0.1], [xmlcdr@buta-tech.com])
+AM_INIT_AUTOMAKE
+AC_CONFIG_SRCDIR([urldecode.c])
+AC_CONFIG_HEADERS([config.h])
+
+# Checks for programs.
+AC_PROG_CC
+AC_PROG_INSTALL
+
+# Checks for libraries.
+
+AC_CHECK_LIB([apreq2], [main])
+
+AC_CHECK_LIB([apr-1], [main])
+
+AC_CHECK_LIB([config], [main])
+
+AC_CHECK_LIB([dl], [main])
+
+AC_CHECK_LIB([fcgi], [main])
+
+AC_CHECK_LIB([pcre], [main])
+
+AC_CHECK_LIB([glib-2.0], [main])
+
+AC_CHECK_LIB([xml2], [main])
+
+# Checks for header files.
+AC_CHECK_HEADERS([malloc.h stdlib.h string.h syslog.h])
+
+#check for library config scripts
+AC_MSG_CHECKING(for apreq2config)
+AC_ARG_WITH(apreq2_config,
+    AC_HELP_STRING([--with-apreq2-config@&lt;:@=PATH@:&gt;@],[Location of apreq2 configuration script.]),
+    [with_apreq2_config=&quot;$withval&quot;],[with_apreq2_config=&quot;apreq2-config&quot;])
+AC_SUBST(with_apreq2_config)
+
+AC_MSG_CHECKING(for aprconfig)
+AC_ARG_WITH(apr_config,
+    AC_HELP_STRING([--with-apr-config@&lt;:@=PATH@:&gt;@],[Location of apr configuration script.]),
+    [with_apr_config=&quot;$withval&quot;],[with_apr_config=&quot;apr-1-config&quot;])
+AC_SUBST(with_apr_config)
+
+AC_MSG_CHECKING(for mysqlconfig)
+AC_ARG_WITH(mysql_config,
+    AC_HELP_STRING([--with-mysql-config@&lt;:@=PATH@:&gt;@],[Location of mysql configuration script.]),
+    [with_mysql_config=&quot;$withval&quot;],[with_mysql_config=&quot;mysql_config&quot;])
+AC_SUBST(with_mysql_config)
+
+AC_MSG_CHECKING(for xml2config)
+AC_ARG_WITH(xml2_config,
+    AC_HELP_STRING([--with-xml2-config@&lt;:@=PATH@:&gt;@],[Location of libxml2 configuration script.]),
+    [with_xml2_config==&quot;$withval&quot;],[with_xml2_config=&quot;xml2-config&quot;])
+AC_SUBST(with_xml2_config)
+
+AC_MSG_CHECKING(for glib2 flags)
+AC_ARG_WITH(glib2_flags,
+    AC_HELP_STRING([--with-glib2-flags],[glib2 CFLAGS.]),
+    [with_glib2_flags=&quot;$withval&quot;],[with_glib2_flags=&quot;-I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include&quot;])
+AC_SUBST(with_glib2_flags)
+
+
+#Plugins to build
+
+#mysqlcdr
+domysqlcdr=yes
+
+AC_ARG_ENABLE(mysqlcdr,
+AS_HELP_STRING([--disable-mysqlcdr], [Disable building of mysqlcdr plugin]),
+[if test &quot;$enableval&quot; = &quot;no&quot;; then domysqlcdr=&quot;no&quot;; fi],
+[
+domysqlcdr=yes
+]
+)
+
+AM_CONDITIONAL(BUILDMYSQLCDR, test x$domysqlcdr = xyes)
+
+
+#luaexec
+doluaexec=yes
+
+AC_ARG_ENABLE(luaexec,
+AS_HELP_STRING([--disable-luaexec], [Disable building of luaexec plugin]),
+[if test &quot;$enableval&quot; = &quot;no&quot;; then doluaexec=&quot;no&quot;; fi],
+[
+doluaexec=yes
+]
+)
+
+AM_CONDITIONAL(BUILDLUAEXEC, test x$doluaexec = xyes)
+
+
+
+# Checks for typedefs, structures, and compiler characteristics.
+
+# Checks for library functions.
+AC_FUNC_MALLOC
+AC_FUNC_REALLOC
+AC_CHECK_FUNCS([memset strchr strdup strstr])
+
+AC_CONFIG_FILES([Makefile
+                 plugins/mysqlcdr/Makefile
+                 plugins/luaexec/Makefile])
+AC_OUTPUT
+
</ins></span></pre></div>
<a id="freeswitchtrunkcontribnazimxmlcdrdinstallsh"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/contrib/nazim/xmlcdrd/install-sh (0 => 16974)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/nazim/xmlcdrd/install-sh                                (rev 0)
+++ freeswitch/trunk/contrib/nazim/xmlcdrd/install-sh        2010-03-12 16:48:13 UTC (rev 16974)
</span><span class="lines">@@ -0,0 +1,520 @@
</span><ins>+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2009-04-28.21; # UTC
+
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the &quot;Software&quot;), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.
+
+nl='
+'
+IFS=&quot; &quot;&quot;        $nl&quot;
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit=${DOITPROG-}
+if test -z &quot;$doit&quot;; then
+  doit_exec=exec
+else
+  doit_exec=$doit
+fi
+
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_glob='?'
+initialize_posix_glob='
+  test &quot;$posix_glob&quot; != &quot;?&quot; || {
+    if (set -f) 2&gt;/dev/null; then
+      posix_glob=
+    else
+      posix_glob=:
+    fi
+  }
+'
+
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chgrpcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
+rmcmd=&quot;$rmprog -f&quot;
+stripcmd=
+
+src=
+dst=
+dir_arg=
+dst_arg=
+
+copy_on_change=false
+no_target_directory=
+
+usage=&quot;\
+Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+   or: $0 [OPTION]... SRCFILES... DIRECTORY
+   or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+   or: $0 [OPTION]... -d DIRECTORIES...
+
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+In the 4th, create DIRECTORIES.
+
+Options:
+     --help     display this help and exit.
+     --version  display version info and exit.
+
+  -c            (ignored)
+  -C            install only if different (preserve the last data modification time)
+  -d            create directories instead of installing files.
+  -g GROUP      $chgrpprog installed files to GROUP.
+  -m MODE       $chmodprog installed files to MODE.
+  -o USER       $chownprog installed files to USER.
+  -s            $stripprog installed files.
+  -t DIRECTORY  install into DIRECTORY.
+  -T            report an error if DSTFILE is a directory.
+
+Environment variables override the default commands:
+  CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+  RMPROG STRIPPROG
+&quot;
+
+while test $# -ne 0; do
+  case $1 in
+    -c) ;;
+
+    -C) copy_on_change=true;;
+
+    -d) dir_arg=true;;
+
+    -g) chgrpcmd=&quot;$chgrpprog $2&quot;
+        shift;;
+
+    --help) echo &quot;$usage&quot;; exit $?;;
+
+    -m) mode=$2
+        case $mode in
+          *' '* | *'        '* | *'
+'*          | *'*'* | *'?'* | *'['*)
+            echo &quot;$0: invalid mode: $mode&quot; &gt;&amp;2
+            exit 1;;
+        esac
+        shift;;
+
+    -o) chowncmd=&quot;$chownprog $2&quot;
+        shift;;
+
+    -s) stripcmd=$stripprog;;
+
+    -t) dst_arg=$2
+        shift;;
+
+    -T) no_target_directory=true;;
+
+    --version) echo &quot;$0 $scriptversion&quot;; exit $?;;
+
+    --)        shift
+        break;;
+
+    -*)        echo &quot;$0: invalid option: $1&quot; &gt;&amp;2
+        exit 1;;
+
+    *)  break;;
+  esac
+  shift
+done
+
+if test $# -ne 0 &amp;&amp; test -z &quot;$dir_arg$dst_arg&quot;; then
+  # When -d is used, all remaining arguments are directories to create.
+  # When -t is used, the destination is already specified.
+  # Otherwise, the last argument is the destination.  Remove it from $@.
+  for arg
+  do
+    if test -n &quot;$dst_arg&quot;; then
+      # $@ is not empty: it contains at least $arg.
+      set fnord &quot;$@&quot; &quot;$dst_arg&quot;
+      shift # fnord
+    fi
+    shift # arg
+    dst_arg=$arg
+  done
+fi
+
+if test $# -eq 0; then
+  if test -z &quot;$dir_arg&quot;; then
+    echo &quot;$0: no input file specified.&quot; &gt;&amp;2
+    exit 1
+  fi
+  # It's OK to call `install-sh -d' without argument.
+  # This can happen when creating conditional directories.
+  exit 0
+fi
+
+if test -z &quot;$dir_arg&quot;; then
+  trap '(exit $?); exit' 1 2 13 15
+
+  # Set umask so as not to create temps with too-generous modes.
+  # However, 'strip' requires both read and write access to temps.
+  case $mode in
+    # Optimize common cases.
+    *644) cp_umask=133;;
+    *755) cp_umask=22;;
+
+    *[0-7])
+      if test -z &quot;$stripcmd&quot;; then
+        u_plus_rw=
+      else
+        u_plus_rw='% 200'
+      fi
+      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+    *)
+      if test -z &quot;$stripcmd&quot;; then
+        u_plus_rw=
+      else
+        u_plus_rw=,u+rw
+      fi
+      cp_umask=$mode$u_plus_rw;;
+  esac
+fi
+
+for src
+do
+  # Protect names starting with `-'.
+  case $src in
+    -*) src=./$src;;
+  esac
+
+  if test -n &quot;$dir_arg&quot;; then
+    dst=$src
+    dstdir=$dst
+    test -d &quot;$dstdir&quot;
+    dstdir_status=$?
+  else
+
+    # Waiting for this to be detected by the &quot;$cpprog $src $dsttmp&quot; command
+    # might cause directories to be created, which would be especially bad
+    # if $src (and thus $dsttmp) contains '*'.
+    if test ! -f &quot;$src&quot; &amp;&amp; test ! -d &quot;$src&quot;; then
+      echo &quot;$0: $src does not exist.&quot; &gt;&amp;2
+      exit 1
+    fi
+
+    if test -z &quot;$dst_arg&quot;; then
+      echo &quot;$0: no destination specified.&quot; &gt;&amp;2
+      exit 1
+    fi
+
+    dst=$dst_arg
+    # Protect names starting with `-'.
+    case $dst in
+      -*) dst=./$dst;;
+    esac
+
+    # If destination is a directory, append the input filename; won't work
+    # if double slashes aren't ignored.
+    if test -d &quot;$dst&quot;; then
+      if test -n &quot;$no_target_directory&quot;; then
+        echo &quot;$0: $dst_arg: Is a directory&quot; &gt;&amp;2
+        exit 1
+      fi
+      dstdir=$dst
+      dst=$dstdir/`basename &quot;$src&quot;`
+      dstdir_status=0
+    else
+      # Prefer dirname, but fall back on a substitute if dirname fails.
+      dstdir=`
+        (dirname &quot;$dst&quot;) 2&gt;/dev/null ||
+        expr X&quot;$dst&quot; : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+             X&quot;$dst&quot; : 'X\(//\)[^/]' \| \
+             X&quot;$dst&quot; : 'X\(//\)$' \| \
+             X&quot;$dst&quot; : 'X\(/\)' \| . 2&gt;/dev/null ||
+        echo X&quot;$dst&quot; |
+            sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+                   s//\1/
+                   q
+                 }
+                 /^X\(\/\/\)[^/].*/{
+                   s//\1/
+                   q
+                 }
+                 /^X\(\/\/\)$/{
+                   s//\1/
+                   q
+                 }
+                 /^X\(\/\).*/{
+                   s//\1/
+                   q
+                 }
+                 s/.*/./; q'
+      `
+
+      test -d &quot;$dstdir&quot;
+      dstdir_status=$?
+    fi
+  fi
+
+  obsolete_mkdir_used=false
+
+  if test $dstdir_status != 0; then
+    case $posix_mkdir in
+      '')
+        # Create intermediate dirs using mode 755 as modified by the umask.
+        # This is like FreeBSD 'install' as of 1997-10-28.
+        umask=`umask`
+        case $stripcmd.$umask in
+          # Optimize common cases.
+          *[2367][2367]) mkdir_umask=$umask;;
+          .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+          *[0-7])
+            mkdir_umask=`expr $umask + 22 \
+              - $umask % 100 % 40 + $umask % 20 \
+              - $umask % 10 % 4 + $umask % 2
+            `;;
+          *) mkdir_umask=$umask,go-w;;
+        esac
+
+        # With -d, create the new directory with the user-specified mode.
+        # Otherwise, rely on $mkdir_umask.
+        if test -n &quot;$dir_arg&quot;; then
+          mkdir_mode=-m$mode
+        else
+          mkdir_mode=
+        fi
+
+        posix_mkdir=false
+        case $umask in
+          *[123567][0-7][0-7])
+            # POSIX mkdir -p sets u+wx bits regardless of umask, which
+            # is incompatible with FreeBSD 'install' when (umask &amp; 300) != 0.
+            ;;
+          *)
+            tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+            trap 'ret=$?; rmdir &quot;$tmpdir/d&quot; &quot;$tmpdir&quot; 2&gt;/dev/null; exit $ret' 0
+
+            if (umask $mkdir_umask &amp;&amp;
+                exec $mkdirprog $mkdir_mode -p -- &quot;$tmpdir/d&quot;) &gt;/dev/null 2&gt;&amp;1
+            then
+              if test -z &quot;$dir_arg&quot; || {
+                   # Check for POSIX incompatibilities with -m.
+                   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+                   # other-writeable bit of parent directory when it shouldn't.
+                   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+                   ls_ld_tmpdir=`ls -ld &quot;$tmpdir&quot;`
+                   case $ls_ld_tmpdir in
+                     d????-?r-*) different_mode=700;;
+                     d????-?--*) different_mode=755;;
+                     *) false;;
+                   esac &amp;&amp;
+                   $mkdirprog -m$different_mode -p -- &quot;$tmpdir&quot; &amp;&amp; {
+                     ls_ld_tmpdir_1=`ls -ld &quot;$tmpdir&quot;`
+                     test &quot;$ls_ld_tmpdir&quot; = &quot;$ls_ld_tmpdir_1&quot;
+                   }
+                 }
+              then posix_mkdir=:
+              fi
+              rmdir &quot;$tmpdir/d&quot; &quot;$tmpdir&quot;
+            else
+              # Remove any dirs left behind by ancient mkdir implementations.
+              rmdir ./$mkdir_mode ./-p ./-- 2&gt;/dev/null
+            fi
+            trap '' 0;;
+        esac;;
+    esac
+
+    if
+      $posix_mkdir &amp;&amp; (
+        umask $mkdir_umask &amp;&amp;
+        $doit_exec $mkdirprog $mkdir_mode -p -- &quot;$dstdir&quot;
+      )
+    then :
+    else
+
+      # The umask is ridiculous, or mkdir does not conform to POSIX,
+      # or it failed possibly due to a race condition.  Create the
+      # directory the slow way, step by step, checking for races as we go.
+
+      case $dstdir in
+        /*) prefix='/';;
+        -*) prefix='./';;
+        *)  prefix='';;
+      esac
+
+      eval &quot;$initialize_posix_glob&quot;
+
+      oIFS=$IFS
+      IFS=/
+      $posix_glob set -f
+      set fnord $dstdir
+      shift
+      $posix_glob set +f
+      IFS=$oIFS
+
+      prefixes=
+
+      for d
+      do
+        test -z &quot;$d&quot; &amp;&amp; continue
+
+        prefix=$prefix$d
+        if test -d &quot;$prefix&quot;; then
+          prefixes=
+        else
+          if $posix_mkdir; then
+            (umask=$mkdir_umask &amp;&amp;
+             $doit_exec $mkdirprog $mkdir_mode -p -- &quot;$dstdir&quot;) &amp;&amp; break
+            # Don't fail if two instances are running concurrently.
+            test -d &quot;$prefix&quot; || exit 1
+          else
+            case $prefix in
+              *\'*) qprefix=`echo &quot;$prefix&quot; | sed &quot;s/'/'\\\\\\\\''/g&quot;`;;
+              *) qprefix=$prefix;;
+            esac
+            prefixes=&quot;$prefixes '$qprefix'&quot;
+          fi
+        fi
+        prefix=$prefix/
+      done
+
+      if test -n &quot;$prefixes&quot;; then
+        # Don't fail if two instances are running concurrently.
+        (umask $mkdir_umask &amp;&amp;
+         eval &quot;\$doit_exec \$mkdirprog $prefixes&quot;) ||
+          test -d &quot;$dstdir&quot; || exit 1
+        obsolete_mkdir_used=true
+      fi
+    fi
+  fi
+
+  if test -n &quot;$dir_arg&quot;; then
+    { test -z &quot;$chowncmd&quot; || $doit $chowncmd &quot;$dst&quot;; } &amp;&amp;
+    { test -z &quot;$chgrpcmd&quot; || $doit $chgrpcmd &quot;$dst&quot;; } &amp;&amp;
+    { test &quot;$obsolete_mkdir_used$chowncmd$chgrpcmd&quot; = false ||
+      test -z &quot;$chmodcmd&quot; || $doit $chmodcmd $mode &quot;$dst&quot;; } || exit 1
+  else
+
+    # Make a couple of temp file names in the proper directory.
+    dsttmp=$dstdir/_inst.$$_
+    rmtmp=$dstdir/_rm.$$_
+
+    # Trap to clean up those temp files at exit.
+    trap 'ret=$?; rm -f &quot;$dsttmp&quot; &quot;$rmtmp&quot; &amp;&amp; exit $ret' 0
+
+    # Copy the file name to the temp name.
+    (umask $cp_umask &amp;&amp; $doit_exec $cpprog &quot;$src&quot; &quot;$dsttmp&quot;) &amp;&amp;
+
+    # and set any options; do chmod last to preserve setuid bits.
+    #
+    # If any of these fail, we abort the whole thing.  If we want to
+    # ignore errors from any of these, just make sure not to ignore
+    # errors from the above &quot;$doit $cpprog $src $dsttmp&quot; command.
+    #
+    { test -z &quot;$chowncmd&quot; || $doit $chowncmd &quot;$dsttmp&quot;; } &amp;&amp;
+    { test -z &quot;$chgrpcmd&quot; || $doit $chgrpcmd &quot;$dsttmp&quot;; } &amp;&amp;
+    { test -z &quot;$stripcmd&quot; || $doit $stripcmd &quot;$dsttmp&quot;; } &amp;&amp;
+    { test -z &quot;$chmodcmd&quot; || $doit $chmodcmd $mode &quot;$dsttmp&quot;; } &amp;&amp;
+
+    # If -C, don't bother to copy if it wouldn't change the file.
+    if $copy_on_change &amp;&amp;
+       old=`LC_ALL=C ls -dlL &quot;$dst&quot;        2&gt;/dev/null` &amp;&amp;
+       new=`LC_ALL=C ls -dlL &quot;$dsttmp&quot;        2&gt;/dev/null` &amp;&amp;
+
+       eval &quot;$initialize_posix_glob&quot; &amp;&amp;
+       $posix_glob set -f &amp;&amp;
+       set X $old &amp;&amp; old=:$2:$4:$5:$6 &amp;&amp;
+       set X $new &amp;&amp; new=:$2:$4:$5:$6 &amp;&amp;
+       $posix_glob set +f &amp;&amp;
+
+       test &quot;$old&quot; = &quot;$new&quot; &amp;&amp;
+       $cmpprog &quot;$dst&quot; &quot;$dsttmp&quot; &gt;/dev/null 2&gt;&amp;1
+    then
+      rm -f &quot;$dsttmp&quot;
+    else
+      # Rename the file to the real destination.
+      $doit $mvcmd -f &quot;$dsttmp&quot; &quot;$dst&quot; 2&gt;/dev/null ||
+
+      # The rename failed, perhaps because mv can't rename something else
+      # to itself, or perhaps because mv is so ancient that it does not
+      # support -f.
+      {
+        # Now remove or move aside any old file at destination location.
+        # We try this two ways since rm can't unlink itself on some
+        # systems and the destination file might be busy for other
+        # reasons.  In this case, the final cleanup might fail but the new
+        # file should still install successfully.
+        {
+          test ! -f &quot;$dst&quot; ||
+          $doit $rmcmd -f &quot;$dst&quot; 2&gt;/dev/null ||
+          { $doit $mvcmd -f &quot;$dst&quot; &quot;$rmtmp&quot; 2&gt;/dev/null &amp;&amp;
+            { $doit $rmcmd -f &quot;$rmtmp&quot; 2&gt;/dev/null; :; }
+          } ||
+          { echo &quot;$0: cannot unlink or rename $dst&quot; &gt;&amp;2
+            (exit 1); exit 1
+          }
+        } &amp;&amp;
+
+        # Now rename the file to the real destination.
+        $doit $mvcmd &quot;$dsttmp&quot; &quot;$dst&quot;
+      }
+    fi || exit 1
+
+    trap '' 0
+  fi
+done
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: &quot;scriptversion=&quot;
+# time-stamp-format: &quot;%:y-%02m-%02d.%02H&quot;
+# time-stamp-time-zone: &quot;UTC&quot;
+# time-stamp-end: &quot;; # UTC&quot;
+# End:
</ins><span class="cx">Property changes on: freeswitch/trunk/contrib/nazim/xmlcdrd/install-sh
</span><span class="cx">___________________________________________________________________
</span><span class="cx">Name: svn:executable
</span><span class="cx">   + *
</span></span></pre></div>
<a id="freeswitchtrunkcontribnazimxmlcdrdlogc"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/contrib/nazim/xmlcdrd/log.c (0 => 16974)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/nazim/xmlcdrd/log.c                                (rev 0)
+++ freeswitch/trunk/contrib/nazim/xmlcdrd/log.c        2010-03-12 16:48:13 UTC (rev 16974)
</span><span class="lines">@@ -0,0 +1,55 @@
</span><ins>+#include &quot;log.h&quot;
+#include &lt;syslog.h&gt;
+#include &lt;errno.h&gt;
+#include &lt;string.h&gt;
+#include &lt;stdio.h&gt;
+#include &lt;stdlib.h&gt;
+#include &lt;stdarg.h&gt;
+
+void syslog_open (const char *ident, int facility) {
+        openlog(ident, LOG_PID, facility);
+        return;
+}
+
+void syslog_close () {
+        closelog ();
+        return;
+}
+
+void syslog_error (const char *message) {
+        syslog (LOG_ALERT, &quot;error. %s&quot;, message);
+}
+
+void syslog_msg (int priority, int echotoconsole, const char *fmt, ...) {
+        int n, size;
+        char *p;
+        va_list ap;
+        
+        size = 100;
+        if (NULL == (p = malloc (size))) {
+                fprintf (stderr, &quot;syslog_msg failed. malloc error %s:%d\r\n&quot;, __FILE__, __LINE__);
+                return;
+        }
+
+        while (1) {
+                va_start(ap, fmt);
+                n = vsnprintf (p, size, fmt, ap);
+                va_end(ap);
+
+                if (n &gt; -1 &amp;&amp; n &lt; size) {
+                        syslog (priority, &quot;%s&quot;, p);
+                        if (echotoconsole) fprintf (stderr, &quot;%s\r\n&quot;, p);
+                        free (p);
+                        return;
+                }
+      
+                if (n &gt; -1) size = n+1;
+                else size *= 2;
+                
+                if ((p = realloc (p, size)) == NULL) {
+                        fprintf (stderr, &quot;syslog_msg failed. realloc error %s:%d\r\n&quot;, __FILE__, __LINE__);
+                        return;
+                }
+           }
+}
+
</ins></span></pre></div>
<a id="freeswitchtrunkcontribnazimxmlcdrdlogh"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/contrib/nazim/xmlcdrd/log.h (0 => 16974)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/nazim/xmlcdrd/log.h                                (rev 0)
+++ freeswitch/trunk/contrib/nazim/xmlcdrd/log.h        2010-03-12 16:48:13 UTC (rev 16974)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+#ifndef LOG_H
+#define LOG_H
+
+#include &lt;stdlib.h&gt;
+
+void syslog_open (const char *ident, int facility);
+void syslog_close (void);
+
+void syslog_msg (int priority, int echotoconsole, const char *fmt, ...);
+void syslog_error (const char *message);
+
+#endif
+
</ins></span></pre></div>
<a id="freeswitchtrunkcontribnazimxmlcdrdmainc"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/contrib/nazim/xmlcdrd/main.c (0 => 16974)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/nazim/xmlcdrd/main.c                                (rev 0)
+++ freeswitch/trunk/contrib/nazim/xmlcdrd/main.c        2010-03-12 16:48:13 UTC (rev 16974)
</span><span class="lines">@@ -0,0 +1,332 @@
</span><ins>+#include &lt;fcgi_stdio.h&gt; /* fcgi library; put it first*/
+#include &lt;string.h&gt;
+#include &lt;stdio.h&gt;
+#include &lt;stdlib.h&gt;
+#include &lt;syslog.h&gt;
+#include &lt;libxml/tree.h&gt;
+#include &lt;libxml/parser.h&gt;
+#include &lt;libxml/xpath.h&gt;
+#include &lt;libxml/xpathInternals.h&gt;
+#include &quot;log.h&quot;
+#include &quot;urldecode.h&quot;
+#include &quot;stmtexp.h&quot;
+#include &quot;stmtexpldr.h&quot;
+#include &quot;plugldr.h&quot;
+#include &quot;plug.h&quot;
+
+#define STR_MAX 512
+
+#define CONFIG &quot;/etc/xmlcdrd/xmlcdr.conf&quot;
+#define XURL_CDR &quot;cdr&quot;
+
+
+typedef struct
+{
+    xmlDocPtr doc;
+    xmlXPathContextPtr xpathCtx; 
+} stmtexp_cb_data_t;
+
+
+
+#if defined(LIBXML_XPATH_ENABLED) &amp;&amp; defined(LIBXML_SAX1_ENABLED)
+
+
+stmtexp_tab_t vex;
+
+
+
+void stmtexp_callback (stmtexp_key_t *key, stmtexp_val_t *val, void *userdata);
+void stmtexp_callback_clean (stmtexp_key_t *key, stmtexp_val_t *val, 
+                             void *userdata);
+
+int execute_xpath_expression(const char* buf, int buflen);
+
+
+int execute_xpath_expression(const char* buf, int buflen)
+{
+    xmlDocPtr doc;
+    stmtexp_cb_data_t cbd;
+    memset (&amp;cbd, 0x0, sizeof (stmtexp_cb_data_t));
+
+
+    /* Load XML document */
+    doc = xmlParseMemory (buf, buflen);
+
+    if (doc == NULL)
+    {
+        fprintf(stderr, &quot;Error: unable to parse memory\n&quot;);
+        return(-1);
+    }
+
+    /* Create xpath evaluation context */
+    cbd.xpathCtx = xmlXPathNewContext(doc);
+    if(cbd.xpathCtx == NULL)
+    {
+        fprintf(stderr,&quot;Error: unable to create new XPath context\n&quot;);
+        xmlFreeDoc(doc); 
+        return(-1);
+    }
+
+    /*run callback*/
+    stmtexp_foreach_callback (&amp;vex, stmtexp_callback, &amp;cbd);
+
+    
+    xmlXPathFreeContext(cbd.xpathCtx); 
+    xmlFreeDoc(doc); 
+    
+    return(0);
+}
+
+
+void stmtexp_callback_clean (stmtexp_key_t *key, stmtexp_val_t *val, void *userdata)
+{
+    if (NULL != val)
+    {
+        if (NULL != val-&gt;val)
+        {
+            free (val-&gt;val);
+            val-&gt;val = NULL;
+        }
+    }
+}
+
+
+void stmtexp_callback (stmtexp_key_t *key, stmtexp_val_t *val, void *userdata)
+{
+    xmlXPathObjectPtr xpathObj;
+    xmlNodePtr cur;
+
+    stmtexp_cb_data_t * cbd = (stmtexp_cb_data_t *) userdata;
+    
+
+
+    /* Evaluate xpath expression */
+    xpathObj = xmlXPathEvalExpression((xmlChar*)key-&gt;xpath, cbd-&gt;xpathCtx);
+    if(xpathObj == NULL)
+    {
+        fprintf(stderr,
+                &quot;Error: unable to evaluate xpath expression \&quot;%s\&quot;\n&quot;,
+                key-&gt;xpath);
+        return;
+    }
+
+    /* Print results */
+    xmlNodeSetPtr nodes = xpathObj-&gt;nodesetval;
+    if (NULL != nodes)
+    {
+        if (0 &lt; nodes-&gt;nodeNr)
+        {
+            if (nodes-&gt;nodeTab[0])
+            {
+                if(nodes-&gt;nodeTab[0]-&gt;type == XML_ELEMENT_NODE) 
+                {
+                    cur = nodes-&gt;nodeTab[0];               
+                    if(cur-&gt;ns)
+                    { 
+                        fprintf(stderr, &quot;= element node \&quot;%s:%s\&quot;\n&quot;, 
+                                cur-&gt;ns-&gt;href, cur-&gt;name);
+                    } else
+                    {
+                        fprintf(stderr, &quot;= element node \&quot;%s\&quot;\n&quot;, 
+                                cur-&gt;name);
+                        xmlChar *content = xmlNodeGetContent(cur);
+
+                        if (NULL != val)
+                        {
+                            if (NULL != val-&gt;val)
+                            {
+                                free (val-&gt;val);
+                                val-&gt;val = NULL;
+                            }
+                            val-&gt;val = strdup((const char*)content);
+                
+                            fprintf(stderr, &quot;%s\n&quot;, val-&gt;val);
+                            xmlFree (content);
+                        }
+                    }        
+                }
+            }
+        } else  /* if (0 &lt; nodes-&gt;nodeNr) */
+        {
+            if (NULL != val)
+            {
+                if (NULL != val-&gt;val)
+                {
+                    free (val-&gt;val);
+                    val-&gt;val = NULL;
+                }
+            }
+        
+        }
+    }
+    
+    /* Cleanup */
+    xmlXPathFreeObject(xpathObj);
+
+}
+
+
+
+
+/*
+ * 
+ */
+int main(int argc, char** argv)
+{
+
+
+
+    XCDR_PLUGTAB plugtab;
+
+    if (-1 == xcdr_plugldr_load_config(&amp;plugtab, CONFIG))
+    {
+        fprintf (stderr, &quot;Failed to configure plugins from config: '%s'&quot;, CONFIG);
+        return -1;
+    }
+
+
+    if (-1 == xcdr_plugldr_load_plugins(&amp;plugtab) )
+    {
+        fprintf (stderr, &quot;Failed to load plugins from config: '%s'&quot;, CONFIG);
+        xcdr_plugldr_free_plugins (&amp;plugtab);
+        return -1;
+    }
+
+    if (-1 == stmtexp_load_config (&amp;vex, CONFIG))
+    {
+        fprintf (stderr, &quot;Failed to load vars from config: '%s'&quot;, CONFIG);
+        xcdr_plugldr_free_plugins (&amp;plugtab);
+        stmtexp_free (&amp;vex);
+        return -1;
+    }
+
+
+    /* Init libxml */     
+    xmlInitParser();
+    LIBXML_TEST_VERSION
+
+
+
+
+    GString * cgi_req_str = g_string_sized_new (102400);
+    GString * cgi_decoded_str = g_string_sized_new (102400);
+    GString * temp = g_string_sized_new (102400);
+        
+
+    while (FCGI_Accept() &gt;= 0)
+    {
+        //Set length of received request to 0
+        int cgi_req_len = 0;
+        g_string_set_size (cgi_req_str, 0);
+
+
+        char c;
+        while (EOF != (c = fgetc (stdin)) )
+        {
+            g_string_append_c (cgi_req_str, c);
+            cgi_req_len++;
+        } //~while We have received the full request string
+
+            
+        //fprintf (stderr, &quot;%s\n&quot;, cgi_req_str-&gt;str);
+        stmtexp_foreach_callback (&amp;vex, stmtexp_callback_clean, NULL);
+            
+        int decoded_len = cgi_req_len * 3 + 1;
+        g_string_set_size (cgi_decoded_str, decoded_len);
+        memset (cgi_decoded_str-&gt;str, 0x0, decoded_len);
+
+
+        int status;
+        if (NULL !=  urldecode_expand_value (cgi_req_str,
+                                             XURL_CDR, strlen(XURL_CDR),
+                                             1,
+                                             temp, &amp;status,
+                                             cgi_decoded_str))
+        {
+            execute_xpath_expression(cgi_decoded_str-&gt;str,
+                                     strlen(cgi_decoded_str-&gt;str) );
+
+            /*Dump entire dom tree on stdout*/
+            //fprintf (stderr, &quot;%s\n&quot;, cgi_decoded_str-&gt;str);
+
+
+            int i;
+            XCDR_PLUGINFO *plug;
+            
+            for (i = 0; i &lt; plugtab.tag_count; i ++)
+            {
+                plug = &amp;plugtab.tags[i].plug;
+                
+                //If no metrics defined, run anyway
+                if (0 == plugtab.tags[i].metrics.tag_count)
+                {
+                    plug-&gt;plugin_main(&amp;vex, &amp;plug-&gt;state);
+                    continue;
+                }
+
+                //match metric regexps
+                int j;
+                int run = 0;
+                for (j = 0; j &lt; plugtab.tags[i].metrics.tag_count; j++)
+                {
+                    const char *metric_val = 
+                        stmtexp_lookup_var (&amp;vex,
+                                            plugtab.tags[i].metrics.tags[j].metric);
+
+
+
+                    //if metric is not found, replace with an empty string.
+                    if (NULL == metric_val)
+                    {
+                        metric_val = &quot;&quot;;
+                    }
+
+                    fprintf (stderr, &quot;metric [%s] '%s':'%s'\n&quot;, 
+                             plugtab.tags[i].metrics.tags[j].metric,
+                             plugtab.tags[i].metrics.tags[j].regexp,
+                             metric_val);
+                             
+                             
+
+                    if (-1 &lt; 
+                        xcdr_plugldr_match_regexp (
+                            plugtab.tags[i].metrics.tags[j].regexp,
+                            metric_val, strlen(metric_val)) )
+                        run = 1;
+                    else run = 0;
+                }
+
+                if (0 &lt; run)
+                {
+                    fprintf (stderr, &quot;metrics matched\n&quot;);
+                    plug-&gt;plugin_main(&amp;vex, &amp;plug-&gt;state);
+                }
+            }
+           
+        } else fprintf (stderr, &quot;'%s' not found in '%s'\n&quot;,
+                        XURL_CDR, cgi_req_str-&gt;str);
+            
+
+    }
+        
+    g_string_free (cgi_req_str, TRUE);
+    g_string_free (cgi_decoded_str, TRUE);
+    g_string_free (temp, TRUE);
+        
+    stmtexp_free (&amp;vex);
+    xcdr_plugldr_free_plugins(&amp;plugtab);
+
+    xmlCleanupParser();
+
+
+    return 0;
+}
+
+
+
+#else
+int main(void) {
+    fprintf(stderr, &quot;XPath support not compiled in\n&quot;);
+    exit(1);
+}
+#endif
</ins></span></pre></div>
<a id="freeswitchtrunkcontribnazimxmlcdrdmissing"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/contrib/nazim/xmlcdrd/missing (0 => 16974)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/nazim/xmlcdrd/missing                                (rev 0)
+++ freeswitch/trunk/contrib/nazim/xmlcdrd/missing        2010-03-12 16:48:13 UTC (rev 16974)
</span><span class="lines">@@ -0,0 +1,376 @@
</span><ins>+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+
+scriptversion=2009-04-28.21; # UTC
+
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
+# 2008, 2009 Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard &lt;pinard@iro.umontreal.ca&gt;, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see &lt;http://www.gnu.org/licenses/&gt;.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+if test $# -eq 0; then
+  echo 1&gt;&amp;2 &quot;Try \`$0 --help' for more information&quot;
+  exit 1
+fi
+
+run=:
+sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
+sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
+
+# In the cases where this matters, `missing' is being run in the
+# srcdir already.
+if test -f configure.ac; then
+  configure_ac=configure.ac
+else
+  configure_ac=configure.in
+fi
+
+msg=&quot;missing on your system&quot;
+
+case $1 in
+--run)
+  # Try to run requested program, and just exit if it succeeds.
+  run=
+  shift
+  &quot;$@&quot; &amp;&amp; exit 0
+  # Exit code 63 means version mismatch.  This often happens
+  # when the user try to use an ancient version of a tool on
+  # a file that requires a minimum version.  In this case we
+  # we should proceed has if the program had been absent, or
+  # if --run hadn't been passed.
+  if test $? = 63; then
+    run=:
+    msg=&quot;probably too old&quot;
+  fi
+  ;;
+
+  -h|--h|--he|--hel|--help)
+    echo &quot;\
+$0 [OPTION]... PROGRAM [ARGUMENT]...
+
+Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
+error status if there is no known handling for PROGRAM.
+
+Options:
+  -h, --help      display this help and exit
+  -v, --version   output version information and exit
+  --run           try to run the given command, and emulate it if it fails
+
+Supported PROGRAM values:
+  aclocal      touch file \`aclocal.m4'
+  autoconf     touch file \`configure'
+  autoheader   touch file \`config.h.in'
+  autom4te     touch the output file, or create a stub one
+  automake     touch all \`Makefile.in' files
+  bison        create \`y.tab.[ch]', if possible, from existing .[ch]
+  flex         create \`lex.yy.c', if possible, from existing .c
+  help2man     touch the output file
+  lex          create \`lex.yy.c', if possible, from existing .c
+  makeinfo     touch the output file
+  tar          try tar, gnutar, gtar, then tar without non-portable flags
+  yacc         create \`y.tab.[ch]', if possible, from existing .[ch]
+
+Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
+\`g' are ignored when checking the name.
+
+Send bug reports to &lt;bug-automake@gnu.org&gt;.&quot;
+    exit $?
+    ;;
+
+  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+    echo &quot;missing $scriptversion (GNU Automake)&quot;
+    exit $?
+    ;;
+
+  -*)
+    echo 1&gt;&amp;2 &quot;$0: Unknown \`$1' option&quot;
+    echo 1&gt;&amp;2 &quot;Try \`$0 --help' for more information&quot;
+    exit 1
+    ;;
+
+esac
+
+# normalize program name to check for.
+program=`echo &quot;$1&quot; | sed '
+  s/^gnu-//; t
+  s/^gnu//; t
+  s/^g//; t'`
+
+# Now exit if we have it, but it failed.  Also exit now if we
+# don't have it and --version was passed (most likely to detect
+# the program).  This is about non-GNU programs, so use $1 not
+# $program.
+case $1 in
+  lex*|yacc*)
+    # Not GNU programs, they don't have --version.
+    ;;
+
+  tar*)
+    if test -n &quot;$run&quot;; then
+       echo 1&gt;&amp;2 &quot;ERROR: \`tar' requires --run&quot;
+       exit 1
+    elif test &quot;x$2&quot; = &quot;x--version&quot; || test &quot;x$2&quot; = &quot;x--help&quot;; then
+       exit 1
+    fi
+    ;;
+
+  *)
+    if test -z &quot;$run&quot; &amp;&amp; ($1 --version) &gt; /dev/null 2&gt;&amp;1; then
+       # We have it, but it failed.
+       exit 1
+    elif test &quot;x$2&quot; = &quot;x--version&quot; || test &quot;x$2&quot; = &quot;x--help&quot;; then
+       # Could not run --version or --help.  This is probably someone
+       # running `$TOOL --version' or `$TOOL --help' to check whether
+       # $TOOL exists and not knowing $TOOL uses missing.
+       exit 1
+    fi
+    ;;
+esac
+
+# If it does not exist, or fails to run (possibly an outdated version),
+# try to emulate it.
+case $program in
+  aclocal*)
+    echo 1&gt;&amp;2 &quot;\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`acinclude.m4' or \`${configure_ac}'.  You might want
+         to install the \`Automake' and \`Perl' packages.  Grab them from
+         any GNU archive site.&quot;
+    touch aclocal.m4
+    ;;
+
+  autoconf*)
+    echo 1&gt;&amp;2 &quot;\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`${configure_ac}'.  You might want to install the
+         \`Autoconf' and \`GNU m4' packages.  Grab them from any GNU
+         archive site.&quot;
+    touch configure
+    ;;
+
+  autoheader*)
+    echo 1&gt;&amp;2 &quot;\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`acconfig.h' or \`${configure_ac}'.  You might want
+         to install the \`Autoconf' and \`GNU m4' packages.  Grab them
+         from any GNU archive site.&quot;
+    files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
+    test -z &quot;$files&quot; &amp;&amp; files=&quot;config.h&quot;
+    touch_files=
+    for f in $files; do
+      case $f in
+      *:*) touch_files=&quot;$touch_files &quot;`echo &quot;$f&quot; |
+                                       sed -e 's/^[^:]*://' -e 's/:.*//'`;;
+      *) touch_files=&quot;$touch_files $f.in&quot;;;
+      esac
+    done
+    touch $touch_files
+    ;;
+
+  automake*)
+    echo 1&gt;&amp;2 &quot;\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
+         You might want to install the \`Automake' and \`Perl' packages.
+         Grab them from any GNU archive site.&quot;
+    find . -type f -name Makefile.am -print |
+           sed 's/\.am$/.in/' |
+           while read f; do touch &quot;$f&quot;; done
+    ;;
+
+  autom4te*)
+    echo 1&gt;&amp;2 &quot;\
+WARNING: \`$1' is needed, but is $msg.
+         You might have modified some files without having the
+         proper tools for further handling them.
+         You can get \`$1' as part of \`Autoconf' from any GNU
+         archive site.&quot;
+
+    file=`echo &quot;$*&quot; | sed -n &quot;$sed_output&quot;`
+    test -z &quot;$file&quot; &amp;&amp; file=`echo &quot;$*&quot; | sed -n &quot;$sed_minuso&quot;`
+    if test -f &quot;$file&quot;; then
+        touch $file
+    else
+        test -z &quot;$file&quot; || exec &gt;$file
+        echo &quot;#! /bin/sh&quot;
+        echo &quot;# Created by GNU Automake missing as a replacement of&quot;
+        echo &quot;#  $ $@&quot;
+        echo &quot;exit 0&quot;
+        chmod +x $file
+        exit 1
+    fi
+    ;;
+
+  bison*|yacc*)
+    echo 1&gt;&amp;2 &quot;\
+WARNING: \`$1' $msg.  You should only need it if
+         you modified a \`.y' file.  You may need the \`Bison' package
+         in order for those modifications to take effect.  You can get
+         \`Bison' from any GNU archive site.&quot;
+    rm -f y.tab.c y.tab.h
+    if test $# -ne 1; then
+        eval LASTARG=&quot;\${$#}&quot;
+        case $LASTARG in
+        *.y)
+            SRCFILE=`echo &quot;$LASTARG&quot; | sed 's/y$/c/'`
+            if test -f &quot;$SRCFILE&quot;; then
+                 cp &quot;$SRCFILE&quot; y.tab.c
+            fi
+            SRCFILE=`echo &quot;$LASTARG&quot; | sed 's/y$/h/'`
+            if test -f &quot;$SRCFILE&quot;; then
+                 cp &quot;$SRCFILE&quot; y.tab.h
+            fi
+          ;;
+        esac
+    fi
+    if test ! -f y.tab.h; then
+        echo &gt;y.tab.h
+    fi
+    if test ! -f y.tab.c; then
+        echo 'main() { return 0; }' &gt;y.tab.c
+    fi
+    ;;
+
+  lex*|flex*)
+    echo 1&gt;&amp;2 &quot;\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified a \`.l' file.  You may need the \`Flex' package
+         in order for those modifications to take effect.  You can get
+         \`Flex' from any GNU archive site.&quot;
+    rm -f lex.yy.c
+    if test $# -ne 1; then
+        eval LASTARG=&quot;\${$#}&quot;
+        case $LASTARG in
+        *.l)
+            SRCFILE=`echo &quot;$LASTARG&quot; | sed 's/l$/c/'`
+            if test -f &quot;$SRCFILE&quot;; then
+                 cp &quot;$SRCFILE&quot; lex.yy.c
+            fi
+          ;;
+        esac
+    fi
+    if test ! -f lex.yy.c; then
+        echo 'main() { return 0; }' &gt;lex.yy.c
+    fi
+    ;;
+
+  help2man*)
+    echo 1&gt;&amp;2 &quot;\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified a dependency of a manual page.  You may need the
+         \`Help2man' package in order for those modifications to take
+         effect.  You can get \`Help2man' from any GNU archive site.&quot;
+
+    file=`echo &quot;$*&quot; | sed -n &quot;$sed_output&quot;`
+    test -z &quot;$file&quot; &amp;&amp; file=`echo &quot;$*&quot; | sed -n &quot;$sed_minuso&quot;`
+    if test -f &quot;$file&quot;; then
+        touch $file
+    else
+        test -z &quot;$file&quot; || exec &gt;$file
+        echo &quot;.ab help2man is required to generate this page&quot;
+        exit $?
+    fi
+    ;;
+
+  makeinfo*)
+    echo 1&gt;&amp;2 &quot;\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified a \`.texi' or \`.texinfo' file, or any other file
+         indirectly affecting the aspect of the manual.  The spurious
+         call might also be the consequence of using a buggy \`make' (AIX,
+         DU, IRIX).  You might want to install the \`Texinfo' package or
+         the \`GNU make' package.  Grab either from any GNU archive site.&quot;
+    # The file to touch is that specified with -o ...
+    file=`echo &quot;$*&quot; | sed -n &quot;$sed_output&quot;`
+    test -z &quot;$file&quot; &amp;&amp; file=`echo &quot;$*&quot; | sed -n &quot;$sed_minuso&quot;`
+    if test -z &quot;$file&quot;; then
+      # ... or it is the one specified with @setfilename ...
+      infile=`echo &quot;$*&quot; | sed 's/.* \([^ ]*\) *$/\1/'`
+      file=`sed -n '
+        /^@setfilename/{
+          s/.* \([^ ]*\) *$/\1/
+          p
+          q
+        }' $infile`
+      # ... or it is derived from the source name (dir/f.texi becomes f.info)
+      test -z &quot;$file&quot; &amp;&amp; file=`echo &quot;$infile&quot; | sed 's,.*/,,;s,.[^.]*$,,'`.info
+    fi
+    # If the file does not exist, the user really needs makeinfo;
+    # let's fail without touching anything.
+    test -f $file || exit 1
+    touch $file
+    ;;
+
+  tar*)
+    shift
+
+    # We have already tried tar in the generic part.
+    # Look for gnutar/gtar before invocation to avoid ugly error
+    # messages.
+    if (gnutar --version &gt; /dev/null 2&gt;&amp;1); then
+       gnutar &quot;$@&quot; &amp;&amp; exit 0
+    fi
+    if (gtar --version &gt; /dev/null 2&gt;&amp;1); then
+       gtar &quot;$@&quot; &amp;&amp; exit 0
+    fi
+    firstarg=&quot;$1&quot;
+    if shift; then
+        case $firstarg in
+        *o*)
+            firstarg=`echo &quot;$firstarg&quot; | sed s/o//`
+            tar &quot;$firstarg&quot; &quot;$@&quot; &amp;&amp; exit 0
+            ;;
+        esac
+        case $firstarg in
+        *h*)
+            firstarg=`echo &quot;$firstarg&quot; | sed s/h//`
+            tar &quot;$firstarg&quot; &quot;$@&quot; &amp;&amp; exit 0
+            ;;
+        esac
+    fi
+
+    echo 1&gt;&amp;2 &quot;\
+WARNING: I can't seem to be able to run \`tar' with the given arguments.
+         You may want to install GNU tar or Free paxutils, or check the
+         command line arguments.&quot;
+    exit 1
+    ;;
+
+  *)
+    echo 1&gt;&amp;2 &quot;\
+WARNING: \`$1' is needed, and is $msg.
+         You might have modified some files without having the
+         proper tools for further handling them.  Check the \`README' file,
+         it often tells you about the needed prerequisites for installing
+         this package.  You may also peek at any GNU archive site, in case
+         some other package would contain this missing \`$1' program.&quot;
+    exit 1
+    ;;
+esac
+
+exit 0
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: &quot;scriptversion=&quot;
+# time-stamp-format: &quot;%:y-%02m-%02d.%02H&quot;
+# time-stamp-time-zone: &quot;UTC&quot;
+# time-stamp-end: &quot;; # UTC&quot;
+# End:
</ins><span class="cx">Property changes on: freeswitch/trunk/contrib/nazim/xmlcdrd/missing
</span><span class="cx">___________________________________________________________________
</span><span class="cx">Name: svn:executable
</span><span class="cx">   + *
</span></span></pre></div>
<a id="freeswitchtrunkcontribnazimxmlcdrdplugc"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/contrib/nazim/xmlcdrd/plug.c (0 => 16974)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/nazim/xmlcdrd/plug.c                                (rev 0)
+++ freeswitch/trunk/contrib/nazim/xmlcdrd/plug.c        2010-03-12 16:48:13 UTC (rev 16974)
</span><span class="lines">@@ -0,0 +1,97 @@
</span><ins>+#include &lt;string.h&gt;
+#include &lt;stdio.h&gt;
+#include &lt;stdlib.h&gt;
+#include &lt;dlfcn.h&gt;
+#include &quot;plug.h&quot;
+
+/*returns 0 on success, -1 on error*/
+int plug_init(const char *filename, const char *options,
+              XCDR_PLUGINFO *plug)
+{
+
+    char *error;
+
+    if (NULL == (plug-&gt;handle = dlopen(filename, RTLD_LAZY | RTLD_GLOBAL)))
+    {
+        fprintf(stderr, &quot;%s\r\n&quot;, dlerror());
+        return -1;
+    }
+
+    //clear any existing dl error.
+    dlerror();
+    *(void **) (&amp;plug-&gt;plugin_get_name) = dlsym(plug-&gt;handle, &quot;plugin_get_name&quot;);
+    if ((error = dlerror()) != NULL)
+    {
+        fprintf(stderr, &quot;%s\n&quot;, error);
+        return -1;
+    }
+
+    dlerror();
+    *(void **) (&amp;plug-&gt;plugin_get_description) = dlsym(plug-&gt;handle, &quot;plugin_get_description&quot;);
+    if ((error = dlerror()) != NULL)
+    {
+        fprintf(stderr, &quot;%s\n&quot;, error);
+        return -1;
+    }
+
+    dlerror();
+    *(void **) (&amp;plug-&gt;plugin_init) = dlsym(plug-&gt;handle, &quot;plugin_init&quot;);
+    if ((error = dlerror()) != NULL)
+    {
+        fprintf(stderr, &quot;%s\n&quot;, error);
+        return -1;
+    }
+
+    dlerror();
+    *(void **) (&amp;plug-&gt;plugin_free) = dlsym(plug-&gt;handle, &quot;plugin_free&quot;);
+    if ((error = dlerror()) != NULL)
+    {
+        fprintf(stderr, &quot;%s\n&quot;, error);
+        return -1;
+    }
+
+    dlerror();
+    *(void **) (&amp;plug-&gt;plugin_main) = dlsym(plug-&gt;handle, &quot;plugin_main&quot;);
+    if ((error = dlerror()) != NULL)
+    {
+        fprintf(stderr, &quot;%s\n&quot;, error);
+        return -1;
+    }
+
+
+
+    strncpy(plug-&gt;name, plug-&gt;plugin_get_name(), XCDR_PLUGIN_NAME_LEN_MAX);
+
+    if (-1 == plug-&gt;plugin_init(filename, options, &amp;plug-&gt;state))
+    {
+        fprintf(stderr, &quot;Failed to load plugin:'%s' InternalName:'%s' Options:'%s'\n&quot;, plug-&gt;name, filename, options);
+        return -1;
+    }
+
+
+    return 0;
+}
+
+int plug_free(XCDR_PLUGINFO *plug)
+{
+
+    if (NULL != plug-&gt;handle)
+    {
+        plug-&gt;plugin_free(&amp;plug-&gt;state);
+    }
+
+    return 0;
+}
+
+
+int plug_destroy(XCDR_PLUGINFO *plug)
+{
+
+    if (NULL != plug-&gt;handle)
+    {
+        return dlclose(plug-&gt;handle);
+    }
+
+    return 0;
+}
+
</ins></span></pre></div>
<a id="freeswitchtrunkcontribnazimxmlcdrdplugh"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/contrib/nazim/xmlcdrd/plug.h (0 => 16974)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/nazim/xmlcdrd/plug.h                                (rev 0)
+++ freeswitch/trunk/contrib/nazim/xmlcdrd/plug.h        2010-03-12 16:48:13 UTC (rev 16974)
</span><span class="lines">@@ -0,0 +1,48 @@
</span><ins>+#ifndef PLUG_H
+#define PLUG_H
+
+#include &quot;plugcommon.h&quot;
+#include &quot;stmtexptab.h&quot;
+
+
+typedef struct xcdr_plugin_info
+{
+        void *handle;
+        char name [XCDR_PLUGIN_NAME_LEN_MAX];
+
+    XCDR_PLUGSTATE state;
+
+    /*Functions exported by plugin*/
+
+    int (*plugin_init) (const char *filename, const char *options,
+                        XCDR_PLUGSTATE *state);
+
+    int (*plugin_free) (XCDR_PLUGSTATE *state);
+
+    char* (*plugin_get_description) (void);
+    char* (*plugin_get_name) (void);
+
+    /*
+      Main function which processes a hash table of variables/values @vex
+      Function returns:
+      PLUG_STATUS_OK
+      PLUG_STATUS_ERR */
+
+    int (*plugin_main) (STMTEXP_TAB *vex, XCDR_PLUGSTATE *state);
+
+    /* ~Functions exported by plugin*/
+
+} XCDR_PLUGINFO, *PXCDR_PLUGINFO;
+
+/* plug_int() calls plugin_init() which initializes
+   XCDR_PLUGSTATE.state used by plugin internally */
+int plug_init (const char *filename, const char *options, XCDR_PLUGINFO *plug);
+
+/* plug_free() calls plugin_free() to deallocate all dynamic resources
+   bound to XCDR_PLUGSTATE.local_vars. Must be invoked before plug_destroy() */
+int plug_free (XCDR_PLUGINFO *plug);
+
+/* plug_destroy() calls library dlclose() AFTER plug_free() */
+int plug_destroy(XCDR_PLUGINFO *plug);
+
+#endif
</ins></span></pre></div>
<a id="freeswitchtrunkcontribnazimxmlcdrdplugcommonh"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/contrib/nazim/xmlcdrd/plugcommon.h (0 => 16974)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/nazim/xmlcdrd/plugcommon.h                                (rev 0)
+++ freeswitch/trunk/contrib/nazim/xmlcdrd/plugcommon.h        2010-03-12 16:48:13 UTC (rev 16974)
</span><span class="lines">@@ -0,0 +1,25 @@
</span><ins>+#ifndef PLUGCOMMON_H
+#define PLUGCOMMON_H
+
+
+#define XCDR_PLUGIN_NAME_LEN_MAX 64
+#define XCDR_PLUGIN_FILENAME_LEN_MAX 256
+#define XCDR_PLUGIN_STRMAXLEN 256
+
+
+#define PLUG_STATUS_OK 0
+//#define PLUG_STATUS_STOPPROCESSING_HERE 1
+#define PLUG_STATUS_ERROR -1
+
+
+typedef struct xcdr_plugin_state
+{
+   /* local_vars are initialized by plugin during plugin_init
+       and destroyed in plugin_free
+    */
+    void *local_vars;
+    
+} XCDR_PLUGSTATE, *PXCDR_PLUGSTATE;
+
+
+#endif
</ins></span></pre></div>
<a id="freeswitchtrunkcontribnazimxmlcdrdpluginsluaexecMakefileam"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/contrib/nazim/xmlcdrd/plugins/luaexec/Makefile.am (0 => 16974)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/nazim/xmlcdrd/plugins/luaexec/Makefile.am                                (rev 0)
+++ freeswitch/trunk/contrib/nazim/xmlcdrd/plugins/luaexec/Makefile.am        2010-03-12 16:48:13 UTC (rev 16974)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+SHELL = /bin/sh
+CC = @CC@
+
+FLAGS= -W -Wmissing-prototypes -Wstrict-prototypes -g3 -Wall $(CFLAGS)
+
+all:
+        $(CC) $(CFLAGS) \
+        -shared -fPIC -o luaexec.so luaexec.c \
+        -I../../ \
+        @with_glib2_flags@ \
+        -llua -ldl -lglib-2.0 \
+        -lconfig \
+        ../../stmtexpldr.o ../../stmtexp.o ../../log.o
+
+install:
+        -cp luaexec.so  $(libdir)/xmlcdrd/
+
+clean:
+        -rm -f *.o luaexec.so
</ins></span></pre></div>
<a id="freeswitchtrunkcontribnazimxmlcdrdpluginsluaexecluaexecc"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/contrib/nazim/xmlcdrd/plugins/luaexec/luaexec.c (0 => 16974)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/nazim/xmlcdrd/plugins/luaexec/luaexec.c                                (rev 0)
+++ freeswitch/trunk/contrib/nazim/xmlcdrd/plugins/luaexec/luaexec.c        2010-03-12 16:48:13 UTC (rev 16974)
</span><span class="lines">@@ -0,0 +1,159 @@
</span><ins>+/*
+  plugin_init() accepts single option - absolute name of configuration file to parse.
+*/
+#include &quot;plugcommon.h&quot;
+#include &quot;plug.h&quot;
+#include &quot;stmtexp.h&quot;
+#include &quot;log.h&quot;
+#include &lt;syslog.h&gt;
+#include &lt;stdio.h&gt;
+#include &lt;stdlib.h&gt;
+#include &lt;string.h&gt;
+#include &lt;libconfig.h&gt;
+#include &lt;lua.h&gt;
+#include &lt;lauxlib.h&gt;
+#include &lt;lualib.h&gt;
+#include &lt;dlfcn.h&gt;
+
+#define PLUGIN_NAME &quot;lua exec&quot;
+#define PLUGIN_DESC &quot;Lua script wrapper&quot;
+
+#define FILENAME_LEN_MAX 512
+#define STR_LEN_MAX 256
+
+/*that's what lua script would call to get variable*/
+#define LUA_VAR_GET_FUNC &quot;xcdr_varget&quot;
+
+typedef struct luaexec_local_vars
+{
+    char *t;
+
+    int cfgres;
+    config_t cfg;
+    config_setting_t *setting;
+
+
+    luaL_reg *lualibs;
+    int lualibs_count;
+
+    char luascript [FILENAME_LEN_MAX];
+    lua_State *L;
+
+    STMTEXP_TAB *vex;
+
+} LUAEXECVARS;
+
+
+/*Local variables*/
+LUAEXECVARS *vars;
+
+
+
+char * plugin_get_name ()
+{
+
+  return PLUGIN_NAME;
+}
+
+
+
+char * plugin_get_description ()
+{
+
+  return PLUGIN_DESC;
+}
+
+
+static int l_varget (lua_State *L)
+{
+    const char* varid = luaL_checkstring(L, 1);
+
+    const char* val = stmtexp_lookup_var (vars-&gt;vex, varid);
+
+    lua_pushstring(L, val);
+
+    return 1;
+}
+
+
+ /**/ 
+int plugin_init (const char* filename, const char *options, XCDR_PLUGSTATE *state)
+{
+
+    int i;
+
+    vars = calloc (1, sizeof(LUAEXECVARS) );
+    state-&gt;local_vars = vars;
+
+
+    if (NULL == vars)
+    {
+        fprintf (stderr,
+                 &quot;%s plugin_init(). Can't allocate memory for state vars\n&quot;,
+                 PLUGIN_NAME);
+        return PLUG_STATUS_ERROR;
+    }
+    
+    fprintf (stderr, &quot;%s plugin_init (%s) \n&quot;, PLUGIN_NAME, options);
+
+    config_init(&amp;vars-&gt;cfg);
+    
+    if (!config_read_file(&amp;vars-&gt;cfg, options) )
+    {
+        fprintf (stderr, &quot;%s plugin_init (%s). Error parsing: '%s'\n&quot;,
+                 PLUGIN_NAME, options, options);
+
+        config_destroy(&amp;vars-&gt;cfg);
+
+        return PLUG_STATUS_ERROR;
+    }
+
+
+    memset (vars-&gt;luascript , 0x0, FILENAME_LEN_MAX);
+
+    const char *t = NULL;
+    
+    if (CONFIG_TRUE == config_lookup_string (&amp;vars-&gt;cfg, &quot;luascript&quot;, &amp;t) )
+        snprintf (vars-&gt;luascript, FILENAME_LEN_MAX - 1, &quot;%s&quot;, t);
+
+    config_destroy(&amp;vars-&gt;cfg);
+    return PLUG_STATUS_OK;
+}
+
+
+int plugin_free (XCDR_PLUGSTATE *state)
+{
+    vars = state-&gt;local_vars;
+
+    free (vars);
+    
+    return PLUG_STATUS_OK;
+}
+
+
+int plugin_main (STMTEXP_TAB *vex, XCDR_PLUGSTATE *state)
+{
+
+    vars = state-&gt;local_vars;
+    vars-&gt;vex = vex;
+
+    vars-&gt;L = lua_open();
+    luaL_openlibs (vars-&gt;L);
+
+    lua_pushcfunction(vars-&gt;L, l_varget);
+    lua_setglobal(vars-&gt;L, LUA_VAR_GET_FUNC);
+
+    
+    if (luaL_loadfile(vars-&gt;L, vars-&gt;luascript) )
+        fprintf(stderr, &quot;can't load file: %s, %s\n&quot;, vars-&gt;luascript,
+            lua_tostring(vars-&gt;L, -1));
+    
+
+    if(lua_pcall(vars-&gt;L, 0, 0, 0) )
+        fprintf(stderr, &quot;can't run file: %s, %s\n&quot;, vars-&gt;luascript,
+                lua_tostring(vars-&gt;L, -1));
+    
+    lua_close (vars-&gt;L);
+    
+    return PLUG_STATUS_OK;
+}
</ins></span></pre></div>
<a id="freeswitchtrunkcontribnazimxmlcdrdpluginsmysqlcdrMakefileam"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/contrib/nazim/xmlcdrd/plugins/mysqlcdr/Makefile.am (0 => 16974)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/nazim/xmlcdrd/plugins/mysqlcdr/Makefile.am                                (rev 0)
+++ freeswitch/trunk/contrib/nazim/xmlcdrd/plugins/mysqlcdr/Makefile.am        2010-03-12 16:48:13 UTC (rev 16974)
</span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+SHELL = /bin/sh
+CC = @CC@
+
+FLAGS= -W -Wmissing-prototypes -Wstrict-prototypes -fPIC -g3 -Wall $(CFLAGS)
+
+all:
+        $(CC) $(CFLAGS) -fPIC -W -Wall -I../../ `@with_mysql_config@ --include` -c dbcommon.c
+
+        $(CC) $(CFLAGS) \
+        -shared -fPIC -o mysqlcdr.so mysqlcdr.c \
+        -I../../ \
+        `@with_mysql_config@ --libs --include` \
+        @with_glib2_flags@ \
+        -lconfig  -lglib-2.0 \
+        dbcommon.o \
+        ../../stmtexpldr.o ../../stmtexp.o ../../log.o
+
+install:
+        cp mysqlcdr.so $(libdir)/xmlcdrd/
+
+
+clean:
+        -rm -f *.o mysqlcdr.so
</ins></span></pre></div>
<a id="freeswitchtrunkcontribnazimxmlcdrdpluginsmysqlcdrdbcommonc"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/contrib/nazim/xmlcdrd/plugins/mysqlcdr/dbcommon.c (0 => 16974)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/nazim/xmlcdrd/plugins/mysqlcdr/dbcommon.c                                (rev 0)
+++ freeswitch/trunk/contrib/nazim/xmlcdrd/plugins/mysqlcdr/dbcommon.c        2010-03-12 16:48:13 UTC (rev 16974)
</span><span class="lines">@@ -0,0 +1,64 @@
</span><ins>+#include &lt;stdio.h&gt;
+#include &lt;syslog.h&gt;
+#include &quot;dbcommon.h&quot;
+#include &quot;string.h&quot;
+#include &quot;log.h&quot;
+
+MYSQL *mysql_do_connect(char *host_name,
+                        char *user_name, char *password, char *db_name,
+                        unsigned long port_num, char *socket_name,
+                        unsigned int flags)
+{
+
+    MYSQL *conn; /* pointer to connection handler */
+
+    conn = mysql_init(NULL); /* allocate, initialize connection handler */
+    if (conn == NULL)
+    {
+        //fprintf (stderr, &quot;mysql_init() failed\n&quot;);
+        syslog_error(&quot;mysql_init() failed&quot;);
+        return (NULL);
+    }
+
+    my_bool reconnect = 1;
+    mysql_options(conn, MYSQL_OPT_RECONNECT, &amp;reconnect);
+
+    if (mysql_real_connect(conn, host_name, user_name, password,
+                           db_name, port_num, socket_name, flags) == NULL)
+    {
+        fprintf (stderr, &quot;mysql_real_connect() failed:\nError %u (%s)\n&quot;, mysql_errno (conn), mysql_error (conn));
+        //syslog_mysql_error(conn, &quot;error. mysql_real_connect() failed&quot;);
+        return (NULL);
+    }
+
+    return (conn);
+}
+
+void mysql_do_disconnect(MYSQL *conn)
+{
+    mysql_close(conn);
+}
+
+void mysql_print_error(MYSQL *conn, char *message)
+{
+
+    if (conn != NULL)
+    {
+        syslog_msg(LOG_ALERT, 1, &quot;MySQL connection error. '%s'. %u (%s)&quot;,
+                   message, mysql_errno(conn), mysql_error(conn));
+
+        fprintf (stderr, &quot;MySQL connection error. '%s'. %u (%s)&quot;,
+                   message, mysql_errno(conn), mysql_error(conn));
+    }
+    else
+    {
+        fprintf (stderr, &quot;MySQL connection error. \
+'%s'. Can't get mysql_errno() because connection handler is invalid&quot;, message);
+
+        syslog_msg(LOG_ALERT, 0,
+                   &quot;MySQL connection error. \
+'%s'. Can't get mysql_errno() because connection handler is invalid&quot;, message);
+        
+    }
+}
+
</ins></span></pre></div>
<a id="freeswitchtrunkcontribnazimxmlcdrdpluginsmysqlcdrdbcommonh"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/contrib/nazim/xmlcdrd/plugins/mysqlcdr/dbcommon.h (0 => 16974)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/nazim/xmlcdrd/plugins/mysqlcdr/dbcommon.h                                (rev 0)
+++ freeswitch/trunk/contrib/nazim/xmlcdrd/plugins/mysqlcdr/dbcommon.h        2010-03-12 16:48:13 UTC (rev 16974)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+#ifndef DBCOMMON_H
+#define DBCOMMON_H
+
+#include &lt;mysql.h&gt;
+
+
+MYSQL *mysql_do_connect (char *host_name,
+        char *user_name, char *password, char *db_name,
+        unsigned long port_num, char *socket_name, unsigned int flags);
+
+
+void mysql_do_disconnect (MYSQL *conn);
+void mysql_print_error (MYSQL *conn, char *message);
+
+#endif
+
</ins></span></pre></div>
<a id="freeswitchtrunkcontribnazimxmlcdrdpluginsmysqlcdrmysqlcdrc"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/contrib/nazim/xmlcdrd/plugins/mysqlcdr/mysqlcdr.c (0 => 16974)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/nazim/xmlcdrd/plugins/mysqlcdr/mysqlcdr.c                                (rev 0)
+++ freeswitch/trunk/contrib/nazim/xmlcdrd/plugins/mysqlcdr/mysqlcdr.c        2010-03-12 16:48:13 UTC (rev 16974)
</span><span class="lines">@@ -0,0 +1,336 @@
</span><ins>+/*
+  plugin_init() accepts single option - absolute name of configuration file to parse.
+*/
+
+#include &quot;plugcommon.h&quot;
+#include &quot;plug.h&quot;
+#include &quot;stmtexp.h&quot;
+#include &quot;log.h&quot;
+#include &lt;syslog.h&gt;
+#include &lt;mysql.h&gt;
+#include &lt;stdio.h&gt;
+#include &lt;stdlib.h&gt;
+#include &lt;string.h&gt;
+#include &lt;libconfig.h&gt;
+#include &lt;glib.h&gt;
+
+
+#define PLUGIN_NAME &quot;mysql cdr&quot;
+#define PLUGIN_DESC &quot;MySQL cdr logger&quot;
+
+#define STMT_RETRY_MAX   2
+#define MYSQL_IPPORT 3306
+
+
+
+
+/* Statement expansion */
+#define VARSTART &quot;$&lt;&quot;
+#define VAREND &quot;&gt;&quot;
+
+#define VARSTART_LEN strlen (VARSTART)
+#define VAREND_LEN strlen (VAREND)
+
+#define VARID_LEN  512
+
+#define TEMP_GSTRING_INIT_SIZE 1024
+#define STMT_TEMPLATE_MAX_LEN 40960
+
+typedef struct mysqlcdr_local_vars
+{
+    unsigned int sql_insert_retry_max;
+
+    GString *temp;
+    
+    MYSQL *conn; 
+    char dbuserid [XCDR_PLUGIN_STRMAXLEN];
+    char dbpasswd [XCDR_PLUGIN_STRMAXLEN];
+    char dbschema [XCDR_PLUGIN_STRMAXLEN];
+    char dbipaddr [XCDR_PLUGIN_STRMAXLEN];
+    unsigned int  dbipport;
+    unsigned long dbflags;
+    char stmt_template [STMT_TEMPLATE_MAX_LEN];
+
+    char *t;
+
+    int cfgres;
+    config_t cfg;
+
+} MYSQLCDRVARS;
+
+
+/*Local variables*/
+MYSQLCDRVARS *vars;
+
+
+int mysql_query_retry_on_fail (MYSQL *conn, const char *stmt,
+                               unsigned int retrycount)
+{
+
+    unsigned int rc = 0;
+    int res;
+
+    while (rc++ &lt;= retrycount)
+    {
+        res = mysql_query (conn, stmt);
+        if (0 != res)
+        {
+            mysql_print_error (conn, &quot;mysql_query() failed.&quot;);
+
+            if (-1 == mysql_ping(conn) )
+                fprintf (stderr, &quot;Connection to db lost\n&quot;);
+
+        } else return res;
+
+    }
+
+}
+
+
+
+
+/*Returns NULL if escaping of string fails*/
+const char *mysqlcdr_expand_str (MYSQL *conn, stmtexp_tab_t *vex, 
+                         const char *src, int srclen)
+{
+    const char *s; //src
+    char *e; //end
+    char varid [VARID_LEN];
+    
+    s = src;
+    g_string_set_size (vex-&gt;expanded, 0);
+
+    //fprintf (stderr, &quot;mysqlcdr_expand_str '%s'\n&quot;, src);
+
+    while (s &lt; src + srclen)
+    {
+        if (NULL != (e = strstr (s, VARSTART)) )
+        {
+            g_string_append_len (vex-&gt;expanded, s, e - s);
+            s = e++;
+
+            if (NULL != (e = strstr (s, VAREND)) )
+            {
+                
+                /* Remove placeholders VARSTART and VAREND, then lookup */
+                memset (varid, 0x0, VARID_LEN);
+                strncpy (varid, s + VARSTART_LEN, (e - s) - VARSTART_LEN );
+                
+                const char* ev = stmtexp_lookup_var (vex, varid);
+                //fprintf (stderr, &quot;---%s\n&quot;, ev);
+                if (NULL != ev)
+                {
+                    unsigned int ev_len = strlen(ev);
+
+                    g_string_set_size (vars-&gt;temp, (ev_len * 2) + 1);
+                    memset (vars-&gt;temp-&gt;str, 0x0, (ev_len * 2) + 1);
+
+                    unsigned long res = mysql_real_escape_string (
+                            conn,
+                            vars-&gt;temp-&gt;str,
+                            ev,
+                            ev_len
+                        );
+
+                    /*if length of escaped string is less than input bail out*/
+                    if (res &lt; ev_len)
+                        return NULL;
+                   
+                    /*append expanded var to destination*/
+                    g_string_append (vex-&gt;expanded, vars-&gt;temp-&gt;str);
+                }
+                else
+                {
+                    /*variable was not found, skip it*/
+                }
+                
+                s = e + 1;
+                //fprintf (stderr, &quot;s: '%s'\n&quot;, s);
+         
+            }
+            else   /*no more signatures found, append the rest of the str*/
+            {
+                if (NULL != s)
+                    g_string_append (vex-&gt;expanded, s);
+                break;
+            }
+        }
+       else /*no more signatures found, append the rest of the str*/
+        {
+            if (NULL != s)
+                g_string_append (vex-&gt;expanded, s);
+            break;
+        }
+    }//while (s &lt; src + src_len)
+
+    return vex-&gt;expanded-&gt;str;
+    
+}
+
+
+
+char * plugin_get_name ()
+{
+
+  return PLUGIN_NAME;
+}
+
+
+
+char * plugin_get_description ()
+{
+
+  return PLUGIN_DESC;
+}
+
+ /**/ 
+int plugin_init (const char* filename, const char *options, XCDR_PLUGSTATE *state)
+{
+
+    vars = calloc (1, sizeof(MYSQLCDRVARS) );
+    state-&gt;local_vars = vars;
+
+
+    if (NULL == vars)
+    {
+        fprintf (stderr,
+                 &quot;%s plugin_init(). Can't allocate memory for state vars\n&quot;,
+                 PLUGIN_NAME);
+        return PLUG_STATUS_ERROR;
+    }
+    
+    fprintf (stderr, &quot;%s plugin_init (%s) \n&quot;, PLUGIN_NAME, options);
+
+
+    vars-&gt;temp = g_string_sized_new (TEMP_GSTRING_INIT_SIZE);
+
+    config_init(&amp;vars-&gt;cfg);
+    
+    if (!config_read_file(&amp;vars-&gt;cfg, options) )
+    {
+        fprintf (stderr, &quot;%s plugin_init (%s). Error parsing: '%s'\n&quot;,
+                 PLUGIN_NAME, options, options);
+
+        config_destroy(&amp;vars-&gt;cfg);
+
+        return PLUG_STATUS_ERROR;
+    }
+
+
+    memset (vars-&gt;dbuserid, 0x0, XCDR_PLUGIN_STRMAXLEN);
+    memset (vars-&gt;dbpasswd, 0x0, XCDR_PLUGIN_STRMAXLEN);
+    memset (vars-&gt;dbipaddr, 0x0, XCDR_PLUGIN_STRMAXLEN);
+    memset (vars-&gt;dbschema, 0x0, XCDR_PLUGIN_STRMAXLEN);
+    memset (vars-&gt;stmt_template, 0x0, XCDR_PLUGIN_STRMAXLEN);
+    
+
+    const char *t = NULL;
+    int it;
+
+    if (CONFIG_TRUE == config_lookup_string (&amp;vars-&gt;cfg, &quot;dbuserid&quot;, &amp;t) )
+         snprintf (vars-&gt;dbuserid, XCDR_PLUGIN_STRMAXLEN, &quot;%s&quot;, t);
+
+    if (CONFIG_TRUE == config_lookup_string (&amp;vars-&gt;cfg, &quot;dbpasswd&quot;, &amp;t) )
+        snprintf (vars-&gt;dbpasswd, XCDR_PLUGIN_STRMAXLEN, &quot;%s&quot;, t);
+              
+    if (CONFIG_TRUE == config_lookup_string (&amp;vars-&gt;cfg, &quot;dbipaddr&quot;, &amp;t))
+        snprintf (vars-&gt;dbipaddr, XCDR_PLUGIN_STRMAXLEN, &quot;%s&quot;, t);
+              
+    if (CONFIG_TRUE == config_lookup_string (&amp;vars-&gt;cfg, &quot;dbschema&quot;, &amp;t))
+        snprintf (vars-&gt;dbschema, XCDR_PLUGIN_STRMAXLEN, &quot;%s&quot;, t);
+  
+    if (CONFIG_TRUE == config_lookup_string (&amp;vars-&gt;cfg, &quot;stmt_template&quot;, &amp;t))
+        snprintf (vars-&gt;stmt_template, STMT_TEMPLATE_MAX_LEN, &quot;%s&quot;, t);
+              
+    if (CONFIG_TRUE != config_lookup_int (&amp;vars-&gt;cfg, &quot;dbipport&quot;, &amp;vars-&gt;dbipport) )
+        vars-&gt;dbipport = MYSQL_IPPORT;
+
+    if (CONFIG_TRUE != config_lookup_int (&amp;vars-&gt;cfg, &quot;sql_insert_retry_max&quot;,
+                                          &amp;vars-&gt;sql_insert_retry_max) )
+        vars-&gt;sql_insert_retry_max = STMT_RETRY_MAX;
+
+    if (0 &gt;= vars-&gt;sql_insert_retry_max)
+        vars-&gt;sql_insert_retry_max = STMT_RETRY_MAX;
+
+
+    config_destroy(&amp;vars-&gt;cfg);
+
+    fprintf (stderr, &quot;%s plugin_init (%s). \
+dbschema: %s, dbuserid: %s, dbpasswd: %s, dbipaddr: %s, \
+dbipport: %i \r\n&quot;,
+             PLUGIN_NAME, options,
+             vars-&gt;dbschema, vars-&gt;dbuserid, vars-&gt;dbpasswd, 
+             vars-&gt;dbipaddr, vars-&gt;dbipport);
+
+
+    vars-&gt;dbflags = 0;
+    vars-&gt;conn = (MYSQL *) mysql_do_connect (vars-&gt;dbipaddr, 
+                                            vars-&gt;dbuserid, vars-&gt;dbpasswd,
+                                            vars-&gt;dbschema,
+                                            vars-&gt;dbipport, NULL, vars-&gt;dbflags);
+    if (vars-&gt;conn == NULL)
+    {
+        fprintf (stderr, &quot;%s plugin_init (%s). Can't connect to db: '%s'&quot;,
+                 PLUGIN_NAME, options, vars-&gt;dbschema);
+
+        syslog_msg (LOG_ALERT, 0, &quot;%s plugin_init (%s). Can't connect to db: '%s'\n&quot;,
+                    PLUGIN_NAME, options, vars-&gt;dbschema);
+
+        return PLUG_STATUS_ERROR;
+    }
+    
+    return PLUG_STATUS_OK;
+}
+
+int plugin_free (XCDR_PLUGSTATE *state)
+{
+    vars = state-&gt;local_vars;
+
+    mysql_close (vars-&gt;conn);
+    g_string_free (vars-&gt;temp, TRUE);
+
+    free (vars);
+    
+    return PLUG_STATUS_OK;
+}
+
+
+int plugin_main (STMTEXP_TAB *vex, XCDR_PLUGSTATE *state)
+{
+
+    vars = state-&gt;local_vars;
+   
+    int retr = vars-&gt;sql_insert_retry_max;
+    int stmt_done = 0;
+
+    while (retr--)
+    {
+        const char* stmt =  mysqlcdr_expand_str (vars-&gt;conn, vex, vars-&gt;stmt_template,
+                                                 strlen(vars-&gt;stmt_template));
+        if (NULL == stmt)
+        {
+            fprintf (stderr, &quot;mysqlcdr_expand_str() returned error. Retrying\n&quot;);
+            mysql_ping(vars-&gt;conn);
+        }
+        else
+        {
+         
+            if (0 != mysql_query_retry_on_fail (vars-&gt;conn, stmt, STMT_RETRY_MAX))
+                fprintf (stderr, &quot;Error. '%s' failed. Retrying.\n&quot;, stmt);
+            else
+            {
+                fprintf (stderr, &quot;%s\n&quot;, stmt);
+                stmt_done = 1;
+                break;
+            }
+        }
+            
+    }//~while (retr--)
+
+    if (!stmt_done)
+    {
+        //!FixMe - Failover action. Log to file ... e.t.c
+    }
+
+    return PLUG_STATUS_OK;
+}
</ins></span></pre></div>
<a id="freeswitchtrunkcontribnazimxmlcdrdplugldrc"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/contrib/nazim/xmlcdrd/plugldr.c (0 => 16974)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/nazim/xmlcdrd/plugldr.c                                (rev 0)
+++ freeswitch/trunk/contrib/nazim/xmlcdrd/plugldr.c        2010-03-12 16:48:13 UTC (rev 16974)
</span><span class="lines">@@ -0,0 +1,254 @@
</span><ins>+#include &lt;stdio.h&gt;
+#include &lt;syslog.h&gt;
+#include &lt;pcre.h&gt;
+#include &lt;string.h&gt;
+#include &lt;libconfig.h&gt;
+#include &quot;plugcommon.h&quot;
+#include &quot;plugldr.h&quot;
+#include &quot;log.h&quot;
+
+
+#define XCDR_FILE_PATH_MAX 1024
+#define XCDR_STR_LEN_MAX 1024
+
+
+
+int xcdr_plug_ldr_sort_plugins(XCDR_PLUGTAB *plugtab)
+{
+    unsigned int a, b;
+    XCDR_PLUGTAG x;
+
+
+    for (a = 1; a &lt; plugtab-&gt;tag_count; ++a)
+    {
+        for (b = plugtab-&gt;tag_count - 1; b &gt;= a; --b)
+        {
+            if (plugtab-&gt;tags[b - 1].priority &gt; plugtab-&gt;tags[b].priority)
+            {
+                x = plugtab-&gt;tags[b - 1];
+                plugtab-&gt;tags[b - 1] = plugtab-&gt;tags[b];
+                plugtab-&gt;tags[b] = x;
+            }
+        }
+    }
+
+    return 0;
+}
+
+
+int
+xcdr_plugldr_load_plugins(XCDR_PLUGTAB *plugtab)
+{
+    unsigned int i;
+
+    if (NULL == plugtab-&gt;tags || 0 &gt;= plugtab-&gt;tag_count)
+    {
+        syslog_msg(LOG_ALERT, 1,
+                   &quot;xcdr_plugldr_load_plugins %s:%d No plugins configured&quot;,
+                   __FILE__, __LINE__);
+        return -1;
+    }
+
+    for (i = 0; i &lt; plugtab-&gt;tag_count; i++)
+    {
+
+        if (PLUG_STATUS_ERROR == plug_init(plugtab-&gt;tags[i].fname,
+                            plugtab-&gt;tags[i].options,
+                            &amp;plugtab-&gt;tags[i].plug))
+        {
+            syslog_msg(LOG_ALERT, 1,
+                       &quot;plugldr_load_plugins %s:%d can't load plugin '%s'&quot;,
+                       __FILE__, __LINE__, plugtab-&gt;tags[i].fname);
+            return -1;
+        }
+
+        fprintf(stderr, &quot;plugin: '%s' loaded priority:'%d' options:'%s'\n&quot;,
+                plugtab-&gt;tags[i].fname, plugtab-&gt;tags[i].priority,
+                plugtab-&gt;tags[i].options);
+
+    }// ~for (i
+
+    if (1 &lt; plugtab-&gt;tag_count)
+        xcdr_plug_ldr_sort_plugins(plugtab);
+
+
+    return 0;
+}
+
+
+
+
+
+int xcdr_plugldr_load_config(XCDR_PLUGTAB *plugtab, const char* config_file)
+{
+
+    config_t cfg;
+    config_setting_t *setting;
+
+    config_init(&amp;cfg);
+
+    fprintf (stderr, &quot;xcdr_plugldr_load_config. Reading config: '%s'\n&quot;, config_file);
+
+        if (!config_read_file(&amp;cfg, config_file)) 
+    {
+                fprintf(stderr, &quot;%s:%d - %s\n&quot;,
+                config_file,
+                config_error_line(&amp;cfg),
+                config_error_text(&amp;cfg));
+                config_destroy(&amp;cfg);
+
+                return -1;
+        }
+
+
+    const char *plugin_dir;
+    config_lookup_string (&amp;cfg, &quot;plugin_dir&quot;, &amp;plugin_dir);
+
+    setting = config_lookup(&amp;cfg, &quot;Plugins&quot;);
+    if(setting != NULL)
+    {
+        int count = config_setting_length(setting);
+        int i;
+
+        plugtab-&gt;tags = NULL;
+        plugtab-&gt;tag_count = count;
+
+        plugtab-&gt;tags = (XCDR_PLUGTAG*) 
+            calloc(plugtab-&gt;tag_count, sizeof (XCDR_PLUGTAG));
+        if (NULL == plugtab-&gt;tags)
+        {
+            config_destroy(&amp;cfg);
+            return -1;
+        }
+
+        for(i = 0; i &lt; count; ++i)
+        {
+            config_setting_t *plugin = config_setting_get_elem(setting, i);
+
+            const char *name, *options;
+            int priority;
+
+            if(!(config_setting_lookup_string(plugin, &quot;name&quot;, &amp;name)
+                 &amp;&amp; config_setting_lookup_string(plugin, &quot;options&quot;, &amp;options)
+                 &amp;&amp; config_setting_lookup_int(plugin, &quot;priority&quot;, &amp;priority)))
+                continue;
+
+            fprintf(stderr, &quot;  Plugin [%d] %s:\n&quot;, i, name);
+            snprintf(plugtab-&gt;tags[i].fname, XCDR_PLUGIN_STRMAXLEN - 1,
+                     &quot;%s/%s.so&quot;, plugin_dir, name);
+
+            snprintf(plugtab-&gt;tags[i].options, XCDR_PLUGIN_STRMAXLEN - 1,
+                     &quot;%s&quot;, options);
+
+            plugtab-&gt;tags[i].priority = priority;
+
+            fprintf(stderr, &quot;  %u  plugin = '%s' options = '%s'\n&quot;,
+                    plugtab-&gt;tags[i].priority,
+                    plugtab-&gt;tags[i].fname,
+                    plugtab-&gt;tags[i].options);
+        }
+

+        for(i = 0; i &lt; count; ++i)
+        {
+            char metric_name [XCDR_STR_LEN_MAX];
+            snprintf (metric_name, XCDR_STR_LEN_MAX - 1, &quot;Plugins.[%d].Metrics&quot;, i);
+            config_setting_t *setting_m = config_lookup(&amp;cfg, metric_name);
+            if (NULL == setting_m) 
+                continue;
+
+
+            int metric_count = config_setting_length(setting_m);
+                 
+            plugtab-&gt;tags[i].metrics.tag_count = metric_count;
+             
+            plugtab-&gt;tags[i].metrics.tags = 
+                (XCDR_METRTAG*) calloc(metric_count,
+                                       sizeof (XCDR_METRTAG));
+            
+            int j;
+            const char *name, *regexp;
+            for (j = 0; j &lt; metric_count; j++)
+            {
+                config_setting_t *metric = config_setting_get_elem(setting_m, j);
+
+                if(!(config_setting_lookup_string(metric, &quot;metric&quot;, &amp;name)
+                     &amp;&amp; config_setting_lookup_string(metric, &quot;regexp&quot;, &amp;regexp)))
+                    continue;
+
+                snprintf (plugtab-&gt;tags[i].metrics.tags[j].metric,
+                          XCDR_METRIC_ID_MAX,
+                          &quot;%s&quot;,
+                          name);
+
+                snprintf (plugtab-&gt;tags[i].metrics.tags[j].regexp,
+                          XCDR_METRIC_REGEXP_MAX,
+                          &quot;%s&quot;,
+                          regexp);
+
+                fprintf(stderr, &quot;  Loaded metric %s:%s:%d [%s] '%s'\n&quot;, 
+                        plugtab-&gt;tags[i].fname,
+                        plugtab-&gt;tags[i].options,
+                        plugtab-&gt;tags[i].priority,
+                        name, regexp);
+            }
+        }
+    }
+
+    config_destroy(&amp;cfg);
+
+    return 0;
+}
+
+
+
+void
+xcdr_plugldr_free_plugins(XCDR_PLUGTAB *plugtab)
+{
+    unsigned int i;
+
+    if (NULL == plugtab) return;
+
+    for (i = 0; i &lt; plugtab-&gt;tag_count; i++)
+        if (NULL != plugtab-&gt;tags[i].fname)
+        {
+            plug_free(&amp;plugtab-&gt;tags[i].plug);
+            free(plugtab-&gt;tags[i].metrics.tags);
+
+            fprintf(stderr, &quot;plugldr_free_plugins %s\n&quot;, plugtab-&gt;tags[i].fname);
+        }
+
+    if (NULL != plugtab-&gt;tags)
+    {
+        free(plugtab-&gt;tags);
+        plugtab-&gt;tag_count = 0;
+    }
+
+    plugtab-&gt;tags = NULL;
+
+    fprintf(stderr, &quot;plugldr_free_plugins done\r\n&quot;);
+
+    return;
+}
+
+/*
+        Returns non -negative value on success
+    Negative value on failure
+ */
+int xcdr_plugldr_match_regexp(const char *regexp,
+                              const char *text, int text_len)
+{
+    pcre *re;
+    const char *error;
+    int ovector[30];
+    int erroffset;
+    int res;
+
+    re = pcre_compile(regexp, 0, &amp;error, &amp;erroffset, NULL);
+
+    res = pcre_exec(re, NULL, text, text_len, 0, 0, ovector, 30);
+
+    pcre_free (re);
+
+    return res;
+}
</ins></span></pre></div>
<a id="freeswitchtrunkcontribnazimxmlcdrdplugldrh"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/contrib/nazim/xmlcdrd/plugldr.h (0 => 16974)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/nazim/xmlcdrd/plugldr.h                                (rev 0)
+++ freeswitch/trunk/contrib/nazim/xmlcdrd/plugldr.h        2010-03-12 16:48:13 UTC (rev 16974)
</span><span class="lines">@@ -0,0 +1,86 @@
</span><ins>+#ifndef PLUGLDR_H
+#define PLUGLDR_H
+
+#include &quot;plug.h&quot;
+
+
+#define XCDR_PLUGLDR_PREPROCESSOR_PLUGIN_TOKEN &quot;preprocessor_plugin&quot;
+#define XCDR_PLUGLDR_PROCESSOR_PLUGIN_TOKEN &quot;processor_plugin&quot;
+#define XCDR_PLUGLDR_FALLBACK_PLUGIN_TOKEN &quot;fallback_plugin&quot;
+#define XCDR_PLUGLDR_PLUGIN_DIR_TOKEN &quot;plugin_dir&quot;
+
+#define XCDR_METRIC_ID_MAX 256
+#define XCDR_METRIC_REGEXP_MAX 256
+
+
+
+typedef struct xcdr_plugin_metric_tag
+{
+    char metric [XCDR_METRIC_ID_MAX];
+    char regexp [XCDR_METRIC_REGEXP_MAX];
+} XCDR_METRTAG, *PXCDR_METRTAG;
+
+
+typedef struct xcdr_metric_table
+{
+        XCDR_METRTAG *tags;
+        unsigned int tag_count;
+} XCDR_METRTAB, *PXCDR_METRTAB;
+
+
+
+
+typedef struct xcdr_plugin_tag
+{
+
+    unsigned int id;
+
+    /*plugin priority in config table*/
+        unsigned int priority;
+
+    /*plugin file name*/
+        char fname [XCDR_PLUGIN_STRMAXLEN];
+
+    /*options passed to plugin*/
+        char options [XCDR_PLUGIN_STRMAXLEN];
+
+
+    /* plugin function pointers*/
+        XCDR_PLUGINFO plug;
+    
+    /*table of plugin metrics*/
+    XCDR_METRTAB metrics;
+
+    
+} XCDR_PLUGTAG, *PXCDR_PLUGTAG;
+
+
+typedef struct plugin_table
+{
+        XCDR_PLUGTAG *tags;
+        unsigned int tag_count;
+} XCDR_PLUGTAB, *PXCDR_PLUGTAB;
+
+
+/*First configure PLUGTAB table*/
+int xcdr_plugldr_load_config(XCDR_PLUGTAB *plugtab, const char* config_file);
+
+/*Load plugins after successful configuration*/
+int xcdr_plugldr_load_plugins (XCDR_PLUGTAB *plugtab);
+
+
+/*int xcdr_plugldr_match_plugin (const PLUGINCALLINFO *plugci,
+                          const XCDR_PLUGTAB *plugtab, XCDR_PLUGINFO **plug,
+                          const int startpos);
+*/
+
+void xcdr_plugldr_free_plugins (XCDR_PLUGTAB *plugtab);
+
+int xcdr_plug_ldr_sort_plugins (XCDR_PLUGTAB *plugtab);
+
+int xcdr_plugldr_match_regexp (const char *regexp,
+                          const char *text, int text_len);
+
+
+#endif
+
</ins></span></pre></div>
<a id="freeswitchtrunkcontribnazimxmlcdrdstmtexpc"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/contrib/nazim/xmlcdrd/stmtexp.c (0 => 16974)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/nazim/xmlcdrd/stmtexp.c                                (rev 0)
+++ freeswitch/trunk/contrib/nazim/xmlcdrd/stmtexp.c        2010-03-12 16:48:13 UTC (rev 16974)
</span><span class="lines">@@ -0,0 +1,144 @@
</span><ins>+#include &lt;string.h&gt;
+#include &lt;stdio.h&gt;
+#include &lt;stdlib.h&gt;
+#include &lt;glib.h&gt;
+#include &quot;stmtexp.h&quot;
+#include &quot;stmtexpldr.h&quot;
+
+
+#define VARSTART &quot;$&lt;&quot;
+#define VAREND &quot;&gt;&quot;
+
+#define VARSTART_LEN strlen (VARSTART)
+#define VAREND_LEN strlen (VAREND)
+
+#define VARID_LEN  512
+
+int stmtexp_load_config (stmtexp_tab_t *vex, const char* config_file)
+{
+    stmtexpldr_init (vex);
+    
+    return stmtexpldr_load_config (vex, config_file);
+}
+
+void stmtexp_free (stmtexp_tab_t *vex)
+{
+    stmtexpldr_clear (vex);
+}
+
+void stmtexp_assign_var (stmtexp_tab_t *vex, 
+                            const char *varid, const char *vartext)
+{
+    stmtexp_key_t t;
+    memset (&amp;t, 0x0, sizeof(stmtexp_key_t) );
+    
+    snprintf (t.stmt_var, STMTEXPAND_STRLEN_MAX - 1, &quot;%s&quot;, varid);
+
+    stmtexp_val_t *tv = g_hash_table_lookup (vex-&gt;ght, &amp;t);
+
+    if (NULL == tv)
+    {
+        /*
+        fprintf (stderr, 
+                 &quot;Index '%s' is not found. Can't assign var.\n&quot;,
+                 varid);
+        */
+        return;
+    }
+
+    if (NULL != tv-&gt;val)
+    {
+        /*
+          fprintf (stderr, &quot;free old val %s\n&quot;, tv-&gt;val);
+        */
+        free (tv-&gt;val);
+        tv-&gt;val = NULL;
+    }
+
+    tv-&gt;val = strdup (vartext);
+
+}
+
+const char* stmtexp_lookup_var (stmtexp_tab_t *vex, const char *varid)
+{
+    stmtexp_key_t t;
+    memset (&amp;t, 0x0, sizeof(stmtexp_key_t) );
+    
+    snprintf (t.stmt_var, STMTEXPAND_STRLEN_MAX - 1, &quot;%s&quot;, varid);
+
+    
+    stmtexp_val_t *tv = g_hash_table_lookup (vex-&gt;ght, &amp;t);
+
+    //fprintf (stderr, &quot;stmtexp_lookup_var('%s')&quot;, varid);
+
+    if (NULL != tv)
+        return tv-&gt;val;
+    else return NULL;
+}
+
+
+void stmtexp_foreach_callback (stmtexp_tab_t *vex,
+                               stmtexp_foreach_callback_t c,
+                               void *data)
+{
+    g_hash_table_foreach (vex-&gt;ght, (GHFunc)c, data);
+}
+
+
+const char *stmtexp_expand_str (stmtexp_tab_t *vex, 
+                         const char *src, int srclen)
+{
+    const char *s; //src
+    char *e; //end
+    char varid [VARID_LEN];
+    
+    s = src;
+    g_string_set_size (vex-&gt;expanded, 0);
+
+    while (s &lt; src + srclen)
+    {
+        if (NULL != (e = strstr (s, VARSTART)) )
+        {
+            g_string_append_len (vex-&gt;expanded, s, e - s);
+            s = e++;
+
+            if (NULL != (e = strstr (s, VAREND)) )
+            {
+                
+                /* Remove placeholders VARSTART and VAREND, then lookup */
+                memset (varid, 0x0, VARID_LEN);
+                strncpy (varid, s + VARSTART_LEN, (e - s) - VARSTART_LEN );
+                
+                const char* ev = stmtexp_lookup_var (vex, varid);
+                if (NULL != ev)
+                {
+                    /*append expanded var to destination*/
+                    g_string_append (vex-&gt;expanded, ev);
+                }
+                else
+                {
+                    /*variable was not found, skip it*/
+                }
+                
+                s = e + 1;
+                //fprintf (stderr, &quot;s: '%s'\n&quot;, s);
+         
+            }
+            else   /*no more signatures found, append the rest of the str*/
+            {
+                if (NULL != s)
+                    g_string_append (vex-&gt;expanded, s);
+                break;
+            }
+        }
+       else /*no more signatures found, append the rest of the str*/
+        {
+            if (NULL != s)
+                g_string_append (vex-&gt;expanded, s);
+            break;
+        }
+    }//while (s &lt; src + src_len)
+
+    return vex-&gt;expanded-&gt;str;
+    
+}
</ins></span></pre></div>
<a id="freeswitchtrunkcontribnazimxmlcdrdstmtexph"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/contrib/nazim/xmlcdrd/stmtexp.h (0 => 16974)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/nazim/xmlcdrd/stmtexp.h                                (rev 0)
+++ freeswitch/trunk/contrib/nazim/xmlcdrd/stmtexp.h        2010-03-12 16:48:13 UTC (rev 16974)
</span><span class="lines">@@ -0,0 +1,52 @@
</span><ins>+#ifndef STMTEXP_H
+#define STMTEXP_H
+
+#include &quot;stmtexptab.h&quot;
+#include &quot;stmtexpldr.h&quot;
+#include &lt;glib.h&gt;
+
+/*
+  Very simple and slow variable expansion. No text escaping is provided.
+  No recursion checks, so if your expanded var contains variable definition
+  you're in trouble.
+*/
+
+
+/* Callback to modify each key and value */
+typedef void  (* stmtexp_foreach_callback_t)  (stmtexp_key_t *key, 
+                                               stmtexp_val_t *val,
+                                               void *userdata);
+
+
+/*
+  Returns:
+     -1 if error occured, any other value on success
+*/
+int stmtexp_load_config (stmtexp_tab_t *vex, const char* config_file);
+
+void stmtexp_free (stmtexp_tab_t *vex);
+
+const char* stmtexp_lookup_var (stmtexp_tab_t *vex, const char *varid);
+
+void stmtexp_foreach_callback (stmtexp_tab_t *vex,
+                               stmtexp_foreach_callback_t c,
+                               void *data);
+
+void stmtexp_assign_var (stmtexp_tab_t *vex, 
+                            const char *varid, const char *vartext);
+
+/*
+  @vex - variables to expand
+  Returns:
+    pointer to a static buffer which gets overwritten on next call to the func.
+    NULL on errror
+*/
+const char *stmtexp_expand_str (stmtexp_tab_t * vex, 
+                         const char *src, int srclen);
+
+
+
+
+#endif
+
+
</ins></span></pre></div>
<a id="freeswitchtrunkcontribnazimxmlcdrdstmtexpldrc"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/contrib/nazim/xmlcdrd/stmtexpldr.c (0 => 16974)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/nazim/xmlcdrd/stmtexpldr.c                                (rev 0)
+++ freeswitch/trunk/contrib/nazim/xmlcdrd/stmtexpldr.c        2010-03-12 16:48:13 UTC (rev 16974)
</span><span class="lines">@@ -0,0 +1,218 @@
</span><ins>+#include &quot;stmtexptab.h&quot;
+#include &quot;stmtexpldr.h&quot;
+#include &lt;libconfig.h&gt;
+#include &lt;stdlib.h&gt;
+#include &lt;malloc.h&gt;
+#include &lt;string.h&gt;
+
+
+#define EXPANDED_STR_DEF_LEN  10240
+
+
+
+gboolean stmtexpldr_equal (gconstpointer a, gconstpointer b);
+guint stmtexpldr_str_hash (gconstpointer v);
+void stmtexpldr_destroy_val (gpointer data);
+void stmtexpldr_destroy_key (gpointer data);
+
+
+gboolean stmtexpldr_equal (gconstpointer a, gconstpointer b)
+{
+    const stmtexp_key_t* ta = (stmtexp_key_t *) a;
+    const stmtexp_key_t* tb = (stmtexp_key_t *) b;
+
+    return g_str_equal (ta-&gt;stmt_var, tb-&gt;stmt_var);
+}
+
+
+guint stmtexpldr_str_hash (gconstpointer v)
+{
+    const stmtexp_key_t* tv = (stmtexp_key_t *) v;
+
+    return (g_str_hash(tv-&gt;stmt_var) );
+}
+
+
+void stmtexpldr_destroy_val (gpointer data)
+{
+    if (NULL == data)
+        return;
+
+    stmtexp_val_t * val = (stmtexp_val_t*) data;
+    
+    if (NULL != val-&gt;val)
+        free (val-&gt;val);
+
+    free (val);
+}
+
+void stmtexpldr_destroy_key (gpointer data)
+{
+    if (NULL == data)
+        return;
+
+    stmtexp_key_t * key = (stmtexp_key_t*) data;
+    
+    if (NULL != key)
+        free (key);
+}
+
+
+
+void stmtexpldr_init (stmtexp_tab_t *vex)
+{
+    vex-&gt;ght = g_hash_table_new_full (g_str_hash, stmtexpldr_equal,
+                                      stmtexpldr_destroy_key, stmtexpldr_destroy_val);
+
+    vex-&gt;expanded = g_string_sized_new (EXPANDED_STR_DEF_LEN);
+}
+
+
+int stmtexpldr_load_config (stmtexp_tab_t *vex, const char* config_file)
+{
+
+    int fret;
+    config_t cfg;
+    config_setting_t *setting;
+
+        config_init(&amp;cfg);
+
+        if (!config_read_file(&amp;cfg, config_file)) 
+    {
+                fprintf(stderr, &quot;%s:%d - %s\n&quot;,
+                config_file,
+                config_error_line(&amp;cfg),
+                config_error_text(&amp;cfg));
+                config_destroy(&amp;cfg);
+
+                return -1;
+        }
+
+
+    setting = config_lookup(&amp;cfg, &quot;Variables&quot;);
+    if(setting != NULL)
+    {
+        int count = config_setting_length(setting);
+        printf(&quot;%d configured variables:\n&quot;, count);
+
+        int i;
+        for(i = 0; i &lt; count; ++i)
+        {
+            config_setting_t *var = config_setting_get_elem(setting, i);
+
+            const char *var_id, *xpath; 
+
+            if(!(config_setting_lookup_string(var, &quot;var_id&quot;,
+                                              &amp;var_id)
+                 &amp;&amp; config_setting_lookup_string(var, &quot;xpath&quot;, &amp;xpath))
+                )
+                continue;
+
+            stmtexp_key_t* sk = calloc (1, sizeof(stmtexp_key_t) );
+            if (NULL != sk)
+            {
+                fprintf(stderr, &quot;  Variable [%d] '%s':'%s'\n&quot;, i, 
+                        var_id, xpath );
+
+                snprintf (sk-&gt;stmt_var, STMTEXPAND_STRLEN_MAX - 1, &quot;%s&quot;,
+                          var_id);
+                
+                snprintf (sk-&gt;xpath, STMTEXPAND_STRLEN_MAX - 1, &quot;%s&quot;, xpath );
+
+                //add index and value
+                stmtexp_val_t *sv = calloc (1, sizeof(stmtexp_val_t) );
+                g_hash_table_replace (vex-&gt;ght, sk, sv);
+            } else
+            {
+                perror (&quot;stmtexpldr_load_config() malloc error\n&quot;);
+                fret = -1;
+                break;
+            }
+
+
+        }
+        fret = 0;
+
+    }
+    
+
+    config_destroy(&amp;cfg);
+
+    return fret;
+
+/*
+    cfg_t *cfg;
+
+
+    int res;
+    int fret = 0;
+    
+    cfg = cfg_init(opts, 0);
+    res = cfg_parse(cfg, config_file);
+    
+    printf(&quot;Parsing result == %d\n&quot;, res);
+    if(res == CFG_FILE_ERROR)
+    {
+        perror(config_file);
+        return -1;
+    } else if(res == CFG_PARSE_ERROR)
+    {
+        fprintf(stderr, &quot;'%s' parse error\n&quot;, config_file);
+        return -1;
+    }
+
+    int n = cfg_size(cfg, &quot;var&quot;);
+    printf(&quot;%d configured variables:\n&quot;, n);
+
+    int i;
+    for(i = 0; i &lt; n; i++)
+    {
+        stmtexp_key_t* sk = calloc (1, sizeof(stmtexp_key_t) );
+        if (NULL != sk)
+        {
+            cfg_t *vars = cfg_getnsec(cfg, &quot;var&quot;, i);
+
+            printf(&quot;  Variable [%d] %s:\n&quot;, i, cfg_title(vars) );
+            snprintf (sk-&gt;stmt_var, STMTEXPAND_STRLEN_MAX - 1,
+                      &quot;%s&quot;, cfg_getstr(vars, &quot;var_placeholder&quot;) );
+            printf(&quot;    Var. Placeholder = %s\n&quot;, sk-&gt;stmt_var);
+
+
+            snprintf (sk-&gt;xpath, STMTEXPAND_STRLEN_MAX - 1,
+                      &quot;%s&quot;, cfg_getstr(vars, &quot;xpath&quot;) );
+            printf(&quot;    Var. XPATH = %s\n&quot;, sk-&gt;xpath);
+
+
+            //add index and value
+            stmtexp_val_t *sv = calloc (1, sizeof(stmtexp_val_t) );
+            g_hash_table_replace (vex-&gt;ght, sk, sv);
+        } else
+        {
+            perror (&quot;stmtexpldr_load_config() malloc error\n&quot;);
+            fret = -1;
+            break;
+        }
+    }
+    
+    
+
+    cfg_free(cfg);
+
+    
+    return fret;
+*/
+}
+
+
+void stmtexpldr_clear (stmtexp_tab_t *vex)
+{
+    g_hash_table_remove_all (vex-&gt;ght);
+}
+
+
+void stmtexpldr_free (stmtexp_tab_t *vex)
+{
+    g_hash_table_destroy (vex-&gt;ght);
+    g_string_free (vex-&gt;expanded, TRUE);
+}
+
</ins></span></pre></div>
<a id="freeswitchtrunkcontribnazimxmlcdrdstmtexpldrh"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/contrib/nazim/xmlcdrd/stmtexpldr.h (0 => 16974)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/nazim/xmlcdrd/stmtexpldr.h                                (rev 0)
+++ freeswitch/trunk/contrib/nazim/xmlcdrd/stmtexpldr.h        2010-03-12 16:48:13 UTC (rev 16974)
</span><span class="lines">@@ -0,0 +1,45 @@
</span><ins>+#ifndef STMTEXPLDR_H
+#define STMTEXPLDR_H
+
+#include &quot;stmtexptab.h&quot;
+
+#define STMTEXPAND_STRLEN_MAX  512
+
+typedef enum
+{
+    STMTEXP_DB_DT_VARCHAR = 1,
+    STMTEXP_DB_DT_INT
+} stmtexp_db_field_dt;
+
+typedef struct
+{
+    /*stmt_var - variable id inside a statement: $&lt;SOMEVAR&gt; */
+    char stmt_var [STMTEXPAND_STRLEN_MAX];
+
+    /*XPATH of value inside the XMLCDR hierarchy*/
+    char xpath [STMTEXPAND_STRLEN_MAX];
+   
+} stmtexp_key_t, *pstmtexp_key_t;
+
+typedef struct
+{
+    char *val;
+} stmtexp_val_t, *pstmtexp_val_t;
+
+
+
+void stmtexpldr_init (stmtexp_tab_t *vex);
+
+/* Returns:
+
+    -1 if error occured*/
+int stmtexpldr_load_config (stmtexp_tab_t *vex, const char* config_file);
+
+void stmtexpldr_clear (stmtexp_tab_t *vex);
+
+void stmtexpldr_free (stmtexp_tab_t *vex);
+
+
+
+
+#endif
</ins></span></pre></div>
<a id="freeswitchtrunkcontribnazimxmlcdrdstmtexptabh"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/contrib/nazim/xmlcdrd/stmtexptab.h (0 => 16974)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/nazim/xmlcdrd/stmtexptab.h                                (rev 0)
+++ freeswitch/trunk/contrib/nazim/xmlcdrd/stmtexptab.h        2010-03-12 16:48:13 UTC (rev 16974)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+#ifndef STMTEXPTAB_H
+#define STMTEXPTAB_H
+
+#include &lt;glib.h&gt;
+
+typedef struct
+{
+    GHashTable *ght;
+    GString *expanded;
+} stmtexp_tab_t, *pstmtexp_tab_t, STMTEXP_TAB, *PSTMTEXP_TAB;
+
+
+
+#endif
</ins></span></pre></div>
<a id="freeswitchtrunkcontribnazimxmlcdrdtestxml"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/contrib/nazim/xmlcdrd/test.xml (0 => 16974)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/nazim/xmlcdrd/test.xml                                (rev 0)
+++ freeswitch/trunk/contrib/nazim/xmlcdrd/test.xml        2010-03-12 16:48:13 UTC (rev 16974)
</span><span class="lines">@@ -0,0 +1,187 @@
</span><ins>+&lt;?xml version=&quot;1.0&quot;?&gt;
+&lt;cdr&gt;
+  &lt;variables&gt;
+    &lt;sip_received_ip&gt;192.168.50.21&lt;/sip_received_ip&gt;
+    &lt;sip_received_port&gt;39368&lt;/sip_received_port&gt;
+    &lt;sip_authorized&gt;true&lt;/sip_authorized&gt;
+    &lt;sip_mailbox&gt;1160&lt;/sip_mailbox&gt;
+    &lt;sip_auth_username&gt;1160&lt;/sip_auth_username&gt;
+
+    &lt;sip_auth_realm&gt;192.168.50.229&lt;/sip_auth_realm&gt;
+    &lt;mailbox&gt;1160&lt;/mailbox&gt;
+    &lt;record_stereo&gt;true&lt;/record_stereo&gt;
+    &lt;accountcode&gt;1160&lt;/accountcode&gt;
+    &lt;user_context&gt;default&lt;/user_context&gt;
+    &lt;effective_caller_id_name&gt;Michael%20S%20Collins&lt;/effective_caller_id_name&gt;
+
+    &lt;effective_caller_id_number&gt;5597993757&lt;/effective_caller_id_number&gt;
+    &lt;sip_from_user&gt;1160&lt;/sip_from_user&gt;
+    &lt;sip_from_uri&gt;1160%40192.168.50.229&lt;/sip_from_uri&gt;
+    &lt;sip_from_host&gt;192.168.50.229&lt;/sip_from_host&gt;
+    &lt;sip_from_user_stripped&gt;1160&lt;/sip_from_user_stripped&gt;
+    &lt;sip_from_tag&gt;a360bd54&lt;/sip_from_tag&gt;
+
+    &lt;sofia_profile_name&gt;internal&lt;/sofia_profile_name&gt;
+    &lt;sofia_profile_domain_name&gt;192.168.50.229&lt;/sofia_profile_domain_name&gt;
+    &lt;sip_req_user&gt;92137991400&lt;/sip_req_user&gt;
+    &lt;sip_req_uri&gt;92137991400%40192.168.50.229&lt;/sip_req_uri&gt;
+    &lt;sip_req_host&gt;192.168.50.229&lt;/sip_req_host&gt;
+    &lt;sip_to_user&gt;92137991400&lt;/sip_to_user&gt;
+
+    &lt;sip_to_uri&gt;92137991400%40192.168.50.229&lt;/sip_to_uri&gt;
+    &lt;sip_to_host&gt;192.168.50.229&lt;/sip_to_host&gt;
+    &lt;sip_contact_user&gt;1160&lt;/sip_contact_user&gt;
+    &lt;sip_contact_port&gt;39368&lt;/sip_contact_port&gt;
+    &lt;sip_contact_uri&gt;1160%40192.168.50.21%3A39368&lt;/sip_contact_uri&gt;
+    &lt;sip_contact_host&gt;192.168.50.21&lt;/sip_contact_host&gt;
+
+    &lt;channel_name&gt;sofia/internal/1160%40192.168.50.229&lt;/channel_name&gt;
+    &lt;sip_call_id&gt;NzUyYzU2ZmU0NjQ0NmNkMGExYTNiZjIzMjIwMWNiODc.&lt;/sip_call_id&gt;
+    &lt;sip_via_host&gt;192.168.50.21&lt;/sip_via_host&gt;
+    &lt;sip_via_port&gt;39368&lt;/sip_via_port&gt;
+    &lt;sip_via_rport&gt;39368&lt;/sip_via_rport&gt;
+    &lt;max_forwards&gt;70&lt;/max_forwards&gt;
+
+    &lt;presence_id&gt;1160%40192.168.50.229&lt;/presence_id&gt;
+    &lt;switch_r_sdp&gt;v%3D0%0D%0Ao%3D-%206%202%20IN%20IP4%20192.168.50.21%0D%0As%3DCounterPath%20X-Lite%203.0%0D%0Ac%3DIN%20IP4%20192.168.50.21%0D%0At%3D0%200%0D%0Am%3Daudio%209140%20RTP/AVP%20107%20119%20100%20106%200%20105%2098%208%203%20101%0D%0Aa%3Drtpmap%3A107%20BV32/16000%0D%0Aa%3Drtpmap%3A119%20BV32-FEC/16000%0D%0Aa%3Drtpmap%3A100%20SPEEX/16000%0D%0Aa%3Drtpmap%3A106%20SPEEX-FEC/16000%0D%0Aa%3Drtpmap%3A105%20SPEEX-FEC/8000%0D%0Aa%3Drtpmap%3A98%20iLBC/8000%0D%0Aa%3Drtpmap%3A101%20telephone-event/8000%0D%0Aa%3Dfmtp%3A101%200-15%0D%0Aa%3Dalt%3A1%201%20%3A%20CV3qZAA1%209gFf2/Iz%20192.168.50.21%209140%0D%0A&lt;/switch_r_sdp&gt;
+    &lt;remote_media_ip&gt;192.168.50.21&lt;/remote_media_ip&gt;
+    &lt;remote_media_port&gt;9140&lt;/remote_media_port&gt;
+    &lt;write_codec&gt;PCMU&lt;/write_codec&gt;
+    &lt;write_rate&gt;8000&lt;/write_rate&gt;
+
+    &lt;open&gt;true&lt;/open&gt;
+    &lt;use_profile&gt;nat&lt;/use_profile&gt;
+    &lt;numbering_plan&gt;US&lt;/numbering_plan&gt;
+    &lt;default_gateway&gt;asterlink.com&lt;/default_gateway&gt;
+    &lt;default_area_code&gt;559&lt;/default_area_code&gt;
+    &lt;user_name&gt;default&lt;/user_name&gt;
+
+    &lt;domain_name&gt;192.168.50.229&lt;/domain_name&gt;
+    &lt;local_media_ip&gt;192.168.50.229&lt;/local_media_ip&gt;
+    &lt;local_media_port&gt;9140&lt;/local_media_port&gt;
+    &lt;current_application&gt;bridge&lt;/current_application&gt;
+    &lt;originate_disposition&gt;SUCCESS&lt;/originate_disposition&gt;
+    &lt;bridge_channel&gt;OpenZAP/1%3A23/2137991400&lt;/bridge_channel&gt;
+
+    &lt;bridge_uuid&gt;e012ce96-7f9c-4194-87fe-5ba86a3930ca&lt;/bridge_uuid&gt;
+    &lt;signal_bond&gt;e012ce96-7f9c-4194-87fe-5ba86a3930ca&lt;/signal_bond&gt;
+    &lt;sip_nat_detected&gt;true&lt;/sip_nat_detected&gt;
+    &lt;endpoint_disposition&gt;ANSWER&lt;/endpoint_disposition&gt;
+    &lt;sip_user_agent&gt;X-Lite%20release%201100l%20stamp%2047546&lt;/sip_user_agent&gt;
+    &lt;sip_term_status&gt;200&lt;/sip_term_status&gt;
+
+    &lt;sip_term_cause&gt;16&lt;/sip_term_cause&gt;
+    &lt;hangup_cause&gt;NORMAL_CLEARING&lt;/hangup_cause&gt;
+    &lt;start_stamp&gt;2008-07-31%2011%3A35%3A38&lt;/start_stamp&gt;
+    &lt;profile_start_stamp&gt;2008-07-31%2011%3A35%3A38&lt;/profile_start_stamp&gt;
+    &lt;answer_stamp&gt;2008-07-31%2011%3A35%3A41&lt;/answer_stamp&gt;
+    &lt;progress_stamp&gt;2008-07-31%2011%3A35%3A38&lt;/progress_stamp&gt;
+
+    &lt;progress_media_stamp&gt;2008-07-31%2011%3A35%3A38&lt;/progress_media_stamp&gt;
+    &lt;end_stamp&gt;2008-07-31%2011%3A36%3A17&lt;/end_stamp&gt;
+    &lt;start_epoch&gt;1217529338&lt;/start_epoch&gt;
+    &lt;start_uepoch&gt;1217529338212616&lt;/start_uepoch&gt;
+    &lt;profile_start_epoch&gt;1217529338&lt;/profile_start_epoch&gt;
+    &lt;profile_start_uepoch&gt;1217529338212616&lt;/profile_start_uepoch&gt;
+
+    &lt;answer_epoch&gt;1217529338&lt;/answer_epoch&gt;
+    &lt;answer_uepoch&gt;1217529338452698&lt;/answer_uepoch&gt;
+    &lt;end_epoch&gt;1217529377&lt;/end_epoch&gt;
+    &lt;end_uepoch&gt;1217529377795951&lt;/end_uepoch&gt;
+    &lt;last_app&gt;bridge&lt;/last_app&gt;
+    &lt;last_arg&gt;openzap/1/A/2137991400&lt;/last_arg&gt;
+
+    &lt;caller_id&gt;%22Mikey%22%20%3C1160%3E&lt;/caller_id&gt;
+    &lt;duration&gt;39&lt;/duration&gt;
+    &lt;billsec&gt;36&lt;/billsec&gt;
+    &lt;progresssec&gt;0&lt;/progresssec&gt;
+    &lt;progress_mediasec&gt;0&lt;/progress_mediasec&gt;
+    &lt;flow_billsec&gt;39&lt;/flow_billsec&gt;
+
+    &lt;mduration&gt;39583&lt;/mduration&gt;
+    &lt;billmsec&gt;36267&lt;/billmsec&gt;
+    &lt;progressmsec&gt;238&lt;/progressmsec&gt;
+    &lt;progress_mediamsec&gt;237955&lt;/progress_mediamsec&gt;
+    &lt;flow_billmsec&gt;39583&lt;/flow_billmsec&gt;
+    &lt;uduration&gt;39583335&lt;/uduration&gt;
+
+    &lt;billusec&gt;36267529&lt;/billusec&gt;
+    &lt;progressusec&gt;237955&lt;/progressusec&gt;
+    &lt;progress_mediausec&gt;237955&lt;/progress_mediausec&gt;
+    &lt;flow_billusec&gt;39583335&lt;/flow_billusec&gt;
+    &lt;read_codec&gt;PCMU&lt;/read_codec&gt;
+    &lt;read_rate&gt;8000&lt;/read_rate&gt;
+
+  &lt;/variables&gt;
+  &lt;app_log&gt;
+    &lt;application app_name=&quot;set&quot; app_data=&quot;open=true&quot;&gt;&lt;/application&gt;
+    &lt;application app_name=&quot;set&quot; app_data=&quot;use_profile=nat&quot;&gt;&lt;/application&gt;
+    &lt;application app_name=&quot;set_user&quot; app_data=&quot;default@192.168.50.229&quot;&gt;&lt;/application&gt;
+    &lt;application app_name=&quot;db&quot; app_data=&quot;insert/spymap/1160/6f32e2f8-38d1-43a7-b6ea-215bbfe6a314&quot;&gt;&lt;/application&gt;
+    &lt;application app_name=&quot;db&quot; app_data=&quot;insert/last_dial/1160/92137991400&quot;&gt;&lt;/application&gt;
+    &lt;application app_name=&quot;db&quot; app_data=&quot;insert/last_dial/global/6f32e2f8-38d1-43a7-b6ea-215bbfe6a314&quot;&gt;&lt;/application&gt;
+    &lt;application app_name=&quot;record_session&quot; app_data=&quot;/mnt/powervault/Databases/XMLCDR/6f32e2f8-38d1-43a7-b6ea-215bbfe6a314__1.wav&quot;&gt;&lt;/application&gt;
+
+    &lt;application app_name=&quot;bridge&quot; app_data=&quot;openzap/1/A/2137991400&quot;&gt;&lt;/application&gt;
+  &lt;/app_log&gt;
+  &lt;callflow dialplan=&quot;XML&quot; profile_index=&quot;1&quot;&gt;
+    &lt;extension name=&quot;tod_example&quot; number=&quot;92137991400&quot;&gt;
+      &lt;application app_name=&quot;set&quot; app_data=&quot;open=true&quot;&gt;&lt;/application&gt;
+      &lt;application app_name=&quot;set&quot; app_data=&quot;use_profile=${cond(${acl(${network_addr} rfc1918)} == true ? nat : default)}&quot;&gt;&lt;/application&gt;
+      &lt;application app_name=&quot;set_user&quot; app_data=&quot;default@${domain}&quot;&gt;&lt;/application&gt;
+      &lt;application app_name=&quot;db&quot; app_data=&quot;insert/spymap/${caller_id_number}/${uuid}&quot;&gt;&lt;/application&gt;
+      &lt;application app_name=&quot;db&quot; app_data=&quot;insert/last_dial/${caller_id_number}/${destination_number}&quot;&gt;&lt;/application&gt;
+
+      &lt;application app_name=&quot;db&quot; app_data=&quot;insert/last_dial/global/${uuid}&quot;&gt;&lt;/application&gt;
+      &lt;application app_name=&quot;record_session&quot; app_data=&quot;/mnt/powervault/Databases/XMLCDR/${uuid}__1.wav&quot;&gt;&lt;/application&gt;
+      &lt;application app_name=&quot;bridge&quot; app_data=&quot;openzap/1/A/2137991400&quot;&gt;&lt;/application&gt;
+    &lt;/extension&gt;
+    &lt;caller_profile&gt;
+      &lt;username&gt;1160&lt;/username&gt;
+      &lt;dialplan&gt;XML&lt;/dialplan&gt;
+      &lt;caller_id_name&gt;Mikey&lt;/caller_id_name&gt;
+
+      &lt;ani&gt;&lt;/ani&gt;
+      &lt;aniii&gt;&lt;/aniii&gt;
+      &lt;caller_id_number&gt;1160&lt;/caller_id_number&gt;
+      &lt;network_addr&gt;192.168.50.21&lt;/network_addr&gt;
+      &lt;rdnis&gt;&lt;/rdnis&gt;
+      &lt;destination_number&gt;92137991400&lt;/destination_number&gt;
+      &lt;uuid&gt;6f32e2f8-38d1-43a7-b6ea-215bbfe6a314&lt;/uuid&gt;
+
+      &lt;source&gt;mod_sofia&lt;/source&gt;
+      &lt;context&gt;default&lt;/context&gt;
+      &lt;chan_name&gt;sofia/internal/1160@192.168.50.229&lt;/chan_name&gt;
+      &lt;originatee&gt;
+        &lt;originatee_caller_profile&gt;
+          &lt;username&gt;1160&lt;/username&gt;
+          &lt;dialplan&gt;XML&lt;/dialplan&gt;
+
+          &lt;caller_id_name&gt;Michael S Collins&lt;/caller_id_name&gt;
+          &lt;ani&gt;&lt;/ani&gt;
+          &lt;aniii&gt;&lt;/aniii&gt;
+          &lt;caller_id_number&gt;5597993757&lt;/caller_id_number&gt;
+          &lt;network_addr&gt;192.168.50.21&lt;/network_addr&gt;
+          &lt;rdnis&gt;&lt;/rdnis&gt;
+          &lt;destination_number&gt;1/A/2137991400&lt;/destination_number&gt;
+
+          &lt;uuid&gt;e012ce96-7f9c-4194-87fe-5ba86a3930ca&lt;/uuid&gt;
+          &lt;source&gt;mod_sofia&lt;/source&gt;
+          &lt;context&gt;default&lt;/context&gt;
+          &lt;chan_name&gt;OpenZAP/1:23/2137991400&lt;/chan_name&gt;
+        &lt;/originatee_caller_profile&gt;
+      &lt;/originatee&gt;
+    &lt;/caller_profile&gt;
+
+    &lt;times&gt;
+      &lt;created_time&gt;1217529338212616&lt;/created_time&gt;
+      &lt;profile_created_time&gt;1217529338212616&lt;/profile_created_time&gt;
+      &lt;progress_time&gt;1217529338450571&lt;/progress_time&gt;
+      &lt;progress_media_time&gt;1217529338452698&lt;/progress_media_time&gt;
+      &lt;answered_time&gt;1217529341528422&lt;/answered_time&gt;
+
+      &lt;hangup_time&gt;1217529377795951&lt;/hangup_time&gt;
+      &lt;transfer_time&gt;0&lt;/transfer_time&gt;
+    &lt;/times&gt;
+  &lt;/callflow&gt;
+&lt;/cdr&gt;
</ins></span></pre></div>
<a id="freeswitchtrunkcontribnazimxmlcdrdurldecodec"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/contrib/nazim/xmlcdrd/urldecode.c (0 => 16974)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/nazim/xmlcdrd/urldecode.c                                (rev 0)
+++ freeswitch/trunk/contrib/nazim/xmlcdrd/urldecode.c        2010-03-12 16:48:13 UTC (rev 16974)
</span><span class="lines">@@ -0,0 +1,86 @@
</span><ins>+#include &lt;glib.h&gt;
+#include &quot;urldecode.h&quot;
+
+
+
+const char * urldecode_expand_value (GString *url,
+                             const char *key, int key_len,
+                             int case_sensative,
+                             GString *temp, int *status, GString *val)
+{
+    const char *p;
+    char *end;
+    apr_size_t len;
+
+    if (  NULL == key )
+    {
+        *status = URLUTIL_STATUS_INVALID_PARAMS;
+        return NULL;
+    }
+
+    if (0 == strlen(key) || 0 == key_len)
+    {
+        *status = URLUTIL_STATUS_EMPTY_SRCH_KEY;
+        return NULL;
+    }
+        
+    if (strlen((char*)url-&gt;str) &lt; key_len )
+    {
+        *status =  URLUTIL_STATUS_URL_STR_TOO_SHORT;
+        return NULL;
+    }
+
+
+    //convert key to urlencoded string,
+    //since we are searching for urlencoded keys
+
+    //max length of urlencoded key is 3 * key length
+    len = 3 * key_len + 1;
+    g_string_set_size(temp, len);
+    memset (temp-&gt;str, 0x0, len);
+
+    apreq_encode(temp-&gt;str, key, key_len );
+    //append '=' to the key_name    
+    temp-&gt;str [strlen(temp-&gt;str)] = '=';
+
+
+    if (0 == case_sensative)
+    {
+        if (NULL == (p = strcasestr ((const char*) url-&gt;str, temp-&gt;str)) )
+        {
+            *status = URLUTIL_STATUS_SRCH_KEY_NOT_FOUND;
+            return NULL;
+        }
+    } else
+    {
+        if (NULL == (p = strstr ((const char*) url-&gt;str, temp-&gt;str)) )
+        {
+            *status = URLUTIL_STATUS_SRCH_KEY_NOT_FOUND;
+            return NULL;
+        }
+    } //~else case_sensative
+
+    
+    //urlencoded key is found in cgi request string
+    if (NULL == (end = strchr (p, '=')) )
+    {
+        *status = URLUTIL_STATUS_URL_KEY_VAL_BROKEN;
+        return NULL;
+    } 
+    
+    //get value
+    //if terminating '&amp;' is not found,
+    //then our value ends at the end of the @url string
+    p = ++end;
+    if (NULL == (end = strchr (p, '&amp;')) )
+        end = url-&gt;str + strlen(url-&gt;str);
+
+    len = 3 * (end - p) + 1;
+    g_string_set_size(val, len);
+    memset (val-&gt;str, 0x0, len);
+
+    apreq_decode (val-&gt;str, &amp;len, p, end - p);    
+
+    return val-&gt;str;
+}
+
</ins></span></pre></div>
<a id="freeswitchtrunkcontribnazimxmlcdrdurldecodeh"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/contrib/nazim/xmlcdrd/urldecode.h (0 => 16974)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/nazim/xmlcdrd/urldecode.h                                (rev 0)
+++ freeswitch/trunk/contrib/nazim/xmlcdrd/urldecode.h        2010-03-12 16:48:13 UTC (rev 16974)
</span><span class="lines">@@ -0,0 +1,28 @@
</span><ins>+#ifndef URLDECODE_H
+#define URLDECODE_H
+
+
+#include &lt;apreq2/apreq_util.h&gt;
+#include &lt;glib.h&gt;
+
+
+/*
+Status codes
+*/
+
+#define URLUTIL_STATUS_OK                   0
+#define URLUTIL_STATUS_MEM_ALLOC_ERR       -1
+#define URLUTIL_STATUS_INVALID_PARAMS      -2
+#define URLUTIL_STATUS_EMPTY_SRCH_KEY      -3
+#define URLUTIL_STATUS_SRCH_KEY_NOT_FOUND  -4
+#define URLUTIL_STATUS_URL_STR_TOO_SHORT   -5
+#define URLUTIL_STATUS_URL_KEY_VAL_BROKEN  -6
+
+
+const char * urldecode_expand_value (GString *url,
+                                     const char *key, int key_len,
+                                     int case_sensative,
+                                     GString *temp, int *status, GString *val);
+
+
+#endif
</ins></span></pre>
</div>
</div>
<div id="footer">See you at ClueCon</div>

</body>
</html>