<!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][16333] </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=16333">16333</a></dd>
<dt>Author</dt> <dd>mikej</dd>
<dt>Date</dt> <dd>2010-01-16 23:48:36 -0600 (Sat, 16 Jan 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>move mod_spidermoney build to automake, fix spidermoneky dependencies (I think this really fixes -j builds), move mod_spidermonkey sub modules all under the same source directory and bundle their build together as one</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#freeswitchtrunkFreeswitch2005unsupportedsln">freeswitch/trunk/Freeswitch.2005.unsupported.sln</a></li>
<li><a href="#freeswitchtrunkFreeswitch2008expresssln">freeswitch/trunk/Freeswitch.2008.express.sln</a></li>
<li><a href="#freeswitchtrunkFreeswitch2008sln">freeswitch/trunk/Freeswitch.2008.sln</a></li>
<li><a href="#freeswitchtrunkMakefileam">freeswitch/trunk/Makefile.am</a></li>
<li><a href="#freeswitchtrunkbuildmodulesconfin">freeswitch/trunk/build/modules.conf.in</a></li>
<li><a href="#freeswitchtrunkconfigurein">freeswitch/trunk/configure.in</a></li>
<li><a href="#freeswitchtrunkdebianrules">freeswitch/trunk/debian/rules</a></li>
<li><a href="#freeswitchtrunkfreeswitchspec">freeswitch/trunk/freeswitch.spec</a></li>
<li><a href="#freeswitchtrunksrcmodMakefileam">freeswitch/trunk/src/mod/Makefile.am</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#freeswitchtrunksrcmodlanguagesmod_spidermonkeyMakefileam">freeswitch/trunk/src/mod/languages/mod_spidermonkey/Makefile.am</a></li>
<li><a href="#freeswitchtrunksrcmodlanguagesmod_spidermonkeymod_spidermonkey_core_db2008vcproj">freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_core_db.2008.vcproj</a></li>
<li><a href="#freeswitchtrunksrcmodlanguagesmod_spidermonkeymod_spidermonkey_core_dbc">freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_core_db.c</a></li>
<li><a href="#freeswitchtrunksrcmodlanguagesmod_spidermonkeymod_spidermonkey_core_dbvcproj">freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_core_db.vcproj</a></li>
<li><a href="#freeswitchtrunksrcmodlanguagesmod_spidermonkeymod_spidermonkey_curl2008vcproj">freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_curl.2008.vcproj</a></li>
<li><a href="#freeswitchtrunksrcmodlanguagesmod_spidermonkeymod_spidermonkey_curlc">freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_curl.c</a></li>
<li><a href="#freeswitchtrunksrcmodlanguagesmod_spidermonkeymod_spidermonkey_curlvcproj">freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_curl.vcproj</a></li>
<li><a href="#freeswitchtrunksrcmodlanguagesmod_spidermonkeymod_spidermonkey_odbc2008vcproj">freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_odbc.2008.vcproj</a></li>
<li><a href="#freeswitchtrunksrcmodlanguagesmod_spidermonkeymod_spidermonkey_odbcc">freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_odbc.c</a></li>
<li><a href="#freeswitchtrunksrcmodlanguagesmod_spidermonkeymod_spidermonkey_odbcvcproj">freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_odbc.vcproj</a></li>
<li><a href="#freeswitchtrunksrcmodlanguagesmod_spidermonkeymod_spidermonkey_skelc">freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_skel.c</a></li>
<li><a href="#freeswitchtrunksrcmodlanguagesmod_spidermonkeymod_spidermonkey_socket2008vcproj">freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_socket.2008.vcproj</a></li>
<li><a href="#freeswitchtrunksrcmodlanguagesmod_spidermonkeymod_spidermonkey_socketc">freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_socket.c</a></li>
<li><a href="#freeswitchtrunksrcmodlanguagesmod_spidermonkeymod_spidermonkey_socketvcproj">freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_socket.vcproj</a></li>
<li><a href="#freeswitchtrunksrcmodlanguagesmod_spidermonkeymod_spidermonkey_teletone2008vcproj">freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_teletone.2008.vcproj</a></li>
<li><a href="#freeswitchtrunksrcmodlanguagesmod_spidermonkeymod_spidermonkey_teletonec">freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_teletone.c</a></li>
<li><a href="#freeswitchtrunksrcmodlanguagesmod_spidermonkeymod_spidermonkey_teletonevcproj">freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_teletone.vcproj</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#freeswitchtrunksrcmodlanguagesmod_spidermonkeyMakefile">freeswitch/trunk/src/mod/languages/mod_spidermonkey/Makefile</a></li>
<li><a href="#freeswitchtrunksrcmodlanguagesmod_spidermonkeysmmak">freeswitch/trunk/src/mod/languages/mod_spidermonkey/sm.mak</a></li>
<li>freeswitch/trunk/src/mod/languages/mod_spidermonkey_core_db/</li>
<li>freeswitch/trunk/src/mod/languages/mod_spidermonkey_curl/</li>
<li>freeswitch/trunk/src/mod/languages/mod_spidermonkey_odbc/</li>
<li>freeswitch/trunk/src/mod/languages/mod_spidermonkey_skel/</li>
<li>freeswitch/trunk/src/mod/languages/mod_spidermonkey_socket/</li>
<li>freeswitch/trunk/src/mod/languages/mod_spidermonkey_teletone/</li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="freeswitchtrunkFreeswitch2005unsupportedsln"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/Freeswitch.2005.unsupported.sln (16332 => 16333)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/Freeswitch.2005.unsupported.sln        2010-01-17 03:11:56 UTC (rev 16332)
+++ freeswitch/trunk/Freeswitch.2005.unsupported.sln        2010-01-17 05:48:36 UTC (rev 16333)
</span><span class="lines">@@ -249,7 +249,7 @@
</span><span class="cx">                 {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
</span><span class="cx">         EndProjectSection
</span><span class="cx"> EndProject
</span><del>-Project(&quot;{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}&quot;) = &quot;mod_spidermonkey_core_db&quot;, &quot;src\mod\languages\mod_spidermonkey_core_db\mod_spidermonkey_core_db.vcproj&quot;, &quot;{ACFFF684-4D19-4D48-AF12-88EA1D778BDF}&quot;
</del><ins>+Project(&quot;{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}&quot;) = &quot;mod_spidermonkey_core_db&quot;, &quot;src\mod\languages\mod_spidermonkey\mod_spidermonkey_core_db.vcproj&quot;, &quot;{ACFFF684-4D19-4D48-AF12-88EA1D778BDF}&quot;
</ins><span class="cx">         ProjectSection(ProjectDependencies) = postProject
</span><span class="cx">                 {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F} = {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}
</span><span class="cx">                 {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
</span><span class="lines">@@ -257,7 +257,7 @@
</span><span class="cx">                 {204FA0DE-305D-4414-AE2E-F195A23F390D} = {204FA0DE-305D-4414-AE2E-F195A23F390D}
</span><span class="cx">         EndProjectSection
</span><span class="cx"> EndProject
</span><del>-Project(&quot;{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}&quot;) = &quot;mod_spidermonkey_teletone&quot;, &quot;src\mod\languages\mod_spidermonkey_teletone\mod_spidermonkey_teletone.vcproj&quot;, &quot;{8F992C49-6C51-412F-B2A3-34EAB708EB65}&quot;
</del><ins>+Project(&quot;{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}&quot;) = &quot;mod_spidermonkey_teletone&quot;, &quot;src\mod\languages\mod_spidermonkey\mod_spidermonkey_teletone.vcproj&quot;, &quot;{8F992C49-6C51-412F-B2A3-34EAB708EB65}&quot;
</ins><span class="cx">         ProjectSection(ProjectDependencies) = postProject
</span><span class="cx">                 {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F} = {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}
</span><span class="cx">                 {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
</span><span class="lines">@@ -274,7 +274,7 @@
</span><span class="cx">                 {4043FC6A-9A30-4577-8AD5-9B233C9575D8} = {4043FC6A-9A30-4577-8AD5-9B233C9575D8}
</span><span class="cx">         EndProjectSection
</span><span class="cx"> EndProject
</span><del>-Project(&quot;{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}&quot;) = &quot;mod_spidermonkey_odbc&quot;, &quot;src\mod\languages\mod_spidermonkey_odbc\mod_spidermonkey_odbc.vcproj&quot;, &quot;{0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}&quot;
</del><ins>+Project(&quot;{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}&quot;) = &quot;mod_spidermonkey_odbc&quot;, &quot;src\mod\languages\mod_spidermonkey\mod_spidermonkey_odbc.vcproj&quot;, &quot;{0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}&quot;
</ins><span class="cx">         ProjectSection(ProjectDependencies) = postProject
</span><span class="cx">                 {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F} = {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}
</span><span class="cx">                 {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
</span><span class="lines">@@ -371,7 +371,7 @@
</span><span class="cx">                 {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
</span><span class="cx">         EndProjectSection
</span><span class="cx"> EndProject
</span><del>-Project(&quot;{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}&quot;) = &quot;mod_spidermonkey_socket&quot;, &quot;src\mod\languages\mod_spidermonkey_socket\mod_spidermonkey_socket.vcproj&quot;, &quot;{028C7278-05D7-4E18-82FE-BE231B844F41}&quot;
</del><ins>+Project(&quot;{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}&quot;) = &quot;mod_spidermonkey_socket&quot;, &quot;src\mod\languages\mod_spidermonkey\mod_spidermonkey_socket.vcproj&quot;, &quot;{028C7278-05D7-4E18-82FE-BE231B844F41}&quot;
</ins><span class="cx">         ProjectSection(ProjectDependencies) = postProject
</span><span class="cx">                 {204FA0DE-305D-4414-AE2E-F195A23F390D} = {204FA0DE-305D-4414-AE2E-F195A23F390D}
</span><span class="cx">                 {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
</span><span class="lines">@@ -751,7 +751,7 @@
</span><span class="cx">                 {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
</span><span class="cx">         EndProjectSection
</span><span class="cx"> EndProject
</span><del>-Project(&quot;{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}&quot;) = &quot;mod_spidermonkey_curl&quot;, &quot;src\mod\languages\mod_spidermonkey_curl\mod_spidermonkey_curl.vcproj&quot;, &quot;{2CCED6DC-26FF-40F2-9585-E9E1049A4599}&quot;
</del><ins>+Project(&quot;{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}&quot;) = &quot;mod_spidermonkey_curl&quot;, &quot;src\mod\languages\mod_spidermonkey\mod_spidermonkey_curl.vcproj&quot;, &quot;{2CCED6DC-26FF-40F2-9585-E9E1049A4599}&quot;
</ins><span class="cx">         ProjectSection(ProjectDependencies) = postProject
</span><span class="cx">                 {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F} = {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}
</span><span class="cx">                 {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
</span></span></pre></div>
<a id="freeswitchtrunkFreeswitch2008expresssln"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/Freeswitch.2008.express.sln (16332 => 16333)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/Freeswitch.2008.express.sln        2010-01-17 03:11:56 UTC (rev 16332)
+++ freeswitch/trunk/Freeswitch.2008.express.sln        2010-01-17 05:48:36 UTC (rev 16333)
</span><span class="lines">@@ -216,7 +216,7 @@
</span><span class="cx">                 {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
</span><span class="cx">         EndProjectSection
</span><span class="cx"> EndProject
</span><del>-Project(&quot;{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}&quot;) = &quot;mod_spidermonkey_core_db&quot;, &quot;src\mod\languages\mod_spidermonkey_core_db\mod_spidermonkey_core_db.2008.vcproj&quot;, &quot;{ACFFF684-4D19-4D48-AF12-88EA1D778BDF}&quot;
</del><ins>+Project(&quot;{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}&quot;) = &quot;mod_spidermonkey_core_db&quot;, &quot;src\mod\languages\mod_spidermonkey\mod_spidermonkey_core_db.2008.vcproj&quot;, &quot;{ACFFF684-4D19-4D48-AF12-88EA1D778BDF}&quot;
</ins><span class="cx">         ProjectSection(ProjectDependencies) = postProject
</span><span class="cx">                 {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F} = {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}
</span><span class="cx">                 {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
</span><span class="lines">@@ -224,7 +224,7 @@
</span><span class="cx">                 {204FA0DE-305D-4414-AE2E-F195A23F390D} = {204FA0DE-305D-4414-AE2E-F195A23F390D}
</span><span class="cx">         EndProjectSection
</span><span class="cx"> EndProject
</span><del>-Project(&quot;{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}&quot;) = &quot;mod_spidermonkey_teletone&quot;, &quot;src\mod\languages\mod_spidermonkey_teletone\mod_spidermonkey_teletone.2008.vcproj&quot;, &quot;{8F992C49-6C51-412F-B2A3-34EAB708EB65}&quot;
</del><ins>+Project(&quot;{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}&quot;) = &quot;mod_spidermonkey_teletone&quot;, &quot;src\mod\languages\mod_spidermonkey\mod_spidermonkey_teletone.2008.vcproj&quot;, &quot;{8F992C49-6C51-412F-B2A3-34EAB708EB65}&quot;
</ins><span class="cx">         ProjectSection(ProjectDependencies) = postProject
</span><span class="cx">                 {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F} = {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}
</span><span class="cx">                 {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
</span><span class="lines">@@ -241,7 +241,7 @@
</span><span class="cx">                 {4043FC6A-9A30-4577-8AD5-9B233C9575D8} = {4043FC6A-9A30-4577-8AD5-9B233C9575D8}
</span><span class="cx">         EndProjectSection
</span><span class="cx"> EndProject
</span><del>-Project(&quot;{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}&quot;) = &quot;mod_spidermonkey_odbc&quot;, &quot;src\mod\languages\mod_spidermonkey_odbc\mod_spidermonkey_odbc.2008.vcproj&quot;, &quot;{0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}&quot;
</del><ins>+Project(&quot;{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}&quot;) = &quot;mod_spidermonkey_odbc&quot;, &quot;src\mod\languages\mod_spidermonkey\mod_spidermonkey_odbc.2008.vcproj&quot;, &quot;{0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}&quot;
</ins><span class="cx">         ProjectSection(ProjectDependencies) = postProject
</span><span class="cx">                 {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F} = {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}
</span><span class="cx">                 {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
</span><span class="lines">@@ -290,7 +290,7 @@
</span><span class="cx">                 {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
</span><span class="cx">         EndProjectSection
</span><span class="cx"> EndProject
</span><del>-Project(&quot;{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}&quot;) = &quot;mod_spidermonkey_socket&quot;, &quot;src\mod\languages\mod_spidermonkey_socket\mod_spidermonkey_socket.2008.vcproj&quot;, &quot;{028C7278-05D7-4E18-82FE-BE231B844F41}&quot;
</del><ins>+Project(&quot;{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}&quot;) = &quot;mod_spidermonkey_socket&quot;, &quot;src\mod\languages\mod_spidermonkey\mod_spidermonkey_socket.2008.vcproj&quot;, &quot;{028C7278-05D7-4E18-82FE-BE231B844F41}&quot;
</ins><span class="cx">         ProjectSection(ProjectDependencies) = postProject
</span><span class="cx">                 {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F} = {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}
</span><span class="cx">                 {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
</span><span class="lines">@@ -375,7 +375,7 @@
</span><span class="cx">                 {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
</span><span class="cx">         EndProjectSection
</span><span class="cx"> EndProject
</span><del>-Project(&quot;{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}&quot;) = &quot;mod_spidermonkey_curl&quot;, &quot;src\mod\languages\mod_spidermonkey_curl\mod_spidermonkey_curl.2008.vcproj&quot;, &quot;{36E854E3-CE12-4348-A125-CCF3F9D74813}&quot;
</del><ins>+Project(&quot;{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}&quot;) = &quot;mod_spidermonkey_curl&quot;, &quot;src\mod\languages\mod_spidermonkey\mod_spidermonkey_curl.2008.vcproj&quot;, &quot;{36E854E3-CE12-4348-A125-CCF3F9D74813}&quot;
</ins><span class="cx">         ProjectSection(ProjectDependencies) = postProject
</span><span class="cx">                 {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F} = {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}
</span><span class="cx">                 {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
</span></span></pre></div>
<a id="freeswitchtrunkFreeswitch2008sln"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/Freeswitch.2008.sln (16332 => 16333)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/Freeswitch.2008.sln        2010-01-17 03:11:56 UTC (rev 16332)
+++ freeswitch/trunk/Freeswitch.2008.sln        2010-01-17 05:48:36 UTC (rev 16333)
</span><span class="lines">@@ -589,7 +589,7 @@
</span><span class="cx">                 {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
</span><span class="cx">         EndProjectSection
</span><span class="cx"> EndProject
</span><del>-Project(&quot;{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}&quot;) = &quot;mod_spidermonkey_core_db&quot;, &quot;src\mod\languages\mod_spidermonkey_core_db\mod_spidermonkey_core_db.2008.vcproj&quot;, &quot;{ACFFF684-4D19-4D48-AF12-88EA1D778BDF}&quot;
</del><ins>+Project(&quot;{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}&quot;) = &quot;mod_spidermonkey_core_db&quot;, &quot;src\mod\languages\mod_spidermonkey\mod_spidermonkey_core_db.2008.vcproj&quot;, &quot;{ACFFF684-4D19-4D48-AF12-88EA1D778BDF}&quot;
</ins><span class="cx">         ProjectSection(ProjectDependencies) = postProject
</span><span class="cx">                 {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F} = {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}
</span><span class="cx">                 {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
</span><span class="lines">@@ -597,7 +597,7 @@
</span><span class="cx">                 {204FA0DE-305D-4414-AE2E-F195A23F390D} = {204FA0DE-305D-4414-AE2E-F195A23F390D}
</span><span class="cx">         EndProjectSection
</span><span class="cx"> EndProject
</span><del>-Project(&quot;{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}&quot;) = &quot;mod_spidermonkey_teletone&quot;, &quot;src\mod\languages\mod_spidermonkey_teletone\mod_spidermonkey_teletone.2008.vcproj&quot;, &quot;{8F992C49-6C51-412F-B2A3-34EAB708EB65}&quot;
</del><ins>+Project(&quot;{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}&quot;) = &quot;mod_spidermonkey_teletone&quot;, &quot;src\mod\languages\mod_spidermonkey\mod_spidermonkey_teletone.2008.vcproj&quot;, &quot;{8F992C49-6C51-412F-B2A3-34EAB708EB65}&quot;
</ins><span class="cx">         ProjectSection(ProjectDependencies) = postProject
</span><span class="cx">                 {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F} = {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}
</span><span class="cx">                 {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
</span><span class="lines">@@ -614,7 +614,7 @@
</span><span class="cx">                 {4043FC6A-9A30-4577-8AD5-9B233C9575D8} = {4043FC6A-9A30-4577-8AD5-9B233C9575D8}
</span><span class="cx">         EndProjectSection
</span><span class="cx"> EndProject
</span><del>-Project(&quot;{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}&quot;) = &quot;mod_spidermonkey_odbc&quot;, &quot;src\mod\languages\mod_spidermonkey_odbc\mod_spidermonkey_odbc.2008.vcproj&quot;, &quot;{0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}&quot;
</del><ins>+Project(&quot;{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}&quot;) = &quot;mod_spidermonkey_odbc&quot;, &quot;src\mod\languages\mod_spidermonkey\mod_spidermonkey_odbc.2008.vcproj&quot;, &quot;{0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}&quot;
</ins><span class="cx">         ProjectSection(ProjectDependencies) = postProject
</span><span class="cx">                 {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F} = {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}
</span><span class="cx">                 {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
</span><span class="lines">@@ -663,7 +663,7 @@
</span><span class="cx">                 {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
</span><span class="cx">         EndProjectSection
</span><span class="cx"> EndProject
</span><del>-Project(&quot;{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}&quot;) = &quot;mod_spidermonkey_socket&quot;, &quot;src\mod\languages\mod_spidermonkey_socket\mod_spidermonkey_socket.2008.vcproj&quot;, &quot;{028C7278-05D7-4E18-82FE-BE231B844F41}&quot;
</del><ins>+Project(&quot;{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}&quot;) = &quot;mod_spidermonkey_socket&quot;, &quot;src\mod\languages\mod_spidermonkey\mod_spidermonkey_socket.2008.vcproj&quot;, &quot;{028C7278-05D7-4E18-82FE-BE231B844F41}&quot;
</ins><span class="cx">         ProjectSection(ProjectDependencies) = postProject
</span><span class="cx">                 {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F} = {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}
</span><span class="cx">                 {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
</span><span class="lines">@@ -748,7 +748,7 @@
</span><span class="cx">                 {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
</span><span class="cx">         EndProjectSection
</span><span class="cx"> EndProject
</span><del>-Project(&quot;{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}&quot;) = &quot;mod_spidermonkey_curl&quot;, &quot;src\mod\languages\mod_spidermonkey_curl\mod_spidermonkey_curl.2008.vcproj&quot;, &quot;{36E854E3-CE12-4348-A125-CCF3F9D74813}&quot;
</del><ins>+Project(&quot;{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}&quot;) = &quot;mod_spidermonkey_curl&quot;, &quot;src\mod\languages\mod_spidermonkey\mod_spidermonkey_curl.2008.vcproj&quot;, &quot;{36E854E3-CE12-4348-A125-CCF3F9D74813}&quot;
</ins><span class="cx">         ProjectSection(ProjectDependencies) = postProject
</span><span class="cx">                 {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F} = {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}
</span><span class="cx">                 {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
</span></span></pre></div>
<a id="freeswitchtrunkMakefileam"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/Makefile.am (16332 => 16333)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/Makefile.am        2010-01-17 03:11:56 UTC (rev 16332)
+++ freeswitch/trunk/Makefile.am        2010-01-17 05:48:36 UTC (rev 16333)
</span><span class="lines">@@ -355,11 +355,6 @@
</span><span class="cx">           fi ; \
</span><span class="cx">         fi ;
</span><span class="cx"> 
</span><del>-JS_DIR=$(switch_srcdir)/libs/js
-JSLA=$(JS_DIR)/libjs.la
-$(JSLA): mod_spidermonkey-all
-mod_spidermonkey_curl-all mod_spidermonkey_teletone-all mod_spidermonkey_core_db-all mod_spidermonkey_socket-all mod_spidermonky_odbc-all mod_spidermonkey_curl-install mod_spidermonkey_teletone-install mod_spidermonkey_core_db-install mod_spidermonkey_socket-install mod_spidermonky_odbc-install: $(JSLA)
-
</del><span class="cx"> ##
</span><span class="cx"> ## Dependency targets
</span><span class="cx"> ##
</span></span></pre></div>
<a id="freeswitchtrunkbuildmodulesconfin"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/build/modules.conf.in (16332 => 16333)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/build/modules.conf.in        2010-01-17 03:11:56 UTC (rev 16332)
+++ freeswitch/trunk/build/modules.conf.in        2010-01-17 05:48:36 UTC (rev 16333)
</span><span class="lines">@@ -76,11 +76,6 @@
</span><span class="cx"> #formats/mod_shell_stream
</span><span class="cx"> #languages/mod_python
</span><span class="cx"> languages/mod_spidermonkey
</span><del>-languages/mod_spidermonkey_curl
-languages/mod_spidermonkey_teletone
-languages/mod_spidermonkey_core_db
-languages/mod_spidermonkey_socket
-#languages/mod_spidermonkey_odbc
</del><span class="cx"> languages/mod_lua
</span><span class="cx"> #languages/mod_perl
</span><span class="cx"> #languages/mod_yaml
</span></span></pre></div>
<a id="freeswitchtrunkconfigurein"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/configure.in (16332 => 16333)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/configure.in        2010-01-17 03:11:56 UTC (rev 16332)
+++ freeswitch/trunk/configure.in        2010-01-17 05:48:36 UTC (rev 16333)
</span><span class="lines">@@ -705,7 +705,7 @@
</span><span class="cx"> AC_SUBST(GETSOUNDS)
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-LIBCURL_CHECK_CONFIG([yes], [7.13.0], [LIBCURL_DEPS=''], [LIBCURL_DEPS='${switch_srcdir}/libs/curl/lib/libcurl.la';LIBCURL='${switch_srcdir}/libs/curl/lib/libcurl.la';LIBCURL_CPPFLAGS='-I${switch_srcdir}/libs/curl/include'])
</del><ins>+LIBCURL_CHECK_CONFIG([yes], [7.13.0], [LIBCURL_DEPS=''], [LIBCURL_DEPS='${switch_builddir}/libs/curl/lib/libcurl.la';LIBCURL='${switch_builddir}/libs/curl/lib/libcurl.la';LIBCURL_CPPFLAGS='-I${switch_srcdir}/libs/curl/include'])
</ins><span class="cx"> AC_SUBST(LIBCURL_DEPS)
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -870,6 +870,7 @@
</span><span class="cx">                 src/mod/asr_tts/mod_unimrcp/Makefile
</span><span class="cx">                 src/mod/languages/mod_java/Makefile
</span><span class="cx">                 src/mod/languages/mod_python/Makefile
</span><ins>+                src/mod/languages/mod_spidermonkey/Makefile
</ins><span class="cx">                 src/mod/event_handlers/mod_erlang_event/Makefile
</span><span class="cx">                 src/include/switch_am_config.h
</span><span class="cx">                 build/getsounds.sh
</span></span></pre></div>
<a id="freeswitchtrunkdebianrules"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/debian/rules (16332 => 16333)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/debian/rules        2010-01-17 03:11:56 UTC (rev 16332)
+++ freeswitch/trunk/debian/rules        2010-01-17 05:48:36 UTC (rev 16333)
</span><span class="lines">@@ -8,8 +8,6 @@
</span><span class="cx"> export DH_COMPAT=4
</span><span class="cx"> export DEB_DH_INSTALL_SOURCEDIR=debian/tmp
</span><span class="cx"> export PASSTHRU_CODEC_MODULES=codecs/mod_g729 codecs/mod_g723_1 codecs/mod_amr
</span><del>-export SPIDERMONKEY_MODULES=languages/mod_spidermonkey languages/mod_spidermonkey_core_db languages/mod_spidermonkey_odbc \
-                            languages/mod_spidermonkey_socket languages/mod_spidermonkey_teletone
</del><span class="cx"> # Modules listed by those built by default, then those that are added in this package
</span><span class="cx"> export APPLICATIONS_MODULES=applications/mod_cluechoo applications/mod_commands applications/mod_conference applications/mod_dptools \
</span><span class="cx">                             applications/mod_enum applications/mod_esf applications/mod_expr applications/mod_fifo applications/mod_fsv \
</span><span class="lines">@@ -26,15 +24,15 @@
</span><span class="cx">                          endpoints/mod_loopback ../../libs/openzap/mod_openzap endpoints/mod_skypiax
</span><span class="cx"> export EVENT_HANDLERS_MODULES=event_handlers/mod_event_multicast event_handlers/mod_event_socket event_handlers/mod_cdr_csv
</span><span class="cx"> export FORMATS_MODULES=formats/mod_local_stream formats/mod_native_file formats/mod_sndfile formats/mod_tone_stream formats/mod_shout
</span><del>-export LANGUAGES_MODULES=languages/mod_perl languages/mod_lua
</del><ins>+export LANGUAGES_MODULES=languages/mod_spidermonkey languages/mod_perl languages/mod_lua
</ins><span class="cx"> export LOGGERS_MODULES=loggers/mod_console loggers/mod_logfile loggers/mod_syslog
</span><span class="cx"> export SAY_MODULES=say/mod_say_en say/mod_say_it say/mod_say_de say/mod_say_fr say/mod_say_es say/mod_say_nl say/mod_say_ru
</span><span class="cx"> export TIMERS_MODULES=
</span><span class="cx"> export DISABLED_MODULES=applications/mod_soundtouch directories/mod_ldap languages/mod_java languages/mod_python \
</span><del>-                        languages/mod_spidermonkey_skel ast_tts/mod_cepstral asr_tts/mod_lumenvox endpoints/mod_wanpipe \
</del><ins>+                        asr_tts/mod_cepstral asr_tts/mod_lumenvox endpoints/mod_wanpipe \
</ins><span class="cx">                         event_handlers/mod_event_test event_handlers/mod_radius_cdr event_handlers/mod_zeroconf
</span><span class="cx"> export XML_INT_MODULES=xml_int/mod_xml_rpc  xml_int/mod_xml_curl xml_int/mod_xml_cdr
</span><del>-export MYMODULES=$(PASSTHRU_CODEC_MODULES) $(SPIDERMONKEY_MODULES) $(APPLICATIONS_MODULES) $(ASR_TTS_MODULES) $(CODECS_MODULES) $(DIALPLANS_MODULES) $(DIRECTORIES_MODULES) $(DOTNET_MODULES) $(ENDPOINTS_MODULES) $(EVENT_HANDLERS_MODULES) $(FORMATS_MODULES) $(LANGUAGES_MODULES) $(LOGGERS_MODULES) $(SAY_MODULES) $(TIMERS_MODULES) $(XML_INT_MODULES)
</del><ins>+export MYMODULES=$(PASSTHRU_CODEC_MODULES) $(APPLICATIONS_MODULES) $(ASR_TTS_MODULES) $(CODECS_MODULES) $(DIALPLANS_MODULES) $(DIRECTORIES_MODULES) $(DOTNET_MODULES) $(ENDPOINTS_MODULES) $(EVENT_HANDLERS_MODULES) $(FORMATS_MODULES) $(LANGUAGES_MODULES) $(LOGGERS_MODULES) $(SAY_MODULES) $(TIMERS_MODULES) $(XML_INT_MODULES)
</ins><span class="cx"> export MODULES=$(MYMODULES)
</span><span class="cx"> 
</span><span class="cx"> ifndef AUTOCONF
</span></span></pre></div>
<a id="freeswitchtrunkfreeswitchspec"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/freeswitch.spec (16332 => 16333)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/freeswitch.spec        2010-01-17 03:11:56 UTC (rev 16332)
+++ freeswitch/trunk/freeswitch.spec        2010-01-17 05:48:36 UTC (rev 16333)
</span><span class="lines">@@ -228,7 +228,6 @@
</span><span class="cx"> %endif
</span><span class="cx"> 
</span><span class="cx"> PASSTHRU_CODEC_MODULES=&quot;codecs/mod_g729 codecs/mod_g723_1 codecs/mod_amr codecs/mod_amrwb&quot;
</span><del>-SPIDERMONKEY_MODULES=&quot;languages/mod_spidermonkey languages/mod_spidermonkey_curl languages/mod_spidermonkey_core_db languages/mod_spidermonkey_odbc languages/mod_spidermonkey_socket languages/mod_spidermonkey_teletone&quot;
</del><span class="cx"> APPLICATIONS_MODULES=&quot;applications/mod_commands applications/mod_conference applications/mod_dptools applications/mod_enum applications/mod_esf applications/mod_expr applications/mod_fifo applications/mod_limit applications/mod_rss applications/mod_voicemail applications/mod_directory applications/mod_fsv applications/mod_lcr applications/mod_easyroute applications/mod_stress applications/mod_vmd applications/mod_limit applications/mod_soundtouch applications/mod_fax&quot;
</span><span class="cx"> CODECS_MODULES=&quot;codecs/mod_ilbc codecs/mod_h26x codecs/mod_voipcodecs codecs/mod_speex codecs/mod_celt codecs/mod_siren codecs/mod_bv&quot;
</span><span class="cx"> DIALPLANS_MODULES=&quot;dialplans/mod_dialplan_asterisk dialplans/mod_dialplan_directory dialplans/mod_dialplan_xml&quot;
</span><span class="lines">@@ -237,13 +236,13 @@
</span><span class="cx"> ASR_TTS_MODULES=&quot;asr_tts/mod_pocketsphinx asr_tts/mod_flite asr_tts/mod_unimrcp&quot;
</span><span class="cx"> EVENT_HANDLERS_MODULES=&quot;event_handlers/mod_event_multicast event_handlers/mod_event_socket event_handlers/mod_cdr_csv&quot;
</span><span class="cx"> FORMATS_MODULES=&quot;formats/mod_local_stream formats/mod_native_file formats/mod_sndfile formats/mod_tone_stream formats/mod_shout&quot;
</span><del>-LANGUAGES_MODULES=&quot;languages/mod_perl languages/mod_lua languages/mod_python&quot;
</del><ins>+LANGUAGES_MODULES=&quot;languages/mod_spidermonkey languages/mod_perl languages/mod_lua languages/mod_python&quot;
</ins><span class="cx"> LOGGERS_MODULES=&quot;loggers/mod_console loggers/mod_logfile loggers/mod_syslog&quot;
</span><span class="cx"> SAY_MODULES=&quot;say/mod_say_en say/mod_say_de say/mod_say_fr&quot;
</span><span class="cx"> TIMERS_MODULES=
</span><del>-DISABLED_MODULES=&quot;applications/mod_soundtouch languages/mod_spidermonkey_skel ast_tts/mod_cepstral asr_tts/mod_lumenvox event_handlers/mod_event_test event_handlers/mod_radius_cdr event_handlers/mod_zeroconf languages/mod_managed languages/mod_java say/mod_say_it say/mod_say_es say/mod_say_nl languages/mod_yaml&quot;
</del><ins>+DISABLED_MODULES=&quot;applications/mod_soundtouch asr_tts/mod_cepstral asr_tts/mod_lumenvox event_handlers/mod_event_test event_handlers/mod_radius_cdr event_handlers/mod_zeroconf languages/mod_managed languages/mod_java say/mod_say_it say/mod_say_es say/mod_say_nl languages/mod_yaml&quot;
</ins><span class="cx"> XML_INT_MODULES=&quot;xml_int/mod_xml_rpc  xml_int/mod_xml_curl xml_int/mod_xml_cdr &quot;
</span><del>-MYMODULES=&quot;$PASSTHRU_CODEC_MODULES $SPIDERMONKEY_MODULES $APPLICATIONS_MODULES $CODECS_MODULES $DIALPLANS_MODULES $DIRECTORIES_MODULES $ENDPOINTS_MODULES $ASR_TTS_MODULES $EVENT_HANDLERS_MODULES $FORMATS_MODULES $LANGUAGES_MODULES $LOGGERS_MODULES $SAY_MODULES $TIMERS_MODULES $XML_INT_MODULES&quot;
</del><ins>+MYMODULES=&quot;$PASSTHRU_CODEC_MODULES $APPLICATIONS_MODULES $CODECS_MODULES $DIALPLANS_MODULES $DIRECTORIES_MODULES $ENDPOINTS_MODULES $ASR_TTS_MODULES $EVENT_HANDLERS_MODULES $FORMATS_MODULES $LANGUAGES_MODULES $LOGGERS_MODULES $SAY_MODULES $TIMERS_MODULES $XML_INT_MODULES&quot;
</ins><span class="cx"> 
</span><span class="cx"> export MODULES=$MYMODULES
</span><span class="cx"> test ! -f  modules.conf || rm -f modules.conf
</span></span></pre></div>
<a id="freeswitchtrunksrcmodMakefileam"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/Makefile.am (16332 => 16333)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/Makefile.am        2010-01-17 03:11:56 UTC (rev 16332)
+++ freeswitch/trunk/src/mod/Makefile.am        2010-01-17 05:48:36 UTC (rev 16333)
</span><span class="lines">@@ -35,11 +35,6 @@
</span><span class="cx">         fi; \
</span><span class="cx">         test -z &quot;$$fail&quot; ;
</span><span class="cx"> 
</span><del>-JS_DIR=$(switch_srcdir)/libs/js
-JSLA=$(JS_DIR)/libjs.la
-$(JSLA): mod_spidermonkey-all
-mod_spidermonkey_curl-all mod_spidermonkey_teletone-all mod_spidermonkey_core_db-all mod_spidermonkey_socket-all mod_spidermonky_odbc-all mod_spidermonkey_curl-install mod_spidermonkey_teletone-install mod_spidermonkey_core_db-install mod_spidermonkey_socket-install mod_spidermonky_odbc-install: $(JSLA)
-
</del><span class="cx"> .DEFAULT:
</span><span class="cx">         @if test -z &quot;`echo $@ | grep all`&quot;; then  $(MAKE) $(AM_MAKEFLAGS) $@-all ; else echo Unknown target `echo $@ | sed -e 's|-all||'`; exit 1; fi
</span><span class="cx"> 
</span></span></pre></div>
<a id="freeswitchtrunksrcmodlanguagesmod_spidermonkeyMakefile"></a>
<div class="delfile"><h4>Deleted: freeswitch/trunk/src/mod/languages/mod_spidermonkey/Makefile</h4></div>
<a id="freeswitchtrunksrcmodlanguagesmod_spidermonkeyMakefileam"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/src/mod/languages/mod_spidermonkey/Makefile.am (0 => 16333)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/languages/mod_spidermonkey/Makefile.am                                (rev 0)
+++ freeswitch/trunk/src/mod/languages/mod_spidermonkey/Makefile.am        2010-01-17 05:48:36 UTC (rev 16333)
</span><span class="lines">@@ -0,0 +1,71 @@
</span><ins>+include $(top_srcdir)/build/modmake.rulesam
+
+MODNAME=mod_spidermonkey
+
+CURL_DIR=$(switch_srcdir)/libs/curl
+CURL_BUILDDIR=$(switch_builddir)/libs/curl
+CURLLA=${switch_builddir}/libs/curl/lib/libcurl.la
+
+JS_DIR=$(switch_srcdir)/libs/js
+JS_BUILDDIR=$(switch_builddir)/libs/js
+JSLA=$(JS_BUILDDIR)/libjs.la
+
+AM_CFLAGS  += -I. -I$(JS_DIR)/src -I$(JS_DIR)/nsprpub/dist/include/nspr
+AM_CFLAGS  += -DXP_UNIX  -DJS_THREADSAFE -DJS_HAS_FILE_OBJECT=1 -DJS_HAS_XML_SUPPORT=1
+AM_LIBADD   = $(switch_builddir)/libfreeswitch.la $(JSLA)
+AM_LDFLAGS += -avoid-version -module -no-undefined -shared 
+AM_LDFLAGS += -L$(JS_BUILDDIR)/nsprpub/dist/lib -lnspr4 $(JS_BUILDDIR)/nsprpub/pr/src/libnspr4.*
+BUILT_SOURCES = $(JSLA) $(LIBCURL_DEPS)
+
+mod_LTLIBRARIES              = mod_spidermonkey.la 
+mod_spidermonkey_la_SOURCES  = mod_spidermonkey.c
+mod_spidermonkey_la_CFLAGS   = $(AM_CFLAGS) $(LIBCURL_CPPFLAGS)
+mod_spidermonkey_la_LIBADD   = $(AM_LIBADD)
+mod_spidermonkey_la_LDFLAGS  = $(AM_LDFLAGS) $(LIBCURL)
+
+mod_LTLIBRARIES             += mod_spidermonkey_curl.la
+mod_spidermonkey_curl_la_SOURCES  = mod_spidermonkey_curl.c
+mod_spidermonkey_curl_la_CFLAGS   = $(AM_CFLAGS) $(LIBCURL_CPPFLAGS)
+mod_spidermonkey_curl_la_LIBADD   = $(AM_LIBADD)
+mod_spidermonkey_curl_la_LDFLAGS  = $(AM_LDFLAGS) $(LIBCURL)
+
+mod_LTLIBRARIES             += mod_spidermonkey_socket.la
+mod_spidermonkey_socket_la_SOURCES  = mod_spidermonkey_socket.c
+mod_spidermonkey_socket_la_CFLAGS   = $(AM_CFLAGS)
+mod_spidermonkey_socket_la_LIBADD   = $(AM_LIBADD)
+mod_spidermonkey_socket_la_LDFLAGS  = $(AM_LDFLAGS)
+
+mod_LTLIBRARIES             += mod_spidermonkey_core_db.la 
+mod_spidermonkey_core_db_la_SOURCES  = mod_spidermonkey_core_db.c
+mod_spidermonkey_core_db_la_CFLAGS   = $(AM_CFLAGS)
+mod_spidermonkey_core_db_la_LIBADD   = $(AM_LIBADD)
+mod_spidermonkey_core_db_la_LDFLAGS  = $(AM_LDFLAGS)
+
+mod_LTLIBRARIES             += mod_spidermonkey_teletone.la
+mod_spidermonkey_teletone_la_SOURCES  = mod_spidermonkey_teletone.c
+mod_spidermonkey_teletone_la_CFLAGS   = $(AM_CFLAGS) -I$(switch_srcdir)/libs/libteletone/src
+mod_spidermonkey_teletone_la_LIBADD   = $(AM_LIBADD)
+mod_spidermonkey_teletone_la_LDFLAGS  = $(AM_LDFLAGS)
+
+if HAVE_ODBC
+mod_LTLIBRARIES             += mod_spidermonkey_odbc.la
+mod_spidermonkey_odbc_la_SOURCES  = mod_spidermonkey_odbc.c
+mod_spidermonkey_odbc_la_CFLAGS   = $(AM_CFLAGS)
+mod_spidermonkey_odbc_la_LIBADD   = $(AM_LIBADD)
+mod_spidermonkey_odbc_la_LDFLAGS  = $(AM_LDFLAGS)
+endif
+
+$(SOURCES): $(BUILT_SOURCES)
+
+$(JSLA): $(JS_DIR) $(JS_DIR)/.update
+        cd $(JS_BUILDDIR)/nsprpub &amp;&amp; $(MAKE) -j1 &amp;&amp; cd $(JS_BUILDDIR) &amp;&amp; $(MAKE)
+        $(TOUCH_TARGET)
+
+$(CURLLA):
+        @cd $(CURL_BUILDDIR) &amp;&amp; $(MAKE)
+        $(TOUCH_TARGET)
+
+install-exec-local: $(DESTDIR)$(libdir)/libjs.la
+
+$(DESTDIR)$(libdir)/libjs.la: $(JSLA)
+        cd $(JS_BUILDDIR)/nsprpub/ &amp;&amp; $(MAKE) -j1 install &amp;&amp; cd $(JS_BUILDDIR) &amp;&amp; $(MAKE) install
</ins></span></pre></div>
<a id="freeswitchtrunksrcmodlanguagesmod_spidermonkeymod_spidermonkey_core_db2008vcprojfromrev16304freeswitchtrunksrcmodlanguagesmod_spidermonkey_core_dbmod_spidermonkey_core_db2008vcproj"></a>
<div class="copfile"><h4>Copied: freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_core_db.2008.vcproj (from rev 16304, freeswitch/trunk/src/mod/languages/mod_spidermonkey_core_db/mod_spidermonkey_core_db.2008.vcproj) (0 => 16333)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_core_db.2008.vcproj                                (rev 0)
+++ freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_core_db.2008.vcproj        2010-01-17 05:48:36 UTC (rev 16333)
</span><span class="lines">@@ -0,0 +1,295 @@
</span><ins>+&lt;?xml version=&quot;1.0&quot; encoding=&quot;Windows-1252&quot;?&gt;
+&lt;VisualStudioProject
+        ProjectType=&quot;Visual C++&quot;
+        Version=&quot;9.00&quot;
+        Name=&quot;mod_spidermonkey_core_db&quot;
+        ProjectGUID=&quot;{ACFFF684-4D19-4D48-AF12-88EA1D778BDF}&quot;
+        RootNamespace=&quot;mod_spidermonkey_core_db&quot;
+        Keyword=&quot;Win32Proj&quot;
+        TargetFrameworkVersion=&quot;131072&quot;
+        &gt;
+        &lt;Platforms&gt;
+                &lt;Platform
+                        Name=&quot;Win32&quot;
+                /&gt;
+                &lt;Platform
+                        Name=&quot;x64&quot;
+                /&gt;
+        &lt;/Platforms&gt;
+        &lt;ToolFiles&gt;
+        &lt;/ToolFiles&gt;
+        &lt;Configurations&gt;
+                &lt;Configuration
+                        Name=&quot;Debug|Win32&quot;
+                        ConfigurationType=&quot;2&quot;
+                        InheritedPropertySheets=&quot;..\..\..\..\w32\winlibs.vsprops;..\..\..\..\w32\module_debug.vsprops;..\..\..\..\w32\spidermonkey.vsprops&quot;
+                        CharacterSet=&quot;2&quot;
+                        &gt;
+                        &lt;Tool
+                                Name=&quot;VCPreBuildEventTool&quot;
+                                CommandLine=&quot;&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCustomBuildTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXMLDataGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCWebServiceProxyGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCMIDLTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCLCompilerTool&quot;
+                                AdditionalIncludeDirectories=&quot;&quot;
+                                UsePrecompiledHeader=&quot;0&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCManagedResourceCompilerTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCResourceCompilerTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCPreLinkEventTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCLinkerTool&quot;
+                                AdditionalLibraryDirectories=&quot;&quot;
+                                RandomizedBaseAddress=&quot;1&quot;
+                                DataExecutionPrevention=&quot;0&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCALinkTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCManifestTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXDCMakeTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCBscMakeTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCFxCopTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCAppVerifierTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCPostBuildEventTool&quot;
+                        /&gt;
+                &lt;/Configuration&gt;
+                &lt;Configuration
+                        Name=&quot;Debug|x64&quot;
+                        ConfigurationType=&quot;2&quot;
+                        InheritedPropertySheets=&quot;..\..\..\..\w32\winlibs.vsprops;..\..\..\..\w32\module_debug.vsprops;..\..\..\..\w32\spidermonkey.vsprops&quot;
+                        CharacterSet=&quot;2&quot;
+                        &gt;
+                        &lt;Tool
+                                Name=&quot;VCPreBuildEventTool&quot;
+                                CommandLine=&quot;&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCustomBuildTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXMLDataGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCWebServiceProxyGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCMIDLTool&quot;
+                                TargetEnvironment=&quot;3&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCLCompilerTool&quot;
+                                AdditionalIncludeDirectories=&quot;&quot;
+                                UsePrecompiledHeader=&quot;0&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCManagedResourceCompilerTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCResourceCompilerTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCPreLinkEventTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCLinkerTool&quot;
+                                OutputFile=&quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)/mod/$(ProjectName).dll&quot;
+                                AdditionalLibraryDirectories=&quot;&quot;
+                                RandomizedBaseAddress=&quot;1&quot;
+                                DataExecutionPrevention=&quot;0&quot;
+                                TargetMachine=&quot;17&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCALinkTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCManifestTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXDCMakeTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCBscMakeTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCFxCopTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCAppVerifierTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCPostBuildEventTool&quot;
+                        /&gt;
+                &lt;/Configuration&gt;
+                &lt;Configuration
+                        Name=&quot;Release|Win32&quot;
+                        ConfigurationType=&quot;2&quot;
+                        InheritedPropertySheets=&quot;..\..\..\..\w32\winlibs.vsprops;..\..\..\..\w32\module_release.vsprops;..\..\..\..\w32\spidermonkey.vsprops&quot;
+                        CharacterSet=&quot;2&quot;
+                        &gt;
+                        &lt;Tool
+                                Name=&quot;VCPreBuildEventTool&quot;
+                                CommandLine=&quot;&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCustomBuildTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXMLDataGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCWebServiceProxyGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCMIDLTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCLCompilerTool&quot;
+                                AdditionalIncludeDirectories=&quot;&quot;
+                                UsePrecompiledHeader=&quot;0&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCManagedResourceCompilerTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCResourceCompilerTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCPreLinkEventTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCLinkerTool&quot;
+                                AdditionalLibraryDirectories=&quot;&quot;
+                                RandomizedBaseAddress=&quot;1&quot;
+                                DataExecutionPrevention=&quot;0&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCALinkTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCManifestTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXDCMakeTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCBscMakeTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCFxCopTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCAppVerifierTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCPostBuildEventTool&quot;
+                        /&gt;
+                &lt;/Configuration&gt;
+                &lt;Configuration
+                        Name=&quot;Release|x64&quot;
+                        ConfigurationType=&quot;2&quot;
+                        InheritedPropertySheets=&quot;..\..\..\..\w32\winlibs.vsprops;..\..\..\..\w32\module_release.vsprops;..\..\..\..\w32\spidermonkey.vsprops&quot;
+                        CharacterSet=&quot;2&quot;
+                        &gt;
+                        &lt;Tool
+                                Name=&quot;VCPreBuildEventTool&quot;
+                                CommandLine=&quot;&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCustomBuildTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXMLDataGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCWebServiceProxyGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCMIDLTool&quot;
+                                TargetEnvironment=&quot;3&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCLCompilerTool&quot;
+                                AdditionalIncludeDirectories=&quot;&quot;
+                                UsePrecompiledHeader=&quot;0&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCManagedResourceCompilerTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCResourceCompilerTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCPreLinkEventTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCLinkerTool&quot;
+                                OutputFile=&quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)/mod/$(ProjectName).dll&quot;
+                                AdditionalLibraryDirectories=&quot;&quot;
+                                RandomizedBaseAddress=&quot;1&quot;
+                                DataExecutionPrevention=&quot;0&quot;
+                                TargetMachine=&quot;17&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCALinkTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCManifestTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXDCMakeTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCBscMakeTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCFxCopTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCAppVerifierTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCPostBuildEventTool&quot;
+                        /&gt;
+                &lt;/Configuration&gt;
+        &lt;/Configurations&gt;
+        &lt;References&gt;
+        &lt;/References&gt;
+        &lt;Files&gt;
+                &lt;File
+                        RelativePath=&quot;.\mod_spidermonkey_core_db.c&quot;
+                        &gt;
+                &lt;/File&gt;
+        &lt;/Files&gt;
+        &lt;Globals&gt;
+        &lt;/Globals&gt;
+&lt;/VisualStudioProject&gt;
</ins></span></pre></div>
<a id="freeswitchtrunksrcmodlanguagesmod_spidermonkeymod_spidermonkey_core_dbcfromrev16304freeswitchtrunksrcmodlanguagesmod_spidermonkey_core_dbmod_spidermonkey_core_dbc"></a>
<div class="copfile"><h4>Copied: freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_core_db.c (from rev 16304, freeswitch/trunk/src/mod/languages/mod_spidermonkey_core_db/mod_spidermonkey_core_db.c) (0 => 16333)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_core_db.c                                (rev 0)
+++ freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_core_db.c        2010-01-17 05:48:36 UTC (rev 16333)
</span><span class="lines">@@ -0,0 +1,474 @@
</span><ins>+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2005-2009, Anthony Minessale II &lt;anthm@freeswitch.org&gt;
+ *
+ * Version: MPL 1.1
+ *
+ * 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 FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * Anthony Minessale II &lt;anthm@freeswitch.org&gt;
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * Anthony Minessale II &lt;anthm@freeswitch.org&gt;
+ *
+ *
+ * mod_spidermonkey_DB.c -- DB Javascript Module
+ *
+ */
+#include &quot;mod_spidermonkey.h&quot;
+
+static const char modname[] = &quot;CoreDB&quot;;
+
+struct db_obj {
+        switch_memory_pool_t *pool;
+        switch_core_db_t *db;
+        switch_core_db_stmt_t *stmt;
+        char *dbname;
+        char code_buffer[2048];
+        JSContext *cx;
+        JSObject *obj;
+};
+
+
+/* DB Object */
+/*********************************************************************************/
+static JSBool db_construct(JSContext * cx, JSObject * obj, uintN argc, jsval * argv, jsval * rval)
+{
+        switch_memory_pool_t *pool;
+        switch_core_db_t *db;
+        struct db_obj *dbo;
+
+        if (argc &gt; 0) {
+                char *dbname = JS_GetStringBytes(JS_ValueToString(cx, argv[0]));
+                switch_core_new_memory_pool(&amp;pool);
+                if (!(db = switch_core_db_open_file(dbname))) {
+                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, &quot;Cannot Open DB!\n&quot;);
+                        switch_core_destroy_memory_pool(&amp;pool);
+                        return JS_FALSE;
+                }
+                dbo = switch_core_alloc(pool, sizeof(*dbo));
+                dbo-&gt;pool = pool;
+                dbo-&gt;dbname = switch_core_strdup(pool, dbname);
+                dbo-&gt;cx = cx;
+                dbo-&gt;obj = obj;
+                dbo-&gt;db = db;
+                JS_SetPrivate(cx, obj, dbo);
+                return JS_TRUE;
+        }
+
+        return JS_FALSE;
+}
+
+static JSBool db_close(JSContext * cx, JSObject * obj, uintN argc, jsval * argv, jsval * rval)
+{
+        struct db_obj *dbo = JS_GetPrivate(cx, obj);
+
+        if (dbo) {
+                if (dbo-&gt;stmt) {
+                        switch_core_db_finalize(dbo-&gt;stmt);
+                        dbo-&gt;stmt = NULL;
+                }
+                if (dbo-&gt;db) {
+                        switch_core_db_close(dbo-&gt;db);
+                        dbo-&gt;db = NULL;
+                }
+        }
+
+        return JS_TRUE;
+}
+
+static void db_destroy(JSContext * cx, JSObject * obj)
+{
+        struct db_obj *dbo = JS_GetPrivate(cx, obj);
+
+        if (dbo) {
+                switch_memory_pool_t *pool = dbo-&gt;pool;
+                jsval rval = JS_TRUE;
+
+                db_close(cx, obj, 0, NULL, &amp;rval);
+                switch_core_destroy_memory_pool(&amp;pool);
+                pool = NULL;
+        }
+}
+
+
+static int db_callback(void *pArg, int argc, char **argv, char **columnNames)
+{
+        struct db_obj *dbo = pArg;
+        char code[1024];
+        jsval rval;
+        int x = 0;
+
+        switch_snprintf(code, sizeof(code), &quot;~var _Db_RoW_ = {}&quot;);
+        eval_some_js(code, dbo-&gt;cx, dbo-&gt;obj, &amp;rval);
+
+        for (x = 0; x &lt; argc; x++) {
+                switch_snprintf(code, sizeof(code), &quot;~_Db_RoW_[\&quot;%s\&quot;] = \&quot;%s\&quot;&quot;, columnNames[x], argv[x]);
+                eval_some_js(code, dbo-&gt;cx, dbo-&gt;obj, &amp;rval);
+        }
+
+        switch_snprintf(code, sizeof(code), &quot;~%s(_Db_RoW_)&quot;, dbo-&gt;code_buffer);
+        eval_some_js(code, dbo-&gt;cx, dbo-&gt;obj, &amp;rval);
+
+        switch_snprintf(code, sizeof(code), &quot;~delete _Db_RoW_&quot;);
+        eval_some_js(code, dbo-&gt;cx, dbo-&gt;obj, &amp;rval);
+
+        return 0;
+}
+
+static JSBool db_exec(JSContext * cx, JSObject * obj, uintN argc, jsval * argv, jsval * rval)
+{
+        struct db_obj *dbo = JS_GetPrivate(cx, obj);
+        *rval = INT_TO_JSVAL(0);
+
+        if (!dbo-&gt;db) {
+                return JS_FALSE;
+        }
+
+        if (argc &gt; 0) {
+                char *sql = JS_GetStringBytes(JS_ValueToString(cx, argv[0]));
+                char *err = NULL;
+                void *arg = NULL;
+                switch_core_db_callback_func_t cb_func = NULL;
+
+
+                if (argc &gt; 1) {
+                        char *js_func = JS_GetStringBytes(JS_ValueToString(cx, argv[1]));
+                        switch_copy_string(dbo-&gt;code_buffer, js_func, sizeof(dbo-&gt;code_buffer));
+                        cb_func = db_callback;
+                        arg = dbo;
+                }
+
+                switch_core_db_exec(dbo-&gt;db, sql, cb_func, arg, &amp;err);
+                if (err) {
+                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, &quot;Error %s\n&quot;, err);
+                        switch_core_db_free(err);
+                        *rval = INT_TO_JSVAL(-1);
+                } else {
+                        int count = switch_core_db_changes(dbo-&gt;db);
+
+                        *rval = INT_TO_JSVAL(count);
+                }
+        }
+        return JS_TRUE;
+}
+
+
+/* Evaluate a prepared statement
+  stepSuccessCode expected success code from switch_core_db_step() 
+  return true if step return expected success code, false otherwise
+*/
+static JSBool db_step_ex(JSContext * cx, JSObject * obj, uintN argc, jsval * argv, jsval * rval, int stepSuccessCode)
+{
+        struct db_obj *dbo = JS_GetPrivate(cx, obj);
+        *rval = BOOLEAN_TO_JSVAL(JS_FALSE);
+
+        if (!dbo-&gt;db) {
+                return JS_FALSE;
+        }
+
+        if (dbo-&gt;stmt) {
+                int running = 1;
+                while (running &lt; 5000) {
+                        int result = switch_core_db_step(dbo-&gt;stmt);
+                        if (result == stepSuccessCode) {
+                                *rval = BOOLEAN_TO_JSVAL(JS_TRUE);
+                                break;
+                        } else if (result == SWITCH_CORE_DB_BUSY) {
+                                running++;
+                                switch_cond_next(); /* wait a bit before retrying */
+                                continue;
+                        } 
+                        if (switch_core_db_finalize(dbo-&gt;stmt) != SWITCH_CORE_DB_OK) {        
+                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, &quot;Error %s\n&quot;, switch_core_db_errmsg(dbo-&gt;db));
+                        }
+                        dbo-&gt;stmt = NULL;
+                        break;
+                }
+        }
+
+        return JS_TRUE;
+}
+
+/* Evaluate a prepared statement, to be used with statements that return data 
+  return true while data is available, false when done or error
+*/
+static JSBool db_next(JSContext * cx, JSObject * obj, uintN argc, jsval * argv, jsval * rval)
+{
+    /* return true until no more rows available */
+        return db_step_ex(cx, obj, argc, argv, rval, SWITCH_CORE_DB_ROW);
+}
+
+/* Evaluate a prepared statement, to be used with statements that return no data 
+  return true if statement has finished executing successfully, false otherwise 
+*/
+static JSBool db_step(JSContext * cx, JSObject * obj, uintN argc, jsval * argv, jsval * rval)
+{
+    /* return true when the statement has finished executing successfully */
+        return db_step_ex(cx, obj, argc, argv, rval, SWITCH_CORE_DB_DONE);
+}
+
+
+static JSBool db_fetch(JSContext * cx, JSObject * obj, uintN argc, jsval * argv, jsval * rval)
+{
+        struct db_obj *dbo = JS_GetPrivate(cx, obj);
+        int colcount = switch_core_db_column_count(dbo-&gt;stmt);
+        char code[1024];
+        int x;
+
+        if (!dbo-&gt;db) {
+                return JS_FALSE;
+        }
+
+        switch_snprintf(code, sizeof(code), &quot;~var _dB_RoW_DaTa_ = {}&quot;);
+        eval_some_js(code, dbo-&gt;cx, dbo-&gt;obj, rval);
+        if (*rval == JS_FALSE) {
+                return JS_TRUE;
+        }
+        for (x = 0; x &lt; colcount; x++) {
+                const char *var = (char *) switch_core_db_column_name(dbo-&gt;stmt, x);
+                const char *val = (char *) switch_core_db_column_text(dbo-&gt;stmt, x);
+                
+                if (var &amp;&amp; val) {
+                        switch_snprintf(code, sizeof(code), &quot;~_dB_RoW_DaTa_[\&quot;%s\&quot;] = \&quot;%s\&quot;&quot;, var, val);
+                        eval_some_js(code, dbo-&gt;cx, dbo-&gt;obj, rval);
+                        if (*rval == JS_FALSE) {
+                                return JS_TRUE;
+                        }
+                }
+        }
+
+        JS_GetProperty(cx, obj, &quot;_dB_RoW_DaTa_&quot;, rval);
+
+        return JS_TRUE;
+}
+
+
+static JSBool db_prepare(JSContext * cx, JSObject * obj, uintN argc, jsval * argv, jsval * rval)
+{
+        struct db_obj *dbo = JS_GetPrivate(cx, obj);
+
+        *rval = BOOLEAN_TO_JSVAL(JS_FALSE);
+
+        if (!dbo-&gt;db) {
+                return JS_FALSE;
+        }
+
+        if (dbo-&gt;stmt) {
+                switch_core_db_finalize(dbo-&gt;stmt);
+                dbo-&gt;stmt = NULL;
+        }
+
+        if (argc &gt; 0) {
+                char *sql = JS_GetStringBytes(JS_ValueToString(cx, argv[0]));
+                if (switch_core_db_prepare(dbo-&gt;db, sql, -1, &amp;dbo-&gt;stmt, 0)) {
+                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, &quot;Error %s\n&quot;, switch_core_db_errmsg(dbo-&gt;db));
+                } else {
+                        *rval = BOOLEAN_TO_JSVAL(JS_TRUE);
+                }
+        }
+        return JS_TRUE;
+}
+
+static JSBool db_bind_text(JSContext * cx, JSObject * obj, uintN argc, jsval * argv, jsval * rval)
+{
+        struct db_obj *dbo = JS_GetPrivate(cx, obj);
+        JSBool status;
+        int32 param_index = -1;
+    char *param_value = NULL;
+
+        *rval = BOOLEAN_TO_JSVAL(JS_FALSE);
+
+        if (!dbo-&gt;db) {
+                return JS_FALSE;
+        }
+
+    /* db_prepare() must be called first */
+        if (!dbo-&gt;stmt) {
+                return JS_FALSE;
+        }
+
+        /* argv[0] = parameter index
+       argv[1] = parameter value
+     */
+        if (argc &lt; 2) {
+                return JS_FALSE;
+        }
+
+        
+
+        /* convert args */
+        status = JS_ValueToECMAUint32(cx, argv[0], (uint32*)&amp;param_index);
+        switch_assert(status == JS_TRUE);
+    param_value = JS_GetStringBytes(JS_ValueToString(cx, argv[1]));
+        if ((param_index &lt; 1) || (NULL == param_value)) {
+                return  JS_FALSE;
+        }
+
+        /* bind param */
+        if (switch_core_db_bind_text(dbo-&gt;stmt, param_index, param_value, -1, SWITCH_CORE_DB_STATIC)) {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, &quot;Error %s\n&quot;, switch_core_db_errmsg(dbo-&gt;db));
+                return JS_FALSE;
+        } else {
+                *rval = BOOLEAN_TO_JSVAL(JS_TRUE);
+        }
+
+        return JS_TRUE;
+}
+
+static JSBool db_bind_int(JSContext * cx, JSObject * obj, uintN argc, jsval * argv, jsval * rval)
+{
+        struct db_obj *dbo = JS_GetPrivate(cx, obj);
+        JSBool status;
+        int32 param_index = -1;
+        int32 param_value = -1;
+
+        *rval = BOOLEAN_TO_JSVAL(JS_FALSE);
+
+        if (!dbo-&gt;db) {
+                return JS_FALSE;
+        }
+
+    /* db_prepare() must be called first */
+        if (!dbo-&gt;stmt) {
+                return JS_FALSE;
+        }
+
+        /* argv[0] = parameter index
+       argv[1] = parameter value
+     */
+        if (argc &lt; 2) {
+                return JS_FALSE;
+        }
+
+        /* convert args */
+        status = JS_ValueToECMAUint32(cx, argv[0], (uint32*)&amp;param_index);
+        switch_assert(status == JS_TRUE);
+        status = JS_ValueToECMAUint32(cx, argv[1], (uint32*)&amp;param_value);
+        switch_assert(status == JS_TRUE);
+
+        if (param_index &lt; 1)  {
+                return  JS_FALSE;
+        }
+
+        /* bind param */
+        if (switch_core_db_bind_int(dbo-&gt;stmt, param_index, param_value)) {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, &quot;Error %s\n&quot;, switch_core_db_errmsg(dbo-&gt;db));
+                return JS_FALSE;
+        } else {
+                *rval = BOOLEAN_TO_JSVAL(JS_TRUE);
+        }
+
+        return JS_TRUE;
+}
+
+enum db_tinyid {
+        DB_NAME
+};
+
+static JSFunctionSpec db_methods[] = {
+        {&quot;exec&quot;, db_exec, 1},
+        {&quot;close&quot;, db_close, 0},
+        {&quot;next&quot;, db_next, 0},
+        {&quot;step&quot;, db_step, 0},
+        {&quot;fetch&quot;, db_fetch, 1},
+        {&quot;prepare&quot;, db_prepare, 0},
+        {&quot;bindText&quot;, db_bind_text, 2},
+        {&quot;bindInt&quot;, db_bind_int, 2},
+        {0}
+};
+
+
+static JSPropertySpec db_props[] = {
+        {&quot;path&quot;, DB_NAME, JSPROP_READONLY | JSPROP_PERMANENT},
+        {0}
+};
+
+
+static JSBool db_setProperty(JSContext * cx, JSObject * obj, jsval id, jsval * vp)
+{
+        char *name = JS_GetStringBytes(JS_ValueToString(cx, id));
+
+        if (strcmp(name, &quot;_dB_RoW_DaTa_&quot;)) {
+                eval_some_js(&quot;~throw new Error(\&quot;this property cannot be changed!\&quot;);&quot;, cx, obj, vp);
+                *vp = BOOLEAN_TO_JSVAL(JS_FALSE);
+        }
+        return JS_TRUE;
+}
+
+static JSBool db_getProperty(JSContext * cx, JSObject * obj, jsval id, jsval * vp)
+{
+        JSBool res = JS_TRUE;
+        struct db_obj *dbo = JS_GetPrivate(cx, obj);
+        char *name;
+        int param = 0;
+
+        name = JS_GetStringBytes(JS_ValueToString(cx, id));
+        /* numbers are our props anything else is a method */
+        if (name[0] &gt;= 48 &amp;&amp; name[0] &lt;= 57) {
+                param = atoi(name);
+        } else {
+                return JS_TRUE;
+        }
+
+        switch (param) {
+        case DB_NAME:
+                *vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, dbo-&gt;dbname));
+                break;
+        }
+
+        return res;
+}
+
+JSClass db_class = {
+        modname, JSCLASS_HAS_PRIVATE,
+        JS_PropertyStub, JS_PropertyStub, db_getProperty, db_setProperty,
+        JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, db_destroy, NULL, NULL, NULL,
+        db_construct
+};
+
+
+switch_status_t db_load(JSContext * cx, JSObject * obj)
+{
+
+        JS_InitClass(cx, obj, NULL, &amp;db_class, db_construct, 3, db_props, db_methods, db_props, db_methods);
+        return SWITCH_STATUS_SUCCESS;
+}
+
+
+const sm_module_interface_t DB_module_interface = {
+        /*.name = */ modname,
+        /*.spidermonkey_load */ db_load,
+        /*.next */ NULL
+};
+
+SWITCH_MOD_DECLARE_NONSTD(switch_status_t) spidermonkey_init(const sm_module_interface_t **module_interface)
+{
+        *module_interface = &amp;DB_module_interface;
+        return SWITCH_STATUS_SUCCESS;
+}
+
+/* For Emacs:
+ * Local Variables:
+ * mode:c
+ * indent-tabs-mode:t
+ * tab-width:4
+ * c-basic-offset:4
+ * End:
+ * For VIM:
+ * vim:set softtabstop=4 shiftwidth=4 tabstop=4:
+ */
</ins></span></pre></div>
<a id="freeswitchtrunksrcmodlanguagesmod_spidermonkeymod_spidermonkey_core_dbvcprojfromrev16304freeswitchtrunksrcmodlanguagesmod_spidermonkey_core_dbmod_spidermonkey_core_dbvcproj"></a>
<div class="copfile"><h4>Copied: freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_core_db.vcproj (from rev 16304, freeswitch/trunk/src/mod/languages/mod_spidermonkey_core_db/mod_spidermonkey_core_db.vcproj) (0 => 16333)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_core_db.vcproj                                (rev 0)
+++ freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_core_db.vcproj        2010-01-17 05:48:36 UTC (rev 16333)
</span><span class="lines">@@ -0,0 +1,93 @@
</span><ins>+&lt;?xml version=&quot;1.0&quot; encoding=&quot;Windows-1252&quot;?&gt;
+&lt;VisualStudioProject
+        ProjectType=&quot;Visual C++&quot;
+        Version=&quot;8.00&quot;
+        Name=&quot;mod_spidermonkey_core_db&quot;
+        ProjectGUID=&quot;{ACFFF684-4D19-4D48-AF12-88EA1D778BDF}&quot;
+        RootNamespace=&quot;mod_spidermonkey_core_db&quot;
+        Keyword=&quot;Win32Proj&quot;
+        &gt;
+        &lt;Platforms&gt;
+                &lt;Platform
+                        Name=&quot;Win32&quot;
+                /&gt;
+        &lt;/Platforms&gt;
+        &lt;ToolFiles&gt;
+        &lt;/ToolFiles&gt;
+        &lt;Configurations&gt;
+                &lt;Configuration
+                        Name=&quot;Debug|Win32&quot;
+                        ConfigurationType=&quot;2&quot;
+                        InheritedPropertySheets=&quot;..\..\..\..\w32\winlibs.vsprops;..\..\..\..\w32\module_debug.vsprops;..\..\..\..\w32\spidermonkey.vsprops&quot;
+                        CharacterSet=&quot;2&quot;
+                        &gt;
+                        &lt;Tool
+                                Name=&quot;VCPreBuildEventTool&quot;
+                                CommandLine=&quot;&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCustomBuildTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXMLDataGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCWebServiceProxyGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCMIDLTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCLCompilerTool&quot;
+                                AdditionalIncludeDirectories=&quot;&quot;
+                                UsePrecompiledHeader=&quot;0&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCLinkerTool&quot;
+                                AdditionalLibraryDirectories=&quot;&quot;
+                        /&gt;
+                &lt;/Configuration&gt;
+                &lt;Configuration
+                        Name=&quot;Release|Win32&quot;
+                        ConfigurationType=&quot;2&quot;
+                        InheritedPropertySheets=&quot;..\..\..\..\w32\winlibs.vsprops;..\..\..\..\w32\module_release.vsprops;..\..\..\..\w32\spidermonkey.vsprops&quot;
+                        CharacterSet=&quot;2&quot;
+                        &gt;
+                        &lt;Tool
+                                Name=&quot;VCPreBuildEventTool&quot;
+                                CommandLine=&quot;&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCustomBuildTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXMLDataGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCWebServiceProxyGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCMIDLTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCLCompilerTool&quot;
+                                AdditionalIncludeDirectories=&quot;&quot;
+                                UsePrecompiledHeader=&quot;0&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCLinkerTool&quot;
+                                AdditionalLibraryDirectories=&quot;&quot;
+                        /&gt;
+                &lt;/Configuration&gt;
+        &lt;/Configurations&gt;
+        &lt;References&gt;
+        &lt;/References&gt;
+        &lt;Files&gt;
+                &lt;File
+                        RelativePath=&quot;.\mod_spidermonkey_core_db.c&quot;
+                        &gt;
+                &lt;/File&gt;
+        &lt;/Files&gt;
+        &lt;Globals&gt;
+        &lt;/Globals&gt;
+&lt;/VisualStudioProject&gt;
</ins></span></pre></div>
<a id="freeswitchtrunksrcmodlanguagesmod_spidermonkeymod_spidermonkey_curl2008vcprojfromrev16304freeswitchtrunksrcmodlanguagesmod_spidermonkey_curlmod_spidermonkey_curl2008vcproj"></a>
<div class="copfile"><h4>Copied: freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_curl.2008.vcproj (from rev 16304, freeswitch/trunk/src/mod/languages/mod_spidermonkey_curl/mod_spidermonkey_curl.2008.vcproj) (0 => 16333)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_curl.2008.vcproj                                (rev 0)
+++ freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_curl.2008.vcproj        2010-01-17 05:48:36 UTC (rev 16333)
</span><span class="lines">@@ -0,0 +1,295 @@
</span><ins>+&lt;?xml version=&quot;1.0&quot; encoding=&quot;Windows-1252&quot;?&gt;
+&lt;VisualStudioProject
+        ProjectType=&quot;Visual C++&quot;
+        Version=&quot;9.00&quot;
+        Name=&quot;mod_spidermonkey_curl&quot;
+        ProjectGUID=&quot;{36E854E3-CE12-4348-A125-CCF3F9D74813}&quot;
+        RootNamespace=&quot;mod_spidermonkey_curl&quot;
+        Keyword=&quot;Win32Proj&quot;
+        TargetFrameworkVersion=&quot;131072&quot;
+        &gt;
+        &lt;Platforms&gt;
+                &lt;Platform
+                        Name=&quot;Win32&quot;
+                /&gt;
+                &lt;Platform
+                        Name=&quot;x64&quot;
+                /&gt;
+        &lt;/Platforms&gt;
+        &lt;ToolFiles&gt;
+        &lt;/ToolFiles&gt;
+        &lt;Configurations&gt;
+                &lt;Configuration
+                        Name=&quot;Debug|Win32&quot;
+                        ConfigurationType=&quot;2&quot;
+                        InheritedPropertySheets=&quot;..\..\..\..\w32\winlibs.vsprops;..\..\..\..\w32\module_debug.vsprops;..\..\..\..\w32\spidermonkey.vsprops&quot;
+                        CharacterSet=&quot;2&quot;
+                        &gt;
+                        &lt;Tool
+                                Name=&quot;VCPreBuildEventTool&quot;
+                                CommandLine=&quot;&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCustomBuildTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXMLDataGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCWebServiceProxyGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCMIDLTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCLCompilerTool&quot;
+                                AdditionalIncludeDirectories=&quot;&quot;
+                                UsePrecompiledHeader=&quot;0&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCManagedResourceCompilerTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCResourceCompilerTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCPreLinkEventTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCLinkerTool&quot;
+                                AdditionalLibraryDirectories=&quot;&quot;
+                                RandomizedBaseAddress=&quot;1&quot;
+                                DataExecutionPrevention=&quot;0&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCALinkTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCManifestTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXDCMakeTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCBscMakeTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCFxCopTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCAppVerifierTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCPostBuildEventTool&quot;
+                        /&gt;
+                &lt;/Configuration&gt;
+                &lt;Configuration
+                        Name=&quot;Debug|x64&quot;
+                        ConfigurationType=&quot;2&quot;
+                        InheritedPropertySheets=&quot;..\..\..\..\w32\winlibs.vsprops;..\..\..\..\w32\module_debug.vsprops;..\..\..\..\w32\spidermonkey.vsprops&quot;
+                        CharacterSet=&quot;2&quot;
+                        &gt;
+                        &lt;Tool
+                                Name=&quot;VCPreBuildEventTool&quot;
+                                CommandLine=&quot;&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCustomBuildTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXMLDataGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCWebServiceProxyGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCMIDLTool&quot;
+                                TargetEnvironment=&quot;3&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCLCompilerTool&quot;
+                                AdditionalIncludeDirectories=&quot;&quot;
+                                UsePrecompiledHeader=&quot;0&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCManagedResourceCompilerTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCResourceCompilerTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCPreLinkEventTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCLinkerTool&quot;
+                                OutputFile=&quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)/mod/$(ProjectName).dll&quot;
+                                AdditionalLibraryDirectories=&quot;&quot;
+                                RandomizedBaseAddress=&quot;1&quot;
+                                DataExecutionPrevention=&quot;0&quot;
+                                TargetMachine=&quot;17&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCALinkTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCManifestTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXDCMakeTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCBscMakeTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCFxCopTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCAppVerifierTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCPostBuildEventTool&quot;
+                        /&gt;
+                &lt;/Configuration&gt;
+                &lt;Configuration
+                        Name=&quot;Release|Win32&quot;
+                        ConfigurationType=&quot;2&quot;
+                        InheritedPropertySheets=&quot;..\..\..\..\w32\winlibs.vsprops;..\..\..\..\w32\module_release.vsprops;..\..\..\..\w32\spidermonkey.vsprops&quot;
+                        CharacterSet=&quot;2&quot;
+                        &gt;
+                        &lt;Tool
+                                Name=&quot;VCPreBuildEventTool&quot;
+                                CommandLine=&quot;&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCustomBuildTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXMLDataGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCWebServiceProxyGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCMIDLTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCLCompilerTool&quot;
+                                AdditionalIncludeDirectories=&quot;&quot;
+                                UsePrecompiledHeader=&quot;0&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCManagedResourceCompilerTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCResourceCompilerTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCPreLinkEventTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCLinkerTool&quot;
+                                AdditionalLibraryDirectories=&quot;&quot;
+                                RandomizedBaseAddress=&quot;1&quot;
+                                DataExecutionPrevention=&quot;0&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCALinkTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCManifestTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXDCMakeTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCBscMakeTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCFxCopTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCAppVerifierTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCPostBuildEventTool&quot;
+                        /&gt;
+                &lt;/Configuration&gt;
+                &lt;Configuration
+                        Name=&quot;Release|x64&quot;
+                        ConfigurationType=&quot;2&quot;
+                        InheritedPropertySheets=&quot;..\..\..\..\w32\winlibs.vsprops;..\..\..\..\w32\module_release.vsprops;..\..\..\..\w32\spidermonkey.vsprops&quot;
+                        CharacterSet=&quot;2&quot;
+                        &gt;
+                        &lt;Tool
+                                Name=&quot;VCPreBuildEventTool&quot;
+                                CommandLine=&quot;&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCustomBuildTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXMLDataGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCWebServiceProxyGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCMIDLTool&quot;
+                                TargetEnvironment=&quot;3&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCLCompilerTool&quot;
+                                AdditionalIncludeDirectories=&quot;&quot;
+                                UsePrecompiledHeader=&quot;0&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCManagedResourceCompilerTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCResourceCompilerTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCPreLinkEventTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCLinkerTool&quot;
+                                OutputFile=&quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)/mod/$(ProjectName).dll&quot;
+                                AdditionalLibraryDirectories=&quot;&quot;
+                                RandomizedBaseAddress=&quot;1&quot;
+                                DataExecutionPrevention=&quot;0&quot;
+                                TargetMachine=&quot;17&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCALinkTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCManifestTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXDCMakeTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCBscMakeTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCFxCopTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCAppVerifierTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCPostBuildEventTool&quot;
+                        /&gt;
+                &lt;/Configuration&gt;
+        &lt;/Configurations&gt;
+        &lt;References&gt;
+        &lt;/References&gt;
+        &lt;Files&gt;
+                &lt;File
+                        RelativePath=&quot;.\mod_spidermonkey_curl.c&quot;
+                        &gt;
+                &lt;/File&gt;
+        &lt;/Files&gt;
+        &lt;Globals&gt;
+        &lt;/Globals&gt;
+&lt;/VisualStudioProject&gt;
</ins></span></pre></div>
<a id="freeswitchtrunksrcmodlanguagesmod_spidermonkeymod_spidermonkey_curlcfromrev16304freeswitchtrunksrcmodlanguagesmod_spidermonkey_curlmod_spidermonkey_curlc"></a>
<div class="copfile"><h4>Copied: freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_curl.c (from rev 16304, freeswitch/trunk/src/mod/languages/mod_spidermonkey_curl/mod_spidermonkey_curl.c) (0 => 16333)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_curl.c                                (rev 0)
+++ freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_curl.c        2010-01-17 05:48:36 UTC (rev 16333)
</span><span class="lines">@@ -0,0 +1,259 @@
</span><ins>+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2005-2009, Anthony Minessale II &lt;anthm@freeswitch.org&gt;
+ *
+ * Version: MPL 1.1
+ *
+ * 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 FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * Anthony Minessale II &lt;anthm@freeswitch.org&gt;
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * Anthony Minessale II &lt;anthm@freeswitch.org&gt;
+ *
+ *
+ * mod_spidermonkey_teletone.c -- TeleTone Javascript Module
+ *
+ */
+#include &quot;mod_spidermonkey.h&quot;
+#include &lt;curl/curl.h&gt;
+
+static const char modname[] = &quot;CURL&quot;;
+
+struct curl_obj {
+        CURL *curl_handle;
+        JSContext *cx;
+        JSObject *obj;
+        JSFunction *function;
+        JSObject *user_data;
+        jsrefcount saveDepth;
+        jsval ret;
+};
+
+
+static size_t file_callback(void *ptr, size_t size, size_t nmemb, void *data)
+{
+        register unsigned int realsize = (unsigned int) (size * nmemb);
+        struct curl_obj *co = data;
+        uintN argc = 0;
+        jsval argv[4];
+
+
+        if (!co) {
+                return 0;
+        }
+        if (co-&gt;function) {
+                char *ret;
+                argv[argc++] = STRING_TO_JSVAL(JS_NewStringCopyZ(co-&gt;cx, (char *) ptr));
+                if (co-&gt;user_data) {
+                        argv[argc++] = OBJECT_TO_JSVAL(co-&gt;user_data);
+                }
+                JS_ResumeRequest(co-&gt;cx, co-&gt;saveDepth);
+                JS_CallFunction(co-&gt;cx, co-&gt;obj, co-&gt;function, argc, argv, &amp;co-&gt;ret);
+                co-&gt;saveDepth = JS_SuspendRequest(co-&gt;cx);
+
+                if ((ret = JS_GetStringBytes(JS_ValueToString(co-&gt;cx, co-&gt;ret)))) {
+                        if (!strcmp(ret, &quot;true&quot;) || !strcmp(ret, &quot;undefined&quot;)) {
+                                return realsize;
+                        } else {
+                                return 0;
+                        }
+                }
+        }
+
+        return realsize;
+}
+
+
+/* Curl Object */
+/*********************************************************************************/
+static JSBool curl_construct(JSContext * cx, JSObject * obj, uintN argc, jsval * argv, jsval * rval)
+{
+        struct curl_obj *co = NULL;
+
+        co = malloc(sizeof(*co));
+        switch_assert(co);
+
+        memset(co, 0, sizeof(*co));
+
+        co-&gt;cx = cx;
+        co-&gt;obj = obj;
+
+        JS_SetPrivate(cx, obj, co);
+
+        return JS_TRUE;
+}
+
+static void curl_destroy(JSContext * cx, JSObject * obj)
+{
+        struct curl_obj *co = JS_GetPrivate(cx, obj);
+        switch_safe_free(co);
+        JS_SetPrivate(cx, obj, NULL);
+}
+
+static JSBool curl_run(JSContext * cx, JSObject * obj, uintN argc, jsval * argv, jsval * rval)
+{
+        struct curl_obj *co = JS_GetPrivate(cx, obj);
+        char *method = NULL, *url, *cred = NULL;
+        char *url_p = NULL, *data = NULL, *durl = NULL;
+        long httpRes = 0;
+        struct curl_slist *headers = NULL;
+        int32 timeout = 0;
+        char ct[80] = &quot;Content-Type: application/x-www-form-urlencoded&quot;;
+
+        if (argc &lt; 2 || !co) {
+                return JS_FALSE;
+        }
+
+
+        method = JS_GetStringBytes(JS_ValueToString(cx, argv[0]));
+        url = JS_GetStringBytes(JS_ValueToString(cx, argv[1]));
+
+        co-&gt;curl_handle = curl_easy_init();
+        if (!strncasecmp(url, &quot;https&quot;, 5)) {
+                curl_easy_setopt(co-&gt;curl_handle, CURLOPT_SSL_VERIFYPEER, 0);
+                curl_easy_setopt(co-&gt;curl_handle, CURLOPT_SSL_VERIFYHOST, 0);
+        }
+        
+
+        if (argc &gt; 2) {
+                data = JS_GetStringBytes(JS_ValueToString(cx, argv[2]));
+        }
+
+        if (argc &gt; 3) {
+                co-&gt;function = JS_ValueToFunction(cx, argv[3]);
+        }
+
+        if (argc &gt; 4) {
+                JS_ValueToObject(cx, argv[4], &amp;co-&gt;user_data);
+        }
+
+        if (argc &gt; 5) {
+                cred = JS_GetStringBytes(JS_ValueToString(cx, argv[5]));
+                if (!zstr(cred)) {
+                        curl_easy_setopt(co-&gt;curl_handle, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
+                        curl_easy_setopt(co-&gt;curl_handle, CURLOPT_USERPWD, cred);
+                }
+        }
+
+        if (argc &gt; 6) {
+                JS_ValueToInt32(cx, argv[6], &amp;timeout);
+                if (timeout &gt; 0) {
+                        curl_easy_setopt(co-&gt;curl_handle, CURLOPT_TIMEOUT, timeout);
+                }
+        }
+
+        if (argc &gt; 7) {
+                char *content_type = JS_GetStringBytes(JS_ValueToString(cx, argv[7]));
+                switch_snprintf(ct, sizeof(ct), &quot;Content-Type: %s&quot;, content_type);
+        }
+
+        headers = curl_slist_append(headers, ct);
+
+        curl_easy_setopt(co-&gt;curl_handle, CURLOPT_HTTPHEADER, headers);
+
+        url_p = url;
+
+        if (!strcasecmp(method, &quot;post&quot;)) {
+                curl_easy_setopt(co-&gt;curl_handle, CURLOPT_POST, 1);
+                if (!data) {
+                        data = &quot;&quot;;
+                }
+                curl_easy_setopt(co-&gt;curl_handle, CURLOPT_POSTFIELDS, data);
+        } else if (!zstr(data)) {
+                durl = switch_mprintf(&quot;%s?%s&quot;, url, data);
+                url_p = durl;
+        }
+
+        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, &quot;Running: method: [%s] url: [%s] data: [%s] cred=[%s] cb: [%s]\n&quot;,
+                                          method, url_p, data, switch_str_nil(cred), co-&gt;function ? &quot;yes&quot; : &quot;no&quot;);
+
+        curl_easy_setopt(co-&gt;curl_handle, CURLOPT_URL, url_p);
+        curl_easy_setopt(co-&gt;curl_handle, CURLOPT_WRITEFUNCTION, file_callback);
+        curl_easy_setopt(co-&gt;curl_handle, CURLOPT_WRITEDATA, (void *) co);
+
+        curl_easy_setopt(co-&gt;curl_handle, CURLOPT_USERAGENT, &quot;freeswitch-spidermonkey-curl/1.0&quot;);
+
+        co-&gt;saveDepth = JS_SuspendRequest(cx);
+        curl_easy_perform(co-&gt;curl_handle);
+
+        curl_easy_getinfo(co-&gt;curl_handle, CURLINFO_RESPONSE_CODE, &amp;httpRes);
+        curl_easy_cleanup(co-&gt;curl_handle);
+        curl_slist_free_all(headers);
+        co-&gt;curl_handle = NULL;
+        co-&gt;function = NULL;
+        JS_ResumeRequest(cx, co-&gt;saveDepth);
+        switch_safe_free(durl);
+
+
+        return JS_TRUE;
+}
+
+static JSFunctionSpec curl_methods[] = {
+        {&quot;run&quot;, curl_run, 2},
+        {0}
+};
+
+
+static JSPropertySpec curl_props[] = {
+        {0}
+};
+
+static JSBool curl_getProperty(JSContext * cx, JSObject * obj, jsval id, jsval * vp)
+{
+        JSBool res = JS_TRUE;
+        return res;
+}
+
+JSClass curl_class = {
+        modname, JSCLASS_HAS_PRIVATE,
+        JS_PropertyStub, JS_PropertyStub, curl_getProperty, DEFAULT_SET_PROPERTY,
+        JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, curl_destroy, NULL, NULL, NULL,
+        curl_construct
+};
+
+
+switch_status_t curl_load(JSContext * cx, JSObject * obj)
+{
+        JS_InitClass(cx, obj, NULL, &amp;curl_class, curl_construct, 3, curl_props, curl_methods, curl_props, curl_methods);
+        return SWITCH_STATUS_SUCCESS;
+}
+
+
+const sm_module_interface_t curl_module_interface = {
+        /*.name = */ modname,
+        /*.spidermonkey_load */ curl_load,
+        /*.next */ NULL
+};
+
+SWITCH_MOD_DECLARE_NONSTD(switch_status_t) spidermonkey_init(const sm_module_interface_t **module_interface)
+{
+        curl_global_init(CURL_GLOBAL_ALL);
+        *module_interface = &amp;curl_module_interface;
+        return SWITCH_STATUS_SUCCESS;
+}
+
+/* For Emacs:
+ * Local Variables:
+ * mode:c
+ * indent-tabs-mode:t
+ * tab-width:4
+ * c-basic-offset:4
+ * End:
+ * For VIM:
+ * vim:set softtabstop=4 shiftwidth=4 tabstop=4:
+ */
</ins></span></pre></div>
<a id="freeswitchtrunksrcmodlanguagesmod_spidermonkeymod_spidermonkey_curlvcprojfromrev16304freeswitchtrunksrcmodlanguagesmod_spidermonkey_curlmod_spidermonkey_curlvcproj"></a>
<div class="copfile"><h4>Copied: freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_curl.vcproj (from rev 16304, freeswitch/trunk/src/mod/languages/mod_spidermonkey_curl/mod_spidermonkey_curl.vcproj) (0 => 16333)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_curl.vcproj                                (rev 0)
+++ freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_curl.vcproj        2010-01-17 05:48:36 UTC (rev 16333)
</span><span class="lines">@@ -0,0 +1,159 @@
</span><ins>+&lt;?xml version=&quot;1.0&quot; encoding=&quot;Windows-1252&quot;?&gt;
+&lt;VisualStudioProject
+        ProjectType=&quot;Visual C++&quot;
+        Version=&quot;8.00&quot;
+        Name=&quot;mod_spidermonkey_curl&quot;
+        ProjectGUID=&quot;{2CCED6DC-26FF-40F2-9585-E9E1049A4599}&quot;
+        RootNamespace=&quot;mod_spidermonkey_curl&quot;
+        Keyword=&quot;Win32Proj&quot;
+        &gt;
+        &lt;Platforms&gt;
+                &lt;Platform
+                        Name=&quot;Win32&quot;
+                /&gt;
+        &lt;/Platforms&gt;
+        &lt;ToolFiles&gt;
+        &lt;/ToolFiles&gt;
+        &lt;Configurations&gt;
+                &lt;Configuration
+                        Name=&quot;Debug|Win32&quot;
+                        ConfigurationType=&quot;2&quot;
+                        InheritedPropertySheets=&quot;..\..\..\..\w32\winlibs.vsprops;..\..\..\..\w32\module_debug.vsprops;..\..\..\..\w32\spidermonkey.vsprops&quot;
+                        CharacterSet=&quot;2&quot;
+                        &gt;
+                        &lt;Tool
+                                Name=&quot;VCPreBuildEventTool&quot;
+                                CommandLine=&quot;&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCustomBuildTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXMLDataGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCWebServiceProxyGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCMIDLTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCLCompilerTool&quot;
+                                AdditionalIncludeDirectories=&quot;&quot;
+                                UsePrecompiledHeader=&quot;0&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCManagedResourceCompilerTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCResourceCompilerTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCPreLinkEventTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCLinkerTool&quot;
+                                AdditionalLibraryDirectories=&quot;&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCALinkTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCManifestTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXDCMakeTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCBscMakeTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCFxCopTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCAppVerifierTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCWebDeploymentTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCPostBuildEventTool&quot;
+                        /&gt;
+                &lt;/Configuration&gt;
+                &lt;Configuration
+                        Name=&quot;Release|Win32&quot;
+                        ConfigurationType=&quot;2&quot;
+                        InheritedPropertySheets=&quot;..\..\..\..\w32\winlibs.vsprops;..\..\..\..\w32\module_release.vsprops;..\..\..\..\w32\spidermonkey.vsprops&quot;
+                        CharacterSet=&quot;2&quot;
+                        &gt;
+                        &lt;Tool
+                                Name=&quot;VCPreBuildEventTool&quot;
+                                CommandLine=&quot;&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCustomBuildTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXMLDataGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCWebServiceProxyGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCMIDLTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCLCompilerTool&quot;
+                                AdditionalIncludeDirectories=&quot;&quot;
+                                UsePrecompiledHeader=&quot;0&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCManagedResourceCompilerTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCResourceCompilerTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCPreLinkEventTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCLinkerTool&quot;
+                                AdditionalLibraryDirectories=&quot;&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCALinkTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCManifestTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXDCMakeTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCBscMakeTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCFxCopTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCAppVerifierTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCWebDeploymentTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCPostBuildEventTool&quot;
+                        /&gt;
+                &lt;/Configuration&gt;
+        &lt;/Configurations&gt;
+        &lt;References&gt;
+        &lt;/References&gt;
+        &lt;Files&gt;
+                &lt;File
+                        RelativePath=&quot;.\mod_spidermonkey_curl.c&quot;
+                        &gt;
+                &lt;/File&gt;
+        &lt;/Files&gt;
+        &lt;Globals&gt;
+        &lt;/Globals&gt;
+&lt;/VisualStudioProject&gt;
</ins></span></pre></div>
<a id="freeswitchtrunksrcmodlanguagesmod_spidermonkeymod_spidermonkey_odbc2008vcprojfromrev16304freeswitchtrunksrcmodlanguagesmod_spidermonkey_odbcmod_spidermonkey_odbc2008vcproj"></a>
<div class="copfile"><h4>Copied: freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_odbc.2008.vcproj (from rev 16304, freeswitch/trunk/src/mod/languages/mod_spidermonkey_odbc/mod_spidermonkey_odbc.2008.vcproj) (0 => 16333)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_odbc.2008.vcproj                                (rev 0)
+++ freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_odbc.2008.vcproj        2010-01-17 05:48:36 UTC (rev 16333)
</span><span class="lines">@@ -0,0 +1,305 @@
</span><ins>+&lt;?xml version=&quot;1.0&quot; encoding=&quot;Windows-1252&quot;?&gt;
+&lt;VisualStudioProject
+        ProjectType=&quot;Visual C++&quot;
+        Version=&quot;9.00&quot;
+        Name=&quot;mod_spidermonkey_odbc&quot;
+        ProjectGUID=&quot;{0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}&quot;
+        RootNamespace=&quot;mod_spidermonkey_odbc&quot;
+        Keyword=&quot;Win32Proj&quot;
+        TargetFrameworkVersion=&quot;131072&quot;
+        &gt;
+        &lt;Platforms&gt;
+                &lt;Platform
+                        Name=&quot;Win32&quot;
+                /&gt;
+                &lt;Platform
+                        Name=&quot;x64&quot;
+                /&gt;
+        &lt;/Platforms&gt;
+        &lt;ToolFiles&gt;
+        &lt;/ToolFiles&gt;
+        &lt;Configurations&gt;
+                &lt;Configuration
+                        Name=&quot;Debug|Win32&quot;
+                        ConfigurationType=&quot;2&quot;
+                        InheritedPropertySheets=&quot;..\..\..\..\w32\winlibs.vsprops;..\..\..\..\w32\module_debug.vsprops;..\..\..\..\w32\spidermonkey.vsprops&quot;
+                        CharacterSet=&quot;2&quot;
+                        &gt;
+                        &lt;Tool
+                                Name=&quot;VCPreBuildEventTool&quot;
+                                CommandLine=&quot;&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCustomBuildTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXMLDataGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCWebServiceProxyGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCMIDLTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCLCompilerTool&quot;
+                                AdditionalIncludeDirectories=&quot;&quot;
+                                UsePrecompiledHeader=&quot;0&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCManagedResourceCompilerTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCResourceCompilerTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCPreLinkEventTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCLinkerTool&quot;
+                                AdditionalLibraryDirectories=&quot;&quot;
+                                RandomizedBaseAddress=&quot;1&quot;
+                                DataExecutionPrevention=&quot;0&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCALinkTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCManifestTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXDCMakeTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCBscMakeTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCFxCopTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCAppVerifierTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCPostBuildEventTool&quot;
+                        /&gt;
+                &lt;/Configuration&gt;
+                &lt;Configuration
+                        Name=&quot;Debug|x64&quot;
+                        ConfigurationType=&quot;2&quot;
+                        InheritedPropertySheets=&quot;..\..\..\..\w32\winlibs.vsprops;..\..\..\..\w32\module_debug.vsprops;..\..\..\..\w32\spidermonkey.vsprops&quot;
+                        CharacterSet=&quot;2&quot;
+                        &gt;
+                        &lt;Tool
+                                Name=&quot;VCPreBuildEventTool&quot;
+                                CommandLine=&quot;&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCustomBuildTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXMLDataGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCWebServiceProxyGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCMIDLTool&quot;
+                                TargetEnvironment=&quot;3&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCLCompilerTool&quot;
+                                AdditionalIncludeDirectories=&quot;&quot;
+                                UsePrecompiledHeader=&quot;0&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCManagedResourceCompilerTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCResourceCompilerTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCPreLinkEventTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCLinkerTool&quot;
+                                OutputFile=&quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)/mod/$(ProjectName).dll&quot;
+                                AdditionalLibraryDirectories=&quot;&quot;
+                                RandomizedBaseAddress=&quot;1&quot;
+                                DataExecutionPrevention=&quot;0&quot;
+                                TargetMachine=&quot;17&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCALinkTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCManifestTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXDCMakeTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCBscMakeTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCFxCopTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCAppVerifierTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCPostBuildEventTool&quot;
+                        /&gt;
+                &lt;/Configuration&gt;
+                &lt;Configuration
+                        Name=&quot;Release|Win32&quot;
+                        ConfigurationType=&quot;2&quot;
+                        InheritedPropertySheets=&quot;..\..\..\..\w32\winlibs.vsprops;..\..\..\..\w32\module_release.vsprops;..\..\..\..\w32\spidermonkey.vsprops&quot;
+                        CharacterSet=&quot;2&quot;
+                        &gt;
+                        &lt;Tool
+                                Name=&quot;VCPreBuildEventTool&quot;
+                                CommandLine=&quot;&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCustomBuildTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXMLDataGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCWebServiceProxyGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCMIDLTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCLCompilerTool&quot;
+                                WholeProgramOptimization=&quot;true&quot;
+                                AdditionalIncludeDirectories=&quot;&quot;
+                                RuntimeLibrary=&quot;2&quot;
+                                UsePrecompiledHeader=&quot;0&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCManagedResourceCompilerTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCResourceCompilerTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCPreLinkEventTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCLinkerTool&quot;
+                                AdditionalLibraryDirectories=&quot;&quot;
+                                OptimizeReferences=&quot;2&quot;
+                                EnableCOMDATFolding=&quot;2&quot;
+                                LinkTimeCodeGeneration=&quot;1&quot;
+                                RandomizedBaseAddress=&quot;1&quot;
+                                DataExecutionPrevention=&quot;0&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCALinkTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCManifestTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXDCMakeTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCBscMakeTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCFxCopTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCAppVerifierTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCPostBuildEventTool&quot;
+                        /&gt;
+                &lt;/Configuration&gt;
+                &lt;Configuration
+                        Name=&quot;Release|x64&quot;
+                        ConfigurationType=&quot;2&quot;
+                        InheritedPropertySheets=&quot;..\..\..\..\w32\winlibs.vsprops;..\..\..\..\w32\module_release.vsprops;..\..\..\..\w32\spidermonkey.vsprops&quot;
+                        CharacterSet=&quot;2&quot;
+                        &gt;
+                        &lt;Tool
+                                Name=&quot;VCPreBuildEventTool&quot;
+                                CommandLine=&quot;&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCustomBuildTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXMLDataGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCWebServiceProxyGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCMIDLTool&quot;
+                                TargetEnvironment=&quot;3&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCLCompilerTool&quot;
+                                WholeProgramOptimization=&quot;true&quot;
+                                AdditionalIncludeDirectories=&quot;&quot;
+                                RuntimeLibrary=&quot;2&quot;
+                                UsePrecompiledHeader=&quot;0&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCManagedResourceCompilerTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCResourceCompilerTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCPreLinkEventTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCLinkerTool&quot;
+                                OutputFile=&quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)/mod/$(ProjectName).dll&quot;
+                                AdditionalLibraryDirectories=&quot;&quot;
+                                OptimizeReferences=&quot;2&quot;
+                                EnableCOMDATFolding=&quot;2&quot;
+                                LinkTimeCodeGeneration=&quot;1&quot;
+                                RandomizedBaseAddress=&quot;1&quot;
+                                DataExecutionPrevention=&quot;0&quot;
+                                TargetMachine=&quot;17&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCALinkTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCManifestTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXDCMakeTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCBscMakeTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCFxCopTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCAppVerifierTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCPostBuildEventTool&quot;
+                        /&gt;
+                &lt;/Configuration&gt;
+        &lt;/Configurations&gt;
+        &lt;References&gt;
+        &lt;/References&gt;
+        &lt;Files&gt;
+                &lt;File
+                        RelativePath=&quot;.\mod_spidermonkey_odbc.c&quot;
+                        &gt;
+                &lt;/File&gt;
+        &lt;/Files&gt;
+        &lt;Globals&gt;
+        &lt;/Globals&gt;
+&lt;/VisualStudioProject&gt;
</ins></span></pre></div>
<a id="freeswitchtrunksrcmodlanguagesmod_spidermonkeymod_spidermonkey_odbccfromrev16304freeswitchtrunksrcmodlanguagesmod_spidermonkey_odbcmod_spidermonkey_odbcc"></a>
<div class="copfile"><h4>Copied: freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_odbc.c (from rev 16304, freeswitch/trunk/src/mod/languages/mod_spidermonkey_odbc/mod_spidermonkey_odbc.c) (0 => 16333)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_odbc.c                                (rev 0)
+++ freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_odbc.c        2010-01-17 05:48:36 UTC (rev 16333)
</span><span class="lines">@@ -0,0 +1,561 @@
</span><ins>+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2005-2009, Anthony Minessale II &lt;anthm@freeswitch.org&gt;
+ *
+ * Version: MPL 1.1
+ *
+ * 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 FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * Anthony Minessale II &lt;anthm@freeswitch.org&gt;
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * Anthony Minessale II &lt;anthm@freeswitch.org&gt;
+ *
+ *
+ * mod_spidermonkey_odbc.c -- ODBC Javascript Module
+ *
+ */
+#include &quot;mod_spidermonkey.h&quot;
+
+#include &lt;sql.h&gt;
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4201)
+#include &lt;sqlext.h&gt;
+#pragma warning(pop)
+#else
+#include &lt;sqlext.h&gt;
+#endif
+#include &lt;sqltypes.h&gt;
+
+static const char modname[] = &quot;ODBC&quot;;
+
+struct odbc_obj {
+        switch_odbc_handle_t *handle;
+        SQLHSTMT stmt;
+        SQLCHAR *colbuf;
+        int32 cblen;
+        SQLCHAR *code;
+        int32 codelen;
+};
+typedef struct odbc_obj odbc_obj_t;
+
+static odbc_obj_t *new_odbc_obj(char *dsn, char *username, char *password)
+{
+        odbc_obj_t *new_obj;
+
+        if (!(new_obj = malloc(sizeof(*new_obj)))) {
+                goto err;
+        }
+
+        memset(new_obj, 0, sizeof(odbc_obj_t));
+        if (!(new_obj-&gt;handle = switch_odbc_handle_new(dsn, username, password))) {
+                goto err;
+        }
+
+        return new_obj;
+
+  err:
+        if (new_obj) {
+                if (new_obj-&gt;handle) {
+                        switch_odbc_handle_destroy(&amp;new_obj-&gt;handle);
+                }
+                switch_safe_free(new_obj);
+        }
+
+        return NULL;
+}
+
+switch_odbc_status_t odbc_obj_connect(odbc_obj_t *obj)
+{
+
+        return switch_odbc_handle_connect(obj-&gt;handle);
+}
+
+static void destroy_odbc_obj(odbc_obj_t **objp)
+{
+        odbc_obj_t *obj = *objp;
+        if (obj == NULL)
+                return;
+        if (obj-&gt;stmt) {
+                SQLFreeHandle(SQL_HANDLE_STMT, obj-&gt;stmt);
+        }
+        if (obj-&gt;handle) {
+                switch_odbc_handle_destroy(&amp;obj-&gt;handle);
+        }
+        switch_safe_free(obj-&gt;colbuf);
+        switch_safe_free(obj-&gt;code);
+        switch_safe_free(obj);
+}
+
+
+/* ODBC Object */
+/*********************************************************************************/
+static JSBool odbc_construct(JSContext * cx, JSObject * obj, uintN argc, jsval * argv, jsval * rval)
+{
+        odbc_obj_t *odbc_obj = NULL;
+        char *dsn, *username, *password;
+        int32 blen = 1024;
+
+        if (argc &lt; 3) {
+                return JS_FALSE;
+        }
+
+        dsn = JS_GetStringBytes(JS_ValueToString(cx, argv[0]));
+        username = JS_GetStringBytes(JS_ValueToString(cx, argv[1]));
+        password = JS_GetStringBytes(JS_ValueToString(cx, argv[2]));
+
+        if (argc &gt; 3) {
+                int32 len;
+                JS_ValueToInt32(cx, argv[3], &amp;len);
+
+                if (len &gt; 0) {
+                        blen = len;
+                }
+        }
+
+        if (zstr(username)) {
+                username = NULL;
+        }
+
+        if (zstr(password)) {
+                password = NULL;
+        }
+
+        if (dsn) {
+                odbc_obj = new_odbc_obj(dsn, username, password);
+        }
+
+        if (!odbc_obj) {
+                return JS_FALSE;
+        }
+
+        if (!(odbc_obj-&gt;colbuf = (SQLCHAR *) malloc(blen))) {
+                destroy_odbc_obj(&amp;odbc_obj);
+                return JS_FALSE;
+        }
+
+        odbc_obj-&gt;cblen = blen;
+
+        blen += 1536;
+
+        if (!(odbc_obj-&gt;code = (SQLCHAR *) malloc(blen))) {
+                destroy_odbc_obj(&amp;odbc_obj);
+                return JS_FALSE;
+        }
+
+        odbc_obj-&gt;codelen = blen;
+
+        JS_SetPrivate(cx, obj, odbc_obj);
+
+        return JS_TRUE;
+}
+
+static void odbc_destroy(JSContext * cx, JSObject * obj)
+{
+        odbc_obj_t *odbc_obj;
+        if (obj == NULL)
+                return;
+        odbc_obj = (odbc_obj_t *) JS_GetPrivate(cx, obj);
+        if (odbc_obj) {
+                destroy_odbc_obj(&amp;odbc_obj);
+                JS_SetPrivate(cx, obj, NULL);
+        }
+}
+
+static JSBool odbc_connect(JSContext * cx, JSObject * obj, uintN argc, jsval * argv, jsval * rval)
+{
+        odbc_obj_t *odbc_obj = (odbc_obj_t *) JS_GetPrivate(cx, obj);
+        JSBool tf = JS_TRUE;
+
+        if (odbc_obj) {
+                if (odbc_obj_connect(odbc_obj) == SWITCH_ODBC_SUCCESS) {
+                        tf = JS_TRUE;
+                } else {
+                        tf = JS_FALSE;
+                }
+        } else {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, &quot;Database handle is not initialized!\n&quot;);
+        }
+
+        *rval = BOOLEAN_TO_JSVAL(tf);
+
+        return JS_TRUE;
+}
+
+static JSBool odbc_execute(JSContext * cx, JSObject * obj, uintN argc, jsval * argv, jsval * rval)
+{
+        odbc_obj_t *odbc_obj = (odbc_obj_t *) JS_GetPrivate(cx, obj);
+        char *sql;
+        JSBool tf = JS_FALSE;
+        SQLHSTMT stmt;
+
+        if (argc &lt; 1) {
+                goto done;
+        }
+
+        if (!odbc_obj || switch_odbc_handle_get_state(odbc_obj-&gt;handle) != SWITCH_ODBC_STATE_CONNECTED) {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, &quot;Database is not connected!\n&quot;);
+                goto done;
+        }
+
+        sql = JS_GetStringBytes(JS_ValueToString(cx, argv[0]));
+
+        if (switch_odbc_handle_exec(odbc_obj-&gt;handle, sql, &amp;stmt, NULL) != SWITCH_ODBC_SUCCESS) {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, &quot;[ODBC] Execute failed for: %s\n&quot;, sql);
+                goto done;
+        }
+
+        SQLFreeHandle(SQL_HANDLE_STMT, stmt);
+
+        tf = JS_TRUE;
+
+  done:
+
+        *rval = BOOLEAN_TO_JSVAL(tf);
+
+        return JS_TRUE;
+}
+
+static JSBool odbc_exec(JSContext * cx, JSObject * obj, uintN argc, jsval * argv, jsval * rval)
+{
+        odbc_obj_t *odbc_obj = (odbc_obj_t *) JS_GetPrivate(cx, obj);
+        char *sql;
+        JSBool tf = JS_FALSE;
+
+        if (argc &lt; 1) {
+                goto done;
+        }
+
+        if (!odbc_obj || switch_odbc_handle_get_state(odbc_obj-&gt;handle) != SWITCH_ODBC_STATE_CONNECTED) {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, &quot;Database is not connected!\n&quot;);
+                goto done;
+        }
+
+        if (odbc_obj-&gt;stmt) {
+                SQLFreeHandle(SQL_HANDLE_STMT, odbc_obj-&gt;stmt);
+                odbc_obj-&gt;stmt = NULL;
+        }
+
+        sql = JS_GetStringBytes(JS_ValueToString(cx, argv[0]));
+
+        if (switch_odbc_handle_exec(odbc_obj-&gt;handle, sql, &amp;odbc_obj-&gt;stmt, NULL) != SWITCH_ODBC_SUCCESS) {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, &quot;[ODBC] query failed: %s\n&quot;, sql);
+                goto done;
+        }
+
+        tf = JS_TRUE;
+
+  done:
+
+        *rval = BOOLEAN_TO_JSVAL(tf);
+
+        return JS_TRUE;
+}
+
+static JSBool odbc_num_rows(JSContext * cx, JSObject * obj, uintN argc, jsval * argv, jsval * rval)
+{
+        odbc_obj_t *odbc_obj = (odbc_obj_t *) JS_GetPrivate(cx, obj);
+        SQLLEN row_count = 0;
+        
+        if (!odbc_obj || switch_odbc_handle_get_state(odbc_obj-&gt;handle) != SWITCH_ODBC_STATE_CONNECTED) {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, &quot;Database is not connected!\n&quot;);
+                goto done;
+        }
+
+        if (odbc_obj-&gt;stmt) {
+                SQLRowCount(odbc_obj-&gt;stmt, &amp;row_count);
+        }
+
+  done:
+
+        *rval = INT_TO_JSVAL(row_count);
+
+        return JS_TRUE;
+
+}
+
+
+static JSBool odbc_num_cols(JSContext * cx, JSObject * obj, uintN argc, jsval * argv, jsval * rval)
+{
+        odbc_obj_t *odbc_obj = (odbc_obj_t *) JS_GetPrivate(cx, obj);
+
+        SQLSMALLINT cols = 0;
+
+        if (!odbc_obj || switch_odbc_handle_get_state(odbc_obj-&gt;handle) != SWITCH_ODBC_STATE_CONNECTED) {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, &quot;Database is not connected!\n&quot;);
+                goto done;
+        }
+
+        if (odbc_obj-&gt;stmt) {
+                SQLNumResultCols(odbc_obj-&gt;stmt, &amp;cols);
+        }
+
+  done:
+
+        *rval = INT_TO_JSVAL(cols);
+
+        return JS_TRUE;
+
+}
+
+
+static JSBool odbc_next_row(JSContext * cx, JSObject * obj, uintN argc, jsval * argv, jsval * rval)
+{
+        odbc_obj_t *odbc_obj = (odbc_obj_t *) JS_GetPrivate(cx, obj);
+        int result = 0;
+        JSBool tf = JS_FALSE;
+
+        if (!odbc_obj || switch_odbc_handle_get_state(odbc_obj-&gt;handle) != SWITCH_ODBC_STATE_CONNECTED) {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, &quot;Database is not connected!\n&quot;);
+                goto done;
+        }
+
+
+        if (odbc_obj-&gt;stmt) {
+                if ((result = SQLFetch(odbc_obj-&gt;stmt) == SQL_SUCCESS)) {
+                        tf = JS_TRUE;
+                }
+        }
+
+  done:
+
+        *rval = BOOLEAN_TO_JSVAL(tf);
+
+        return JS_TRUE;
+}
+
+static char *escape_data(char *in, char escapeChar)
+{
+        switch_size_t nlen = strlen(in);
+        uint32_t qc = 0;
+        char *p, *q, *r;
+
+        for (p = in; p &amp;&amp; *p; p++) {
+                if (*p == '&quot;') {
+                        qc += 2;
+                }
+                if (*p == '\'') {
+                        qc += 2;
+                }
+        }
+
+        nlen += qc + 1;
+
+        if (!(q = (char *) malloc(nlen))) {
+                return NULL;
+        }
+
+        r = q;
+        qc = 0;
+        for (p = in; p &amp;&amp; *p; p++) {
+                if (*p == '&quot;') {
+                        *r++ = escapeChar;
+                }
+                if (*p == '\'') {
+                        *r++ = escapeChar;
+                }
+                *r++ = *p;
+                if (++qc &gt; nlen) {
+                        break;
+                }
+        }
+
+        *r++ = '\0';
+
+        return q;
+
+}
+
+
+static JSBool odbc_get_data(JSContext * cx, JSObject * obj, uintN argc, jsval * argv, jsval * rval)
+{
+
+        odbc_obj_t *odbc_obj = (odbc_obj_t *) JS_GetPrivate(cx, obj);
+        JSBool tf = JS_FALSE;
+
+        if (!odbc_obj || switch_odbc_handle_get_state(odbc_obj-&gt;handle) != SWITCH_ODBC_STATE_CONNECTED) {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, &quot;Database is not connected!\n&quot;);
+                goto done;
+        }
+
+        if (odbc_obj-&gt;stmt) {
+                SQLSMALLINT nColumns = 0, x = 0;
+
+                eval_some_js(&quot;~var _oDbC_dB_RoW_DaTa_ = {}&quot;, cx, obj, rval);
+                if (*rval == JS_FALSE) {
+                        return JS_TRUE;
+                }
+
+                if ( SQLNumResultCols( odbc_obj-&gt;stmt, &amp;nColumns ) != SQL_SUCCESS )
+                        return JS_FALSE;
+
+                for (x = 1; x &lt;= nColumns; x++) {
+                        SQLSMALLINT NameLength, DataType, DecimalDigits, Nullable;
+                        SQLULEN ColumnSize;
+                        SQLCHAR name[1024] = &quot;&quot;;
+                        SQLCHAR *data = odbc_obj-&gt;colbuf;
+                        SQLCHAR *esc = NULL;
+
+                        SQLDescribeCol(odbc_obj-&gt;stmt, x, name, sizeof(name), &amp;NameLength, &amp;DataType, &amp;ColumnSize, &amp;DecimalDigits, &amp;Nullable);
+                        SQLGetData(odbc_obj-&gt;stmt, x, SQL_C_CHAR, odbc_obj-&gt;colbuf, odbc_obj-&gt;cblen, NULL);
+
+                        if (strchr((char *) odbc_obj-&gt;colbuf, '&quot;')) {        /* please don't */
+                                esc = (SQLCHAR *) escape_data((char *) odbc_obj-&gt;colbuf, '\\');
+                                data = esc;
+                        }
+
+                        switch_snprintf((char *) odbc_obj-&gt;code, odbc_obj-&gt;codelen, &quot;~_oDbC_dB_RoW_DaTa_[\&quot;%s\&quot;] = \&quot;%s\&quot;&quot;, name, data);
+                        switch_safe_free(esc);
+
+                        eval_some_js((char *) odbc_obj-&gt;code, cx, obj, rval);
+
+                        if (*rval == JS_FALSE) {
+                                return JS_TRUE;
+                        }
+                }
+
+                JS_GetProperty(cx, obj, &quot;_oDbC_dB_RoW_DaTa_&quot;, rval);
+                return JS_TRUE;
+                
+
+        }
+
+  done:
+
+        *rval = BOOLEAN_TO_JSVAL(tf);
+
+        return JS_TRUE;
+
+}
+
+static JSBool odbc_close(JSContext * cx, JSObject * obj, uintN argc, jsval * argv, jsval * rval)
+{
+        odbc_destroy(cx, obj);
+        return JS_TRUE;
+}
+
+
+static JSBool odbc_disconnect(JSContext * cx, JSObject * obj, uintN argc, jsval * argv, jsval * rval)
+{
+        odbc_obj_t *odbc_obj = (odbc_obj_t *) JS_GetPrivate(cx, obj);
+
+        if (!odbc_obj) {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, &quot;Database handle is not initialized!\n&quot;);
+                goto done;
+        }
+
+        if (switch_odbc_handle_get_state(odbc_obj-&gt;handle) != SWITCH_ODBC_STATE_CONNECTED) {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, &quot;Database is not connected!\n&quot;);
+                goto done;
+        }
+
+        switch_odbc_handle_disconnect(odbc_obj-&gt;handle);
+
+ done:
+
+        return JS_TRUE;
+}
+
+enum odbc_tinyid {
+        odbc_NAME
+};
+
+static JSFunctionSpec odbc_methods[] = {
+        {&quot;connect&quot;, odbc_connect, 1},
+        {&quot;disconnect&quot;, odbc_disconnect, 1},
+        {&quot;exec&quot;, odbc_exec, 1},
+        {&quot;query&quot;, odbc_exec, 1},
+        {&quot;execute&quot;, odbc_execute, 1},
+        {&quot;numRows&quot;, odbc_num_rows, 1},
+        {&quot;numCols&quot;, odbc_num_cols, 1},
+        {&quot;nextRow&quot;, odbc_next_row, 1},
+        {&quot;getData&quot;, odbc_get_data, 1},
+        {&quot;close&quot;, odbc_close, 1},
+        {0}
+};
+
+
+static JSPropertySpec odbc_props[] = {
+        {&quot;name&quot;, odbc_NAME, JSPROP_READONLY | JSPROP_PERMANENT},
+        {0}
+};
+
+static JSBool odbc_setProperty(JSContext * cx, JSObject * obj, jsval id, jsval * vp)
+{
+        char *name = JS_GetStringBytes(JS_ValueToString(cx, id));
+
+        if (strcmp(name, &quot;_oDbC_dB_RoW_DaTa_&quot;)) {
+                eval_some_js(&quot;~throw new Error(\&quot;this property cannot be changed!\&quot;);&quot;, cx, obj, vp);
+                *vp = BOOLEAN_TO_JSVAL(JS_FALSE);
+        }
+        return JS_TRUE;
+}
+
+static JSBool odbc_getProperty(JSContext * cx, JSObject * obj, jsval id, jsval * vp)
+{
+        int param;
+        char *name = JS_GetStringBytes(JS_ValueToString(cx, id));
+
+        /* numbers are our props anything else is a method */
+        if (name[0] &gt;= 48 &amp;&amp; name[0] &lt;= 57) {
+                param = atoi(name);
+        } else {
+                return JS_TRUE;
+        }
+
+        *vp = BOOLEAN_TO_JSVAL(JS_FALSE);
+        return JS_TRUE;
+}
+
+JSClass odbc_class = {
+        modname, JSCLASS_HAS_PRIVATE,
+        JS_PropertyStub, JS_PropertyStub, odbc_getProperty, odbc_setProperty,
+        JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, odbc_destroy, NULL, NULL, NULL,
+        odbc_construct
+};
+
+
+switch_status_t odbc_load(JSContext * cx, JSObject * obj)
+{
+        JS_InitClass(cx, obj, NULL, &amp;odbc_class, odbc_construct, 3, odbc_props, odbc_methods, odbc_props, odbc_methods);
+        return SWITCH_STATUS_SUCCESS;
+}
+
+
+const sm_module_interface_t odbc_module_interface = {
+        /*.name = */ modname,
+        /*.spidermonkey_load */ odbc_load,
+        /*.next */ NULL
+};
+
+SWITCH_MOD_DECLARE_NONSTD(switch_status_t) spidermonkey_init(const sm_module_interface_t **module_interface)
+{
+        *module_interface = &amp;odbc_module_interface;
+        return SWITCH_STATUS_SUCCESS;
+}
+
+/* For Emacs:
+ * Local Variables:
+ * mode:c
+ * indent-tabs-mode:t
+ * tab-width:4
+ * c-basic-offset:4
+ * End:
+ * For VIM:
+ * vim:set softtabstop=4 shiftwidth=4 tabstop=4:
+ */
</ins></span></pre></div>
<a id="freeswitchtrunksrcmodlanguagesmod_spidermonkeymod_spidermonkey_odbcvcprojfromrev16304freeswitchtrunksrcmodlanguagesmod_spidermonkey_odbcmod_spidermonkey_odbcvcproj"></a>
<div class="copfile"><h4>Copied: freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_odbc.vcproj (from rev 16304, freeswitch/trunk/src/mod/languages/mod_spidermonkey_odbc/mod_spidermonkey_odbc.vcproj) (0 => 16333)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_odbc.vcproj                                (rev 0)
+++ freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_odbc.vcproj        2010-01-17 05:48:36 UTC (rev 16333)
</span><span class="lines">@@ -0,0 +1,98 @@
</span><ins>+&lt;?xml version=&quot;1.0&quot; encoding=&quot;Windows-1252&quot;?&gt;
+&lt;VisualStudioProject
+        ProjectType=&quot;Visual C++&quot;
+        Version=&quot;8.00&quot;
+        Name=&quot;mod_spidermonkey_odbc&quot;
+        ProjectGUID=&quot;{0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}&quot;
+        RootNamespace=&quot;mod_spidermonkey_odbc&quot;
+        Keyword=&quot;Win32Proj&quot;
+        &gt;
+        &lt;Platforms&gt;
+                &lt;Platform
+                        Name=&quot;Win32&quot;
+                /&gt;
+        &lt;/Platforms&gt;
+        &lt;ToolFiles&gt;
+        &lt;/ToolFiles&gt;
+        &lt;Configurations&gt;
+                &lt;Configuration
+                        Name=&quot;Debug|Win32&quot;
+                        ConfigurationType=&quot;2&quot;
+                        InheritedPropertySheets=&quot;..\..\..\..\w32\winlibs.vsprops;..\..\..\..\w32\module_debug.vsprops;..\..\..\..\w32\spidermonkey.vsprops&quot;
+                        CharacterSet=&quot;2&quot;
+                        &gt;
+                        &lt;Tool
+                                Name=&quot;VCPreBuildEventTool&quot;
+                                CommandLine=&quot;&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCustomBuildTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXMLDataGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCWebServiceProxyGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCMIDLTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCLCompilerTool&quot;
+                                AdditionalIncludeDirectories=&quot;&quot;
+                                UsePrecompiledHeader=&quot;0&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCLinkerTool&quot;
+                                AdditionalLibraryDirectories=&quot;&quot;
+                        /&gt;
+                &lt;/Configuration&gt;
+                &lt;Configuration
+                        Name=&quot;Release|Win32&quot;
+                        ConfigurationType=&quot;2&quot;
+                        InheritedPropertySheets=&quot;..\..\..\..\w32\winlibs.vsprops;..\..\..\..\w32\module_release.vsprops;..\..\..\..\w32\spidermonkey.vsprops&quot;
+                        CharacterSet=&quot;2&quot;
+                        &gt;
+                        &lt;Tool
+                                Name=&quot;VCPreBuildEventTool&quot;
+                                CommandLine=&quot;&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCustomBuildTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXMLDataGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCWebServiceProxyGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCMIDLTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCLCompilerTool&quot;
+                                WholeProgramOptimization=&quot;true&quot;
+                                AdditionalIncludeDirectories=&quot;&quot;
+                                RuntimeLibrary=&quot;2&quot;
+                                UsePrecompiledHeader=&quot;0&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCLinkerTool&quot;
+                                AdditionalLibraryDirectories=&quot;&quot;
+                                OptimizeReferences=&quot;2&quot;
+                                EnableCOMDATFolding=&quot;2&quot;
+                                LinkTimeCodeGeneration=&quot;1&quot;
+                        /&gt;
+                &lt;/Configuration&gt;
+        &lt;/Configurations&gt;
+        &lt;References&gt;
+        &lt;/References&gt;
+        &lt;Files&gt;
+                &lt;File
+                        RelativePath=&quot;.\mod_spidermonkey_odbc.c&quot;
+                        &gt;
+                &lt;/File&gt;
+        &lt;/Files&gt;
+        &lt;Globals&gt;
+        &lt;/Globals&gt;
+&lt;/VisualStudioProject&gt;
</ins></span></pre></div>
<a id="freeswitchtrunksrcmodlanguagesmod_spidermonkeymod_spidermonkey_skelcfromrev16304freeswitchtrunksrcmodlanguagesmod_spidermonkey_skelmod_spidermonkey_skelc"></a>
<div class="copfile"><h4>Copied: freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_skel.c (from rev 16304, freeswitch/trunk/src/mod/languages/mod_spidermonkey_skel/mod_spidermonkey_skel.c) (0 => 16333)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_skel.c                                (rev 0)
+++ freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_skel.c        2010-01-17 05:48:36 UTC (rev 16333)
</span><span class="lines">@@ -0,0 +1,111 @@
</span><ins>+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2005-2009, Anthony Minessale II &lt;anthm@freeswitch.org&gt;
+ *
+ * Version: MPL 1.1
+ *
+ * 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 FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * Anthony Minessale II &lt;anthm@freeswitch.org&gt;
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * Anthony Minessale II &lt;anthm@freeswitch.org&gt;
+ *
+ *
+ * mod_spidermonkey_skel.c -- Skel Javascript Module
+ *
+ */
+#include &quot;mod_spidermonkey.h&quot;
+
+static const char modname[] = &quot;Skel&quot;;
+
+/* Skel Object */
+/*********************************************************************************/
+static JSBool skel_construct(JSContext * cx, JSObject * obj, uintN argc, jsval * argv, jsval * rval)
+{
+        return JS_TRUE;
+}
+
+static void skel_destroy(JSContext * cx, JSObject * obj)
+{
+}
+
+static JSBool skel_my_method(JSContext * cx, JSObject * obj, uintN argc, jsval * argv, jsval * rval)
+{
+        return JS_FALSE;
+}
+
+enum skel_tinyid {
+        SKEL_NAME
+};
+
+static JSFunctionSpec skel_methods[] = {
+        {&quot;myMethod&quot;, skel_my_method, 1},
+        {0}
+};
+
+
+static JSPropertySpec skel_props[] = {
+        {&quot;name&quot;, SKEL_NAME, JSPROP_READONLY | JSPROP_PERMANENT},
+        {0}
+};
+
+
+static JSBool skel_getProperty(JSContext * cx, JSObject * obj, jsval id, jsval * vp)
+{
+        JSBool res = JS_TRUE;
+
+        return res;
+}
+
+JSClass skel_class = {
+        modname, JSCLASS_HAS_PRIVATE,
+        JS_PropertyStub, JS_PropertyStub, skel_getProperty, DEFAULT_SET_PROPERTY,
+        JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, skel_destroy, NULL, NULL, NULL,
+        skel_construct
+};
+
+
+switch_status_t spidermonkey_load(JSContext * cx, JSObject * obj)
+{
+        JS_InitClass(cx, obj, NULL, &amp;skel_class, skel_construct, 3, skel_props, skel_methods, skel_props, skel_methods);
+        return SWITCH_STATUS_SUCCESS;
+}
+
+
+const sm_module_interface_t skel_module_interface = {
+        /*.name = */ modname,
+        /*.spidermonkey_load */ spidermonkey_load,
+        /*.next */ NULL
+};
+
+SWITCH_MOD_DECLARE(switch_status_t) spidermonkey_init(const sm_module_interface_t **module_interface)
+{
+        *module_interface = &amp;skel_module_interface;
+        return SWITCH_STATUS_SUCCESS;
+}
+
+/* For Emacs:
+ * Local Variables:
+ * mode:c
+ * indent-tabs-mode:t
+ * tab-width:4
+ * c-basic-offset:4
+ * End:
+ * For VIM:
+ * vim:set softtabstop=4 shiftwidth=4 tabstop=4:
+ */
</ins></span></pre></div>
<a id="freeswitchtrunksrcmodlanguagesmod_spidermonkeymod_spidermonkey_socket2008vcprojfromrev16304freeswitchtrunksrcmodlanguagesmod_spidermonkey_socketmod_spidermonkey_socket2008vcproj"></a>
<div class="copfile"><h4>Copied: freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_socket.2008.vcproj (from rev 16304, freeswitch/trunk/src/mod/languages/mod_spidermonkey_socket/mod_spidermonkey_socket.2008.vcproj) (0 => 16333)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_socket.2008.vcproj                                (rev 0)
+++ freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_socket.2008.vcproj        2010-01-17 05:48:36 UTC (rev 16333)
</span><span class="lines">@@ -0,0 +1,291 @@
</span><ins>+&lt;?xml version=&quot;1.0&quot; encoding=&quot;Windows-1252&quot;?&gt;
+&lt;VisualStudioProject
+        ProjectType=&quot;Visual C++&quot;
+        Version=&quot;9.00&quot;
+        Name=&quot;mod_spidermonkey_socket&quot;
+        ProjectGUID=&quot;{028C7278-05D7-4E18-82FE-BE231B844F41}&quot;
+        RootNamespace=&quot;mod_spidermonkey_socket&quot;
+        Keyword=&quot;Win32Proj&quot;
+        TargetFrameworkVersion=&quot;131072&quot;
+        &gt;
+        &lt;Platforms&gt;
+                &lt;Platform
+                        Name=&quot;Win32&quot;
+                /&gt;
+                &lt;Platform
+                        Name=&quot;x64&quot;
+                /&gt;
+        &lt;/Platforms&gt;
+        &lt;ToolFiles&gt;
+        &lt;/ToolFiles&gt;
+        &lt;Configurations&gt;
+                &lt;Configuration
+                        Name=&quot;Debug|Win32&quot;
+                        ConfigurationType=&quot;2&quot;
+                        InheritedPropertySheets=&quot;..\..\..\..\w32\winlibs.vsprops;..\..\..\..\w32\module_debug.vsprops;..\..\..\..\w32\spidermonkey.vsprops&quot;
+                        CharacterSet=&quot;1&quot;
+                        &gt;
+                        &lt;Tool
+                                Name=&quot;VCPreBuildEventTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCustomBuildTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXMLDataGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCWebServiceProxyGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCMIDLTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCLCompilerTool&quot;
+                                AdditionalIncludeDirectories=&quot;&quot;
+                                UsePrecompiledHeader=&quot;0&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCManagedResourceCompilerTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCResourceCompilerTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCPreLinkEventTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCLinkerTool&quot;
+                                AdditionalLibraryDirectories=&quot;&quot;
+                                RandomizedBaseAddress=&quot;1&quot;
+                                DataExecutionPrevention=&quot;0&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCALinkTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCManifestTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXDCMakeTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCBscMakeTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCFxCopTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCAppVerifierTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCPostBuildEventTool&quot;
+                        /&gt;
+                &lt;/Configuration&gt;
+                &lt;Configuration
+                        Name=&quot;Debug|x64&quot;
+                        ConfigurationType=&quot;2&quot;
+                        InheritedPropertySheets=&quot;..\..\..\..\w32\winlibs.vsprops;..\..\..\..\w32\module_debug.vsprops;..\..\..\..\w32\spidermonkey.vsprops&quot;
+                        CharacterSet=&quot;1&quot;
+                        &gt;
+                        &lt;Tool
+                                Name=&quot;VCPreBuildEventTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCustomBuildTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXMLDataGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCWebServiceProxyGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCMIDLTool&quot;
+                                TargetEnvironment=&quot;3&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCLCompilerTool&quot;
+                                AdditionalIncludeDirectories=&quot;&quot;
+                                UsePrecompiledHeader=&quot;0&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCManagedResourceCompilerTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCResourceCompilerTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCPreLinkEventTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCLinkerTool&quot;
+                                OutputFile=&quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)/mod/$(ProjectName).dll&quot;
+                                AdditionalLibraryDirectories=&quot;&quot;
+                                RandomizedBaseAddress=&quot;1&quot;
+                                DataExecutionPrevention=&quot;0&quot;
+                                TargetMachine=&quot;17&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCALinkTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCManifestTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXDCMakeTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCBscMakeTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCFxCopTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCAppVerifierTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCPostBuildEventTool&quot;
+                        /&gt;
+                &lt;/Configuration&gt;
+                &lt;Configuration
+                        Name=&quot;Release|Win32&quot;
+                        ConfigurationType=&quot;2&quot;
+                        InheritedPropertySheets=&quot;..\..\..\..\w32\winlibs.vsprops;..\..\..\..\w32\module_release.vsprops;..\..\..\..\w32\spidermonkey.vsprops&quot;
+                        CharacterSet=&quot;1&quot;
+                        WholeProgramOptimization=&quot;1&quot;
+                        &gt;
+                        &lt;Tool
+                                Name=&quot;VCPreBuildEventTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCustomBuildTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXMLDataGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCWebServiceProxyGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCMIDLTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCLCompilerTool&quot;
+                                AdditionalIncludeDirectories=&quot;&quot;
+                                UsePrecompiledHeader=&quot;0&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCManagedResourceCompilerTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCResourceCompilerTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCPreLinkEventTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCLinkerTool&quot;
+                                RandomizedBaseAddress=&quot;1&quot;
+                                DataExecutionPrevention=&quot;0&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCALinkTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCManifestTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXDCMakeTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCBscMakeTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCFxCopTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCAppVerifierTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCPostBuildEventTool&quot;
+                        /&gt;
+                &lt;/Configuration&gt;
+                &lt;Configuration
+                        Name=&quot;Release|x64&quot;
+                        ConfigurationType=&quot;2&quot;
+                        InheritedPropertySheets=&quot;..\..\..\..\w32\winlibs.vsprops;..\..\..\..\w32\module_release.vsprops;..\..\..\..\w32\spidermonkey.vsprops&quot;
+                        CharacterSet=&quot;1&quot;
+                        WholeProgramOptimization=&quot;1&quot;
+                        &gt;
+                        &lt;Tool
+                                Name=&quot;VCPreBuildEventTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCustomBuildTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXMLDataGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCWebServiceProxyGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCMIDLTool&quot;
+                                TargetEnvironment=&quot;3&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCLCompilerTool&quot;
+                                AdditionalIncludeDirectories=&quot;&quot;
+                                UsePrecompiledHeader=&quot;0&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCManagedResourceCompilerTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCResourceCompilerTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCPreLinkEventTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCLinkerTool&quot;
+                                OutputFile=&quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)/mod/$(ProjectName).dll&quot;
+                                RandomizedBaseAddress=&quot;1&quot;
+                                DataExecutionPrevention=&quot;0&quot;
+                                TargetMachine=&quot;17&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCALinkTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCManifestTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXDCMakeTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCBscMakeTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCFxCopTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCAppVerifierTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCPostBuildEventTool&quot;
+                        /&gt;
+                &lt;/Configuration&gt;
+        &lt;/Configurations&gt;
+        &lt;References&gt;
+        &lt;/References&gt;
+        &lt;Files&gt;
+                &lt;File
+                        RelativePath=&quot;.\mod_spidermonkey_socket.c&quot;
+                        &gt;
+                &lt;/File&gt;
+        &lt;/Files&gt;
+        &lt;Globals&gt;
+        &lt;/Globals&gt;
+&lt;/VisualStudioProject&gt;
</ins></span></pre></div>
<a id="freeswitchtrunksrcmodlanguagesmod_spidermonkeymod_spidermonkey_socketcfromrev16304freeswitchtrunksrcmodlanguagesmod_spidermonkey_socketmod_spidermonkey_socketc"></a>
<div class="copfile"><h4>Copied: freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_socket.c (from rev 16304, freeswitch/trunk/src/mod/languages/mod_spidermonkey_socket/mod_spidermonkey_socket.c) (0 => 16333)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_socket.c                                (rev 0)
+++ freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_socket.c        2010-01-17 05:48:36 UTC (rev 16333)
</span><span class="lines">@@ -0,0 +1,342 @@
</span><ins>+/* 
+ * Spidermonkey Socket Module
+ * Copyright (C) 2007, Jonas Gauffin &lt;jonas.gauffin@gmail.com&gt;
+ *
+ * Version: MPL 1.1
+ *
+ * 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 Initial Developer of the Original Code is
+ * Jonas Gauffin
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * Jonas Gauffin &lt;jonas.gauffin@gmail.com&gt;
+ *
+ *
+ * mod_spidermonkey_socket.c -- Socket Javascript Module
+ *
+ */
+#include &quot;mod_spidermonkey.h&quot;
+
+static const char modname[] = &quot;Socket&quot;;
+
+struct js_socket_obj {
+        switch_socket_t *socket;
+        switch_memory_pool_t *pool;
+        char *read_buffer;
+        switch_size_t buffer_size;
+        int state;
+        jsrefcount saveDepth;
+};
+typedef struct js_socket_obj js_socket_obj_t;
+
+/* Socket Object */
+/*********************************************************************************/
+static JSBool socket_construct(JSContext * cx, JSObject * obj, uintN argc, jsval * argv, jsval * rval)
+{
+        js_socket_obj_t *js_socket_obj = 0;
+        switch_memory_pool_t *pool;
+        switch_socket_t *socket;
+        switch_status_t ret;
+
+        switch_core_new_memory_pool(&amp;pool);
+        ret = switch_socket_create(&amp;socket, AF_INET, SOCK_STREAM, SWITCH_PROTO_TCP, pool);
+        if (ret != SWITCH_STATUS_SUCCESS) {
+                switch_core_destroy_memory_pool(&amp;pool);
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, &quot;Failed to create socket, reason: %d.\n&quot;, ret);
+                return JS_FALSE;
+        }
+        // allocate information needed by JS to be able to write to the log.
+        // (needed since multitple js sessions can write to the same log)
+        js_socket_obj = switch_core_alloc(pool, sizeof(js_socket_obj_t));
+        js_socket_obj-&gt;pool = pool;
+        js_socket_obj-&gt;socket = socket;
+        JS_SetPrivate(cx, obj, js_socket_obj);
+        return JS_TRUE;
+}
+
+static void socket_destroy(JSContext * cx, JSObject * obj)
+{
+        js_socket_obj_t *socket = JS_GetPrivate(cx, obj);
+        if (socket == NULL)
+                return;
+
+        if (socket-&gt;socket != 0) {
+                socket-&gt;saveDepth = JS_SuspendRequest(cx);
+                switch_socket_shutdown(socket-&gt;socket, SWITCH_SHUTDOWN_READWRITE);
+                switch_socket_close(socket-&gt;socket);
+                switch_core_destroy_memory_pool(&amp;socket-&gt;pool);
+                JS_ResumeRequest(cx, socket-&gt;saveDepth);
+        }
+
+}
+
+static JSBool socket_connect(JSContext * cx, JSObject * obj, uintN argc, jsval * argv, jsval * rval)
+{
+        js_socket_obj_t *socket = JS_GetPrivate(cx, obj);
+        if (socket == NULL) {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, &quot;Failed to find js object.\n&quot;);
+                return JS_FALSE;
+        }
+
+        if (argc == 2) {
+                char *host = JS_GetStringBytes(JS_ValueToString(cx, argv[0]));
+                int32 port;
+                switch_sockaddr_t *addr;
+                switch_status_t ret;
+
+                JS_ValueToInt32(cx, argv[1], &amp;port);
+
+                ret = switch_sockaddr_info_get(&amp;addr, host, AF_INET, (switch_port_t) port, 0, socket-&gt;pool);
+                if (ret != SWITCH_STATUS_SUCCESS) {
+                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, &quot;switch_sockaddr_info_get failed: %d.\n&quot;, ret);
+                        return JS_FALSE;
+                }
+
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, &quot;Connecting to: %s:%d.\n&quot;, host, port);
+                socket-&gt;saveDepth = JS_SuspendRequest(cx);
+                ret = switch_socket_connect(socket-&gt;socket, addr);
+                JS_ResumeRequest(cx, socket-&gt;saveDepth);
+                if (ret != SWITCH_STATUS_SUCCESS) {
+                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, &quot;switch_socket_connect failed: %d.\n&quot;, ret);
+                        *rval = BOOLEAN_TO_JSVAL(JS_FALSE);
+                } else
+                        *rval = BOOLEAN_TO_JSVAL(JS_TRUE);
+
+        }
+
+        return JS_TRUE;
+}
+
+static JSBool socket_send(JSContext * cx, JSObject * obj, uintN argc, jsval * argv, jsval * rval)
+{
+        js_socket_obj_t *socket = JS_GetPrivate(cx, obj);
+        if (socket == NULL) {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, &quot;Failed to find js object.\n&quot;);
+                return JS_FALSE;
+        }
+
+        if (argc == 1) {
+                switch_status_t ret;
+                char *buffer = JS_GetStringBytes(JS_ValueToString(cx, argv[0]));
+                switch_size_t len = strlen(buffer);
+                socket-&gt;saveDepth = JS_SuspendRequest(cx);
+                ret = switch_socket_send(socket-&gt;socket, buffer, &amp;len);
+                JS_ResumeRequest(cx, socket-&gt;saveDepth);
+                if (ret != SWITCH_STATUS_SUCCESS) {
+                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, &quot;switch_socket_send failed: %d.\n&quot;, ret);
+                        *rval = BOOLEAN_TO_JSVAL(JS_FALSE);
+                } else
+                        *rval = BOOLEAN_TO_JSVAL(JS_TRUE);
+        }
+
+        return JS_TRUE;
+}
+
+static JSBool socket_read_bytes(JSContext * cx, JSObject * obj, uintN argc, jsval * argv, jsval * rval)
+{
+        js_socket_obj_t *socket = JS_GetPrivate(cx, obj);
+        if (socket == NULL) {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, &quot;Failed to find js object.\n&quot;);
+                return JS_FALSE;
+        }
+
+        if (argc == 1) {
+                int32 bytes_to_read;
+                switch_status_t ret;
+                switch_size_t len;
+
+                JS_ValueToInt32(cx, argv[0], &amp;bytes_to_read);
+                len = (switch_size_t) bytes_to_read;
+
+                if (socket-&gt;buffer_size &lt; len) {
+                        socket-&gt;read_buffer = switch_core_alloc(socket-&gt;pool, len + 1);
+                        socket-&gt;buffer_size = bytes_to_read + 1;
+                }
+
+                socket-&gt;saveDepth = JS_SuspendRequest(cx);
+                ret = switch_socket_recv(socket-&gt;socket, socket-&gt;read_buffer, &amp;len);
+                JS_ResumeRequest(cx, socket-&gt;saveDepth);
+                if (ret != SWITCH_STATUS_SUCCESS) {
+                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, &quot;switch_socket_send failed: %d.\n&quot;, ret);
+                        *rval = BOOLEAN_TO_JSVAL(JS_FALSE);
+                } else {
+                        socket-&gt;read_buffer[len] = 0;
+                        *rval = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, socket-&gt;read_buffer));
+                }
+        }
+
+        return JS_TRUE;
+}
+
+static JSBool socket_read(JSContext * cx, JSObject * obj, uintN argc, jsval * argv, jsval * rval)
+{
+        js_socket_obj_t *socket = JS_GetPrivate(cx, obj);
+        if (socket == NULL) {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, &quot;Failed to find js object.\n&quot;);
+                return JS_FALSE;
+        }
+
+        if (argc &gt;= 0) {
+                char *delimiter = &quot;\n&quot;;
+                switch_status_t ret = SWITCH_STATUS_FALSE;
+                switch_size_t len = 1;
+                switch_size_t total_length = 0;
+                int can_run = TRUE;
+                char tempbuf[2];
+
+                if (argc == 1)
+                        delimiter = JS_GetStringBytes(JS_ValueToString(cx, argv[0]));
+
+
+                if (socket-&gt;read_buffer == 0)
+                        socket-&gt;read_buffer = switch_core_alloc(socket-&gt;pool, socket-&gt;buffer_size);
+
+                socket-&gt;saveDepth = JS_SuspendRequest(cx);
+                while (can_run == TRUE) {
+                        ret = switch_socket_recv(socket-&gt;socket, tempbuf, &amp;len);
+                        if (ret != SWITCH_STATUS_SUCCESS)
+                                break;
+
+                        tempbuf[1] = 0;
+                        if (tempbuf[0] == delimiter[0])
+                                break;
+                        else if (tempbuf[0] == '\r' &amp;&amp; delimiter[0] == '\n')
+                                continue;
+                        else {
+                                // Buffer is full, let's increase it.
+                                if (total_length == socket-&gt;buffer_size - 1) {
+                                        switch_size_t new_size = socket-&gt;buffer_size + 4196;
+                                        char *new_buffer = switch_core_alloc(socket-&gt;pool, socket-&gt;buffer_size);
+                                        memcpy(new_buffer, socket-&gt;read_buffer, total_length);
+                                        socket-&gt;buffer_size = new_size;
+                                        socket-&gt;read_buffer = new_buffer;
+                                }
+                                socket-&gt;read_buffer[total_length] = tempbuf[0];
+                                ++total_length;
+                        }
+                }
+                JS_ResumeRequest(cx, socket-&gt;saveDepth);
+
+                if (ret != SWITCH_STATUS_SUCCESS) {
+                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, &quot;socket receive failed: %d.\n&quot;, ret);
+                        *rval = BOOLEAN_TO_JSVAL(JS_FALSE);
+                } else {
+                        socket-&gt;read_buffer[total_length] = 0;
+                        *rval = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, socket-&gt;read_buffer));
+                }
+        }
+
+        return JS_TRUE;
+}
+
+static JSBool socket_close(JSContext * cx, JSObject * obj, uintN argc, jsval * argv, jsval * rval)
+{
+        js_socket_obj_t *socket = JS_GetPrivate(cx, obj);
+        if (socket == NULL) {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, &quot;Failed to find js object.\n&quot;);
+                return JS_FALSE;
+        }
+
+        socket-&gt;saveDepth = JS_SuspendRequest(cx);
+        switch_socket_shutdown(socket-&gt;socket, SWITCH_SHUTDOWN_READWRITE);
+        switch_socket_close(socket-&gt;socket);
+        socket-&gt;socket = NULL;
+        JS_ResumeRequest(cx, socket-&gt;saveDepth);
+        return JS_TRUE;
+}
+
+static JSFunctionSpec socket_methods[] = {
+        {&quot;connect&quot;, socket_connect, 1},
+        {&quot;close&quot;, socket_close, 1},
+        {&quot;send&quot;, socket_send, 1},
+        {&quot;readBytes&quot;, socket_read_bytes, 1},
+        {&quot;read&quot;, socket_read, 1},
+        {0}
+};
+
+#define SOCKET_ADDRESS 1
+#define SOCKET_PORT 2
+
+static JSPropertySpec socket_props[] = {
+        {&quot;address&quot;, SOCKET_ADDRESS, JSPROP_READONLY | JSPROP_PERMANENT},
+        {&quot;port&quot;, SOCKET_PORT, JSPROP_READONLY | JSPROP_PERMANENT},
+        {0}
+};
+
+
+static JSBool socket_getProperty(JSContext * cx, JSObject * obj, jsval id, jsval * vp)
+{
+        JSBool res = JS_TRUE;
+//  js_socket_obj_t *socket = JS_GetPrivate(cx, obj);
+        char *name;
+        int param = 0;
+
+        name = JS_GetStringBytes(JS_ValueToString(cx, id));
+        /* numbers are our props anything else is a method */
+        if (name[0] &gt;= 48 &amp;&amp; name[0] &lt;= 57) {
+                param = atoi(name);
+        } else {
+                return JS_TRUE;
+        }
+
+        switch (param) {
+        case SOCKET_ADDRESS:
+                *vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, &quot;unknown&quot;));
+                break;
+        case SOCKET_PORT:
+                *vp = INT_TO_JSVAL(1234);
+                break;
+        }
+
+        return res;
+}
+
+JSClass socket_class = {
+        modname, JSCLASS_HAS_PRIVATE,
+        JS_PropertyStub, JS_PropertyStub, socket_getProperty, JS_PropertyStub,
+        JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, socket_destroy, NULL, NULL, NULL,
+        socket_construct
+};
+
+
+switch_status_t socket_load(JSContext * cx, JSObject * obj)
+{
+        JS_InitClass(cx, obj, NULL, &amp;socket_class, socket_construct, 3, socket_props, socket_methods, socket_props, socket_methods);
+        return SWITCH_STATUS_SUCCESS;
+}
+
+
+const sm_module_interface_t socket_module_interface = {
+        /*.name = */ modname,
+        /*.spidermonkey_load */ socket_load,
+        /*.next */ NULL
+};
+
+SWITCH_MOD_DECLARE_NONSTD(switch_status_t) spidermonkey_init(const sm_module_interface_t **module_interface)
+{
+        *module_interface = &amp;socket_module_interface;
+        return SWITCH_STATUS_SUCCESS;
+}
+
+/* For Emacs:
+ * Local Variables:
+ * mode:c
+ * indent-tabs-mode:t
+ * tab-width:4
+ * c-basic-offset:4
+ * End:
+ * For VIM:
+ * vim:set softtabstop=4 shiftwidth=4 tabstop=4:
+ */
</ins></span></pre></div>
<a id="freeswitchtrunksrcmodlanguagesmod_spidermonkeymod_spidermonkey_socketvcprojfromrev16304freeswitchtrunksrcmodlanguagesmod_spidermonkey_socketmod_spidermonkey_socketvcproj"></a>
<div class="copfile"><h4>Copied: freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_socket.vcproj (from rev 16304, freeswitch/trunk/src/mod/languages/mod_spidermonkey_socket/mod_spidermonkey_socket.vcproj) (0 => 16333)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_socket.vcproj                                (rev 0)
+++ freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_socket.vcproj        2010-01-17 05:48:36 UTC (rev 16333)
</span><span class="lines">@@ -0,0 +1,91 @@
</span><ins>+&lt;?xml version=&quot;1.0&quot; encoding=&quot;Windows-1252&quot;?&gt;
+&lt;VisualStudioProject
+        ProjectType=&quot;Visual C++&quot;
+        Version=&quot;8.00&quot;
+        Name=&quot;mod_spidermonkey_socket&quot;
+        ProjectGUID=&quot;{028C7278-05D7-4E18-82FE-BE231B844F41}&quot;
+        RootNamespace=&quot;mod_spidermonkey_socket&quot;
+        Keyword=&quot;Win32Proj&quot;
+        &gt;
+        &lt;Platforms&gt;
+                &lt;Platform
+                        Name=&quot;Win32&quot;
+                /&gt;
+        &lt;/Platforms&gt;
+        &lt;ToolFiles&gt;
+        &lt;/ToolFiles&gt;
+        &lt;Configurations&gt;
+                &lt;Configuration
+                        Name=&quot;Debug|Win32&quot;
+                        ConfigurationType=&quot;2&quot;
+                        InheritedPropertySheets=&quot;..\..\..\..\w32\winlibs.vsprops;..\..\..\..\w32\module_debug.vsprops;..\..\..\..\w32\spidermonkey.vsprops&quot;
+                        CharacterSet=&quot;1&quot;
+                        &gt;
+                        &lt;Tool
+                                Name=&quot;VCPreBuildEventTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCustomBuildTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXMLDataGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCWebServiceProxyGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCMIDLTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCLCompilerTool&quot;
+                                AdditionalIncludeDirectories=&quot;&quot;
+                                UsePrecompiledHeader=&quot;0&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCLinkerTool&quot;
+                                AdditionalLibraryDirectories=&quot;&quot;
+                        /&gt;
+                &lt;/Configuration&gt;
+                &lt;Configuration
+                        Name=&quot;Release|Win32&quot;
+                        ConfigurationType=&quot;2&quot;
+                        InheritedPropertySheets=&quot;..\..\..\..\w32\winlibs.vsprops;..\..\..\..\w32\module_release.vsprops;..\..\..\..\w32\spidermonkey.vsprops&quot;
+                        CharacterSet=&quot;1&quot;
+                        WholeProgramOptimization=&quot;1&quot;
+                        &gt;
+                        &lt;Tool
+                                Name=&quot;VCPreBuildEventTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCustomBuildTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXMLDataGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCWebServiceProxyGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCMIDLTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCLCompilerTool&quot;
+                                AdditionalIncludeDirectories=&quot;&quot;
+                                UsePrecompiledHeader=&quot;0&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCLinkerTool&quot;
+                        /&gt;
+                &lt;/Configuration&gt;
+        &lt;/Configurations&gt;
+        &lt;References&gt;
+        &lt;/References&gt;
+        &lt;Files&gt;
+                &lt;File
+                        RelativePath=&quot;.\mod_spidermonkey_socket.c&quot;
+                        &gt;
+                &lt;/File&gt;
+        &lt;/Files&gt;
+        &lt;Globals&gt;
+        &lt;/Globals&gt;
+&lt;/VisualStudioProject&gt;
</ins></span></pre></div>
<a id="freeswitchtrunksrcmodlanguagesmod_spidermonkeymod_spidermonkey_teletone2008vcprojfromrev16304freeswitchtrunksrcmodlanguagesmod_spidermonkey_teletonemod_spidermonkey_teletone2008vcproj"></a>
<div class="copfile"><h4>Copied: freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_teletone.2008.vcproj (from rev 16304, freeswitch/trunk/src/mod/languages/mod_spidermonkey_teletone/mod_spidermonkey_teletone.2008.vcproj) (0 => 16333)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_teletone.2008.vcproj                                (rev 0)
+++ freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_teletone.2008.vcproj        2010-01-17 05:48:36 UTC (rev 16333)
</span><span class="lines">@@ -0,0 +1,301 @@
</span><ins>+&lt;?xml version=&quot;1.0&quot; encoding=&quot;Windows-1252&quot;?&gt;
+&lt;VisualStudioProject
+        ProjectType=&quot;Visual C++&quot;
+        Version=&quot;9.00&quot;
+        Name=&quot;mod_spidermonkey_teletone&quot;
+        ProjectGUID=&quot;{8F992C49-6C51-412F-B2A3-34EAB708EB65}&quot;
+        RootNamespace=&quot;mod_spidermonkey_teletone&quot;
+        Keyword=&quot;Win32Proj&quot;
+        TargetFrameworkVersion=&quot;131072&quot;
+        &gt;
+        &lt;Platforms&gt;
+                &lt;Platform
+                        Name=&quot;Win32&quot;
+                /&gt;
+                &lt;Platform
+                        Name=&quot;x64&quot;
+                /&gt;
+        &lt;/Platforms&gt;
+        &lt;ToolFiles&gt;
+        &lt;/ToolFiles&gt;
+        &lt;Configurations&gt;
+                &lt;Configuration
+                        Name=&quot;Debug|Win32&quot;
+                        ConfigurationType=&quot;2&quot;
+                        InheritedPropertySheets=&quot;..\..\..\..\w32\winlibs.vsprops;..\..\..\..\w32\module_debug.vsprops;..\..\..\..\w32\spidermonkey.vsprops&quot;
+                        CharacterSet=&quot;2&quot;
+                        &gt;
+                        &lt;Tool
+                                Name=&quot;VCPreBuildEventTool&quot;
+                                CommandLine=&quot;&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCustomBuildTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXMLDataGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCWebServiceProxyGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCMIDLTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCLCompilerTool&quot;
+                                AdditionalIncludeDirectories=&quot;&amp;quot;$(InputDir)..\..\..\..\libs\libteletone\src&amp;quot;&quot;
+                                UsePrecompiledHeader=&quot;0&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCManagedResourceCompilerTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCResourceCompilerTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCPreLinkEventTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCLinkerTool&quot;
+                                AdditionalLibraryDirectories=&quot;&quot;
+                                RandomizedBaseAddress=&quot;1&quot;
+                                DataExecutionPrevention=&quot;0&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCALinkTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCManifestTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXDCMakeTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCBscMakeTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCFxCopTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCAppVerifierTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCPostBuildEventTool&quot;
+                        /&gt;
+                &lt;/Configuration&gt;
+                &lt;Configuration
+                        Name=&quot;Debug|x64&quot;
+                        ConfigurationType=&quot;2&quot;
+                        InheritedPropertySheets=&quot;..\..\..\..\w32\winlibs.vsprops;..\..\..\..\w32\module_debug.vsprops;..\..\..\..\w32\spidermonkey.vsprops&quot;
+                        CharacterSet=&quot;2&quot;
+                        &gt;
+                        &lt;Tool
+                                Name=&quot;VCPreBuildEventTool&quot;
+                                CommandLine=&quot;&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCustomBuildTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXMLDataGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCWebServiceProxyGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCMIDLTool&quot;
+                                TargetEnvironment=&quot;3&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCLCompilerTool&quot;
+                                AdditionalIncludeDirectories=&quot;&amp;quot;$(InputDir)..\..\..\..\libs\libteletone\src&amp;quot;&quot;
+                                UsePrecompiledHeader=&quot;0&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCManagedResourceCompilerTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCResourceCompilerTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCPreLinkEventTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCLinkerTool&quot;
+                                OutputFile=&quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)/mod/$(ProjectName).dll&quot;
+                                AdditionalLibraryDirectories=&quot;&quot;
+                                RandomizedBaseAddress=&quot;1&quot;
+                                DataExecutionPrevention=&quot;0&quot;
+                                TargetMachine=&quot;17&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCALinkTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCManifestTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXDCMakeTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCBscMakeTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCFxCopTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCAppVerifierTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCPostBuildEventTool&quot;
+                        /&gt;
+                &lt;/Configuration&gt;
+                &lt;Configuration
+                        Name=&quot;Release|Win32&quot;
+                        ConfigurationType=&quot;2&quot;
+                        InheritedPropertySheets=&quot;..\..\..\..\w32\winlibs.vsprops;..\..\..\..\w32\module_release.vsprops;..\..\..\..\w32\spidermonkey.vsprops&quot;
+                        CharacterSet=&quot;2&quot;
+                        &gt;
+                        &lt;Tool
+                                Name=&quot;VCPreBuildEventTool&quot;
+                                CommandLine=&quot;&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCustomBuildTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXMLDataGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCWebServiceProxyGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCMIDLTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCLCompilerTool&quot;
+                                AdditionalIncludeDirectories=&quot;&amp;quot;$(InputDir)..\..\..\..\libs\libteletone\src&amp;quot;&quot;
+                                UsePrecompiledHeader=&quot;0&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCManagedResourceCompilerTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCResourceCompilerTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCPreLinkEventTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCLinkerTool&quot;
+                                AdditionalLibraryDirectories=&quot;&quot;
+                                OptimizeReferences=&quot;2&quot;
+                                EnableCOMDATFolding=&quot;2&quot;
+                                LinkTimeCodeGeneration=&quot;1&quot;
+                                RandomizedBaseAddress=&quot;1&quot;
+                                DataExecutionPrevention=&quot;0&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCALinkTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCManifestTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXDCMakeTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCBscMakeTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCFxCopTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCAppVerifierTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCPostBuildEventTool&quot;
+                        /&gt;
+                &lt;/Configuration&gt;
+                &lt;Configuration
+                        Name=&quot;Release|x64&quot;
+                        ConfigurationType=&quot;2&quot;
+                        InheritedPropertySheets=&quot;..\..\..\..\w32\winlibs.vsprops;..\..\..\..\w32\module_release.vsprops;..\..\..\..\w32\spidermonkey.vsprops&quot;
+                        CharacterSet=&quot;2&quot;
+                        &gt;
+                        &lt;Tool
+                                Name=&quot;VCPreBuildEventTool&quot;
+                                CommandLine=&quot;&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCustomBuildTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXMLDataGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCWebServiceProxyGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCMIDLTool&quot;
+                                TargetEnvironment=&quot;3&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCLCompilerTool&quot;
+                                AdditionalIncludeDirectories=&quot;&amp;quot;$(InputDir)..\..\..\..\libs\libteletone\src&amp;quot;&quot;
+                                UsePrecompiledHeader=&quot;0&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCManagedResourceCompilerTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCResourceCompilerTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCPreLinkEventTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCLinkerTool&quot;
+                                OutputFile=&quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)/mod/$(ProjectName).dll&quot;
+                                AdditionalLibraryDirectories=&quot;&quot;
+                                OptimizeReferences=&quot;2&quot;
+                                EnableCOMDATFolding=&quot;2&quot;
+                                LinkTimeCodeGeneration=&quot;1&quot;
+                                RandomizedBaseAddress=&quot;1&quot;
+                                DataExecutionPrevention=&quot;0&quot;
+                                TargetMachine=&quot;17&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCALinkTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCManifestTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXDCMakeTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCBscMakeTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCFxCopTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCAppVerifierTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCPostBuildEventTool&quot;
+                        /&gt;
+                &lt;/Configuration&gt;
+        &lt;/Configurations&gt;
+        &lt;References&gt;
+        &lt;/References&gt;
+        &lt;Files&gt;
+                &lt;File
+                        RelativePath=&quot;.\mod_spidermonkey_teletone.c&quot;
+                        &gt;
+                &lt;/File&gt;
+        &lt;/Files&gt;
+        &lt;Globals&gt;
+        &lt;/Globals&gt;
+&lt;/VisualStudioProject&gt;
</ins></span></pre></div>
<a id="freeswitchtrunksrcmodlanguagesmod_spidermonkeymod_spidermonkey_teletonecfromrev16304freeswitchtrunksrcmodlanguagesmod_spidermonkey_teletonemod_spidermonkey_teletonec"></a>
<div class="copfile"><h4>Copied: freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_teletone.c (from rev 16304, freeswitch/trunk/src/mod/languages/mod_spidermonkey_teletone/mod_spidermonkey_teletone.c) (0 => 16333)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_teletone.c                                (rev 0)
+++ freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_teletone.c        2010-01-17 05:48:36 UTC (rev 16333)
</span><span class="lines">@@ -0,0 +1,365 @@
</span><ins>+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2005-2009, Anthony Minessale II &lt;anthm@freeswitch.org&gt;
+ *
+ * Version: MPL 1.1
+ *
+ * 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 FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * Anthony Minessale II &lt;anthm@freeswitch.org&gt;
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * Anthony Minessale II &lt;anthm@freeswitch.org&gt;
+ *
+ *
+ * mod_spidermonkey_teletone.c -- TeleTone Javascript Module
+ *
+ */
+#include &quot;mod_spidermonkey.h&quot;
+#include &lt;libteletone.h&gt;
+
+static const char modname[] = &quot;TeleTone&quot;;
+
+typedef enum {
+        TTF_DTMF = (1 &lt;&lt; 0)
+} teletone_flag_t;
+
+
+struct teletone_obj {
+        teletone_generation_session_t ts;
+        JSContext *cx;
+        JSObject *obj;
+        switch_core_session_t *session;
+        switch_codec_t codec;
+        switch_buffer_t *audio_buffer;
+        switch_memory_pool_t *pool;
+        switch_timer_t *timer;
+        switch_timer_t timer_base;
+        JSFunction *function;
+        jsval arg;
+        jsval ret;
+        unsigned int flags;
+};
+
+
+static int teletone_handler(teletone_generation_session_t *ts, teletone_tone_map_t *map)
+{
+        struct teletone_obj *tto = ts-&gt;user_data;
+        int wrote;
+
+        if (!tto) {
+                return -1;
+        }
+        wrote = teletone_mux_tones(ts, map);
+        switch_buffer_write(tto-&gt;audio_buffer, ts-&gt;buffer, wrote * 2);
+
+        return 0;
+}
+
+
+/* TeleTone Object */
+/*********************************************************************************/
+static JSBool teletone_construct(JSContext * cx, JSObject * obj, uintN argc, jsval * argv, jsval * rval)
+{
+        JSObject *session_obj;
+        struct teletone_obj *tto = NULL;
+        struct js_session *jss = NULL;
+        switch_memory_pool_t *pool;
+        char *timer_name = NULL;
+    switch_codec_implementation_t read_impl = {0};
+
+
+
+        if (argc &gt; 0) {
+                if (JS_ValueToObject(cx, argv[0], &amp;session_obj)) {
+                        if (!(jss = JS_GetPrivate(cx, session_obj))) {
+                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, &quot;Cannot Find Session [1]\n&quot;);
+                                return JS_FALSE;
+                        }
+                } else {
+                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, &quot;Cannot Find Session [2]\n&quot;);
+                        return JS_FALSE;
+                }
+        } else {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, &quot;Missing Session Arg\n&quot;);
+                return JS_FALSE;
+        }
+        if (argc &gt; 1) {
+                timer_name = JS_GetStringBytes(JS_ValueToString(cx, argv[1]));
+        }
+
+        switch_core_new_memory_pool(&amp;pool);
+
+        if (!(tto = switch_core_alloc(pool, sizeof(*tto)))) {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, &quot;Memory Error\n&quot;);
+                return JS_FALSE;
+        }
+
+    switch_core_session_get_read_impl(jss-&gt;session, &amp;read_impl);
+
+        if (switch_core_codec_init(&amp;tto-&gt;codec,
+                                                           &quot;L16&quot;,
+                                                           NULL,
+                                                           read_impl.actual_samples_per_second,
+                                                           read_impl.microseconds_per_packet / 1000,
+                                                           read_impl.number_of_channels,
+                                                           SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL, pool) == SWITCH_STATUS_SUCCESS) {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, &quot;Raw Codec Activated\n&quot;);
+        } else {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, &quot;Raw Codec Activation Failed\n&quot;);
+                return JS_FALSE;
+        }
+
+        if (timer_name) {
+                unsigned int ms = read_impl.microseconds_per_packet / 1000;
+                if (switch_core_timer_init(&amp;tto-&gt;timer_base,
+                                                                   timer_name,
+                                                                   ms,
+                                                                   (read_impl.samples_per_second / 50) *
+                                                                   read_impl.number_of_channels, pool) == SWITCH_STATUS_SUCCESS) {
+                        tto-&gt;timer = &amp;tto-&gt;timer_base;
+                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, &quot;Timer INIT Success %u\n&quot;, ms);
+                } else {
+                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, &quot;Timer INIT Failed\n&quot;);
+                }
+        }
+
+        switch_buffer_create_dynamic(&amp;tto-&gt;audio_buffer, JS_BLOCK_SIZE, JS_BUFFER_SIZE, 0);
+        tto-&gt;pool = pool;
+        tto-&gt;obj = obj;
+        tto-&gt;cx = cx;
+        tto-&gt;session = jss-&gt;session;
+        teletone_init_session(&amp;tto-&gt;ts, 0, teletone_handler, tto);
+        JS_SetPrivate(cx, obj, tto);
+
+        return JS_TRUE;
+}
+
+static void teletone_destroy(JSContext * cx, JSObject * obj)
+{
+        struct teletone_obj *tto = JS_GetPrivate(cx, obj);
+        switch_memory_pool_t *pool;
+        if (tto) {
+                if (tto-&gt;timer) {
+                        switch_core_timer_destroy(tto-&gt;timer);
+                }
+                teletone_destroy_session(&amp;tto-&gt;ts);
+                switch_buffer_destroy(&amp;tto-&gt;audio_buffer);
+                switch_core_codec_destroy(&amp;tto-&gt;codec);
+                pool = tto-&gt;pool;
+                tto-&gt;pool = NULL;
+                if (pool) {
+                        switch_core_destroy_memory_pool(&amp;pool);
+                }
+        }
+}
+
+static JSBool teletone_add_tone(JSContext * cx, JSObject * obj, uintN argc, jsval * argv, jsval * rval)
+{
+        struct teletone_obj *tto = JS_GetPrivate(cx, obj);
+        if (argc &gt; 2) {
+                int x;
+                char *fval;
+                char *map_str;
+                map_str = JS_GetStringBytes(JS_ValueToString(cx, argv[0]));
+
+                for (x = 1; x &lt; TELETONE_MAX_TONES; x++) {
+                        fval = JS_GetStringBytes(JS_ValueToString(cx, argv[x]));
+                        tto-&gt;ts.TONES[(int) *map_str].freqs[x - 1] = strtod(fval, NULL);
+                }
+                return JS_TRUE;
+        }
+
+        return JS_FALSE;
+}
+
+static JSBool teletone_on_dtmf(JSContext * cx, JSObject * obj, uintN argc, jsval * argv, jsval * rval)
+{
+        struct teletone_obj *tto = JS_GetPrivate(cx, obj);
+        if (argc &gt; 0) {
+                tto-&gt;function = JS_ValueToFunction(cx, argv[0]);
+                if (argc &gt; 1) {
+                        tto-&gt;arg = argv[1];
+                }
+                switch_set_flag(tto, TTF_DTMF);
+        }
+        return JS_TRUE;
+}
+
+static JSBool teletone_generate(JSContext * cx, JSObject * obj, uintN argc, jsval * argv, jsval * rval)
+{
+        struct teletone_obj *tto = JS_GetPrivate(cx, obj);
+        int32 loops = 0;
+
+        if (argc &gt; 0) {
+                char *script;
+                switch_core_session_t *session;
+                switch_frame_t write_frame = { 0 };
+                unsigned char *fdata[1024];
+                switch_frame_t *read_frame;
+                switch_channel_t *channel;
+
+                if (argc &gt; 1) {
+                        if (!JS_ValueToInt32(cx, argv[1], &amp;loops)) {
+                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, &quot;Cannot Convert to INT\n&quot;);
+                                return JS_FALSE;
+                        }
+                        loops--;
+                }
+
+                if (tto-&gt;audio_buffer) {
+                        switch_buffer_zero(tto-&gt;audio_buffer);
+                }
+
+                tto-&gt;ts.debug = 1;
+                tto-&gt;ts.debug_stream = switch_core_get_console();
+
+                script = JS_GetStringBytes(JS_ValueToString(cx, argv[0]));
+                teletone_run(&amp;tto-&gt;ts, script);
+
+                session = tto-&gt;session;
+                write_frame.codec = &amp;tto-&gt;codec;
+                write_frame.data = fdata;
+                write_frame.buflen = sizeof(fdata);
+
+                channel = switch_core_session_get_channel(session);
+
+                if (tto-&gt;timer) {
+                        switch_core_service_session(session);
+                }
+
+                if (loops) {
+                        switch_buffer_set_loops(tto-&gt;audio_buffer, loops);
+                }
+
+                for (;;) {
+
+                        if (switch_test_flag(tto, TTF_DTMF)) {
+                                char dtmf[128];
+                                char *ret;
+
+                                if (switch_channel_has_dtmf(channel)) {
+                                        uintN aargc = 0;
+                                        jsval aargv[4];
+
+                                        switch_channel_dequeue_dtmf_string(channel, dtmf, sizeof(dtmf));
+                                        aargv[aargc++] = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, dtmf));
+                                        JS_CallFunction(cx, obj, tto-&gt;function, aargc, aargv, &amp;tto-&gt;ret);
+                                        ret = JS_GetStringBytes(JS_ValueToString(cx, tto-&gt;ret));
+                                        if (strcmp(ret, &quot;true&quot;) &amp;&amp; strcmp(ret, &quot;undefined&quot;)) {
+                                                *rval = tto-&gt;ret;
+                                                return JS_TRUE;
+                                        }
+                                }
+                        }
+
+                        if (tto-&gt;timer) {
+                                if (switch_core_timer_next(tto-&gt;timer) != SWITCH_STATUS_SUCCESS) {
+                                        break;
+                                }
+
+                        } else {
+                                switch_status_t status;
+                                status = switch_core_session_read_frame(session, &amp;read_frame, SWITCH_IO_FLAG_NONE, 0);
+
+                                if (!SWITCH_READ_ACCEPTABLE(status)) {
+                                        break;
+                                }
+                        }
+                        if ((write_frame.datalen = (uint32_t) switch_buffer_read_loop(tto-&gt;audio_buffer,
+                                                                                                                                                  fdata, write_frame.codec-&gt;implementation-&gt;decoded_bytes_per_packet)) &lt;= 0) {
+                                break;
+                        }
+
+                        write_frame.samples = write_frame.datalen / 2;
+                        if (switch_core_session_write_frame(session, &amp;write_frame, SWITCH_IO_FLAG_NONE, 0) != SWITCH_STATUS_SUCCESS) {
+                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, &quot;Bad Write\n&quot;);
+                                break;
+                        }
+                }
+
+                if (tto-&gt;timer) {
+                        switch_core_thread_session_end(session);
+                }
+                return JS_TRUE;
+        }
+
+        return JS_FALSE;
+}
+
+enum teletone_tinyid {
+        TELETONE_NAME
+};
+
+static JSFunctionSpec teletone_methods[] = {
+        {&quot;generate&quot;, teletone_generate, 1},
+        {&quot;onDTMF&quot;, teletone_on_dtmf, 1},
+        {&quot;addTone&quot;, teletone_add_tone, 10},
+        {0}
+};
+
+
+static JSPropertySpec teletone_props[] = {
+        {&quot;name&quot;, TELETONE_NAME, JSPROP_READONLY | JSPROP_PERMANENT},
+        {0}
+};
+
+
+static JSBool teletone_getProperty(JSContext * cx, JSObject * obj, jsval id, jsval * vp)
+{
+        JSBool res = JS_TRUE;
+
+        return res;
+}
+
+JSClass teletone_class = {
+        modname, JSCLASS_HAS_PRIVATE,
+        JS_PropertyStub, JS_PropertyStub, teletone_getProperty, DEFAULT_SET_PROPERTY,
+        JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, teletone_destroy, NULL, NULL, NULL,
+        teletone_construct
+};
+
+
+switch_status_t teletone_load(JSContext * cx, JSObject * obj)
+{
+        JS_InitClass(cx, obj, NULL, &amp;teletone_class, teletone_construct, 3, teletone_props, teletone_methods, teletone_props, teletone_methods);
+        return SWITCH_STATUS_SUCCESS;
+}
+
+
+const sm_module_interface_t teletone_module_interface = {
+        /*.name = */ modname,
+        /*.spidermonkey_load */ teletone_load,
+        /*.next */ NULL
+};
+
+SWITCH_MOD_DECLARE_NONSTD(switch_status_t) spidermonkey_init(const sm_module_interface_t **module_interface)
+{
+        *module_interface = &amp;teletone_module_interface;
+        return SWITCH_STATUS_SUCCESS;
+}
+
+/* For Emacs:
+ * Local Variables:
+ * mode:c
+ * indent-tabs-mode:t
+ * tab-width:4
+ * c-basic-offset:4
+ * End:
+ * For VIM:
+ * vim:set softtabstop=4 shiftwidth=4 tabstop=4:
+ */
</ins></span></pre></div>
<a id="freeswitchtrunksrcmodlanguagesmod_spidermonkeymod_spidermonkey_teletonevcprojfromrev16304freeswitchtrunksrcmodlanguagesmod_spidermonkey_teletonemod_spidermonkey_teletonevcproj"></a>
<div class="copfile"><h4>Copied: freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_teletone.vcproj (from rev 16304, freeswitch/trunk/src/mod/languages/mod_spidermonkey_teletone/mod_spidermonkey_teletone.vcproj) (0 => 16333)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_teletone.vcproj                                (rev 0)
+++ freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey_teletone.vcproj        2010-01-17 05:48:36 UTC (rev 16333)
</span><span class="lines">@@ -0,0 +1,96 @@
</span><ins>+&lt;?xml version=&quot;1.0&quot; encoding=&quot;Windows-1252&quot;?&gt;
+&lt;VisualStudioProject
+        ProjectType=&quot;Visual C++&quot;
+        Version=&quot;8.00&quot;
+        Name=&quot;mod_spidermonkey_teletone&quot;
+        ProjectGUID=&quot;{8F992C49-6C51-412F-B2A3-34EAB708EB65}&quot;
+        RootNamespace=&quot;mod_spidermonkey_teletone&quot;
+        Keyword=&quot;Win32Proj&quot;
+        &gt;
+        &lt;Platforms&gt;
+                &lt;Platform
+                        Name=&quot;Win32&quot;
+                /&gt;
+        &lt;/Platforms&gt;
+        &lt;ToolFiles&gt;
+        &lt;/ToolFiles&gt;
+        &lt;Configurations&gt;
+                &lt;Configuration
+                        Name=&quot;Debug|Win32&quot;
+                        ConfigurationType=&quot;2&quot;
+                        InheritedPropertySheets=&quot;..\..\..\..\w32\winlibs.vsprops;..\..\..\..\w32\module_debug.vsprops;..\..\..\..\w32\spidermonkey.vsprops&quot;
+                        CharacterSet=&quot;2&quot;
+                        &gt;
+                        &lt;Tool
+                                Name=&quot;VCPreBuildEventTool&quot;
+                                CommandLine=&quot;&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCustomBuildTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXMLDataGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCWebServiceProxyGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCMIDLTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCLCompilerTool&quot;
+                                AdditionalIncludeDirectories=&quot;&amp;quot;$(InputDir)..\..\..\..\libs\libteletone\src&amp;quot;&quot;
+                                UsePrecompiledHeader=&quot;0&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCLinkerTool&quot;
+                                AdditionalLibraryDirectories=&quot;&quot;
+                        /&gt;
+                &lt;/Configuration&gt;
+                &lt;Configuration
+                        Name=&quot;Release|Win32&quot;
+                        ConfigurationType=&quot;2&quot;
+                        InheritedPropertySheets=&quot;..\..\..\..\w32\winlibs.vsprops;..\..\..\..\w32\module_release.vsprops;..\..\..\..\w32\spidermonkey.vsprops&quot;
+                        CharacterSet=&quot;2&quot;
+                        &gt;
+                        &lt;Tool
+                                Name=&quot;VCPreBuildEventTool&quot;
+                                CommandLine=&quot;&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCustomBuildTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCXMLDataGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCWebServiceProxyGeneratorTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCMIDLTool&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCCLCompilerTool&quot;
+                                AdditionalIncludeDirectories=&quot;&amp;quot;$(InputDir)..\..\..\..\libs\libteletone\src&amp;quot;&quot;
+                                UsePrecompiledHeader=&quot;0&quot;
+                        /&gt;
+                        &lt;Tool
+                                Name=&quot;VCLinkerTool&quot;
+                                AdditionalLibraryDirectories=&quot;&quot;
+                                OptimizeReferences=&quot;2&quot;
+                                EnableCOMDATFolding=&quot;2&quot;
+                                LinkTimeCodeGeneration=&quot;1&quot;
+                        /&gt;
+                &lt;/Configuration&gt;
+        &lt;/Configurations&gt;
+        &lt;References&gt;
+        &lt;/References&gt;
+        &lt;Files&gt;
+                &lt;File
+                        RelativePath=&quot;.\mod_spidermonkey_teletone.c&quot;
+                        &gt;
+                &lt;/File&gt;
+        &lt;/Files&gt;
+        &lt;Globals&gt;
+        &lt;/Globals&gt;
+&lt;/VisualStudioProject&gt;
</ins></span></pre></div>
<a id="freeswitchtrunksrcmodlanguagesmod_spidermonkeysmmak"></a>
<div class="delfile"><h4>Deleted: freeswitch/trunk/src/mod/languages/mod_spidermonkey/sm.mak</h4></div>
</div>
<div id="footer">See you at ClueCon</div>

</body>
</html>