<!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][15072] </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=15072">15072</a></dd>
<dt>Author</dt> <dd>anthm</dd>
<dt>Date</dt> <dd>2009-10-03 18:59:01 -0500 (Sat, 03 Oct 2009)</dd>
</dl>

<h3>Log Message</h3>
<pre>let there be valet parking....</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#freeswitchtrunkbuildmodulesconfin">freeswitch/trunk/build/modules.conf.in</a></li>
<li><a href="#freeswitchtrunkconfautoload_configsmodulesconfxml">freeswitch/trunk/conf/autoload_configs/modules.conf.xml</a></li>
<li><a href="#freeswitchtrunksrcmodapplicationsmod_dptoolsmod_dptoolsc">freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li>freeswitch/trunk/src/mod/applications/mod_valet_parking/</li>
<li><a href="#freeswitchtrunksrcmodapplicationsmod_valet_parkingmod_valet_parking2008vcproj">freeswitch/trunk/src/mod/applications/mod_valet_parking/mod_valet_parking.2008.vcproj</a></li>
<li><a href="#freeswitchtrunksrcmodapplicationsmod_valet_parkingmod_valet_parkingc">freeswitch/trunk/src/mod/applications/mod_valet_parking/mod_valet_parking.c</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="freeswitchtrunkbuildmodulesconfin"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/build/modules.conf.in (15071 => 15072)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/build/modules.conf.in        2009-10-03 23:10:03 UTC (rev 15071)
+++ freeswitch/trunk/build/modules.conf.in        2009-10-03 23:59:01 UTC (rev 15072)
</span><span class="lines">@@ -25,6 +25,7 @@
</span><span class="cx"> #applications/mod_memcache
</span><span class="cx"> #applications/mod_spy
</span><span class="cx"> applications/mod_cluechoo
</span><ins>+applications/mod_valet_parking
</ins><span class="cx"> codecs/mod_g723_1
</span><span class="cx"> codecs/mod_amr
</span><span class="cx"> #codecs/mod_amrwb
</span></span></pre></div>
<a id="freeswitchtrunkconfautoload_configsmodulesconfxml"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/conf/autoload_configs/modules.conf.xml (15071 => 15072)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/conf/autoload_configs/modules.conf.xml        2009-10-03 23:10:03 UTC (rev 15071)
+++ freeswitch/trunk/conf/autoload_configs/modules.conf.xml        2009-10-03 23:59:01 UTC (rev 15072)
</span><span class="lines">@@ -51,6 +51,7 @@
</span><span class="cx">     &lt;load module=&quot;mod_esf&quot;/&gt;
</span><span class="cx">     &lt;load module=&quot;mod_fsv&quot;/&gt;
</span><span class="cx">     &lt;load module=&quot;mod_cluechoo&quot;/&gt;
</span><ins>+    &lt;load module=&quot;mod_valet_parking&quot;/&gt;
</ins><span class="cx">     &lt;!--&lt;load module=&quot;mod_spy&quot;/&gt;--&gt;
</span><span class="cx"> 
</span><span class="cx">     &lt;!-- SNOM Module --&gt;
</span></span></pre></div>
<a id="freeswitchtrunksrcmodapplicationsmod_dptoolsmod_dptoolsc"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c (15071 => 15072)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c        2009-10-03 23:10:03 UTC (rev 15071)
+++ freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c        2009-10-03 23:59:01 UTC (rev 15072)
</span><span class="lines">@@ -87,12 +87,10 @@
</span><span class="cx"> #define DETECT_SPEECH_SYNTAX &quot;&lt;mod_name&gt; &lt;gram_name&gt; &lt;gram_path&gt; [&lt;addr&gt;] OR grammar &lt;gram_name&gt; [&lt;path&gt;] OR pause OR resume&quot;
</span><span class="cx"> SWITCH_STANDARD_APP(detect_speech_function)
</span><span class="cx"> {
</span><del>-        char *argv[4];
-        int argc;
</del><ins>+
</ins><span class="cx">         char *lbuf = NULL;
</span><span class="cx"> 
</span><del>-        if (!switch_strlen_zero(data) &amp;&amp; (lbuf = switch_core_session_strdup(session, data))
-                &amp;&amp; (argc = switch_separate_string(lbuf, ' ', argv, (sizeof(argv) / sizeof(argv[0]))))) {
</del><ins>+
</ins><span class="cx">                 if (!strcasecmp(argv[0], &quot;grammar&quot;) &amp;&amp; argc &gt;= 1) {
</span><span class="cx">                         switch_ivr_detect_speech_load_grammar(session, argv[1], argv[2]);
</span><span class="cx">                 } else if (!strcasecmp(argv[0], &quot;nogrammar&quot;)) {
</span></span></pre></div>
<a id="freeswitchtrunksrcmodapplicationsmod_valet_parkingmod_valet_parking2008vcproj"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/src/mod/applications/mod_valet_parking/mod_valet_parking.2008.vcproj (0 => 15072)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/applications/mod_valet_parking/mod_valet_parking.2008.vcproj                                (rev 0)
+++ freeswitch/trunk/src/mod/applications/mod_valet_parking/mod_valet_parking.2008.vcproj        2009-10-03 23:59:01 UTC (rev 15072)
</span><span class="lines">@@ -0,0 +1,287 @@
</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_valet_parking&quot;
+        ProjectGUID=&quot;{11C9BC3D-45E9-46E3-BE84-B8CEE4685E39}&quot;
+        RootNamespace=&quot;mod_valet_parking&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\module_debug.vsprops&quot;
+                        CharacterSet=&quot;2&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;
+                                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;Debug|x64&quot;
+                        OutputDirectory=&quot;$(PlatformName)\$(ConfigurationName)&quot;
+                        IntermediateDirectory=&quot;$(PlatformName)\$(ConfigurationName)&quot;
+                        ConfigurationType=&quot;2&quot;
+                        InheritedPropertySheets=&quot;..\..\..\..\w32\module_debug.vsprops&quot;
+                        CharacterSet=&quot;2&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;
+                                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;Configuration
+                        Name=&quot;Release|Win32&quot;
+                        ConfigurationType=&quot;2&quot;
+                        InheritedPropertySheets=&quot;..\..\..\..\w32\module_release.vsprops&quot;
+                        CharacterSet=&quot;2&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;
+                                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;
+                        OutputDirectory=&quot;$(PlatformName)\$(ConfigurationName)&quot;
+                        IntermediateDirectory=&quot;$(PlatformName)\$(ConfigurationName)&quot;
+                        ConfigurationType=&quot;2&quot;
+                        InheritedPropertySheets=&quot;..\..\..\..\w32\module_release.vsprops&quot;
+                        CharacterSet=&quot;2&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;
+                                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_valet_parking.c&quot;
+                        &gt;
+                &lt;/File&gt;
+        &lt;/Files&gt;
+        &lt;Globals&gt;
+        &lt;/Globals&gt;
+&lt;/VisualStudioProject&gt;
</ins></span></pre></div>
<a id="freeswitchtrunksrcmodapplicationsmod_valet_parkingmod_valet_parkingc"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/src/mod/applications/mod_valet_parking/mod_valet_parking.c (0 => 15072)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/applications/mod_valet_parking/mod_valet_parking.c                                (rev 0)
+++ freeswitch/trunk/src/mod/applications/mod_valet_parking/mod_valet_parking.c        2009-10-03 23:59:01 UTC (rev 15072)
</span><span class="lines">@@ -0,0 +1,206 @@
</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_valet_parking.c -- Valet Parking Module
+ *
+ */
+#include &lt;switch.h&gt;
+
+/* Prototypes */
+SWITCH_MODULE_LOAD_FUNCTION(mod_valet_parking_load);
+
+/* SWITCH_MODULE_DEFINITION(name, load, shutdown, runtime) 
+ * Defines a switch_loadable_module_function_table_t and a static const char[] modname
+ */
+SWITCH_MODULE_DEFINITION(mod_valet_parking, mod_valet_parking_load, NULL, NULL);
+
+typedef struct {
+        switch_hash_t *hash;
+        switch_mutex_t *mutex;
+        switch_memory_pool_t *pool;
+} valet_lot_t;
+
+static valet_lot_t globals = { 0 };
+
+
+static valet_lot_t *valet_find_lot(const char *name)
+{
+        valet_lot_t *lot;
+
+        if (!(lot = switch_core_hash_find(globals.hash, name))) {
+                switch_zmalloc(lot, sizeof(*lot));
+                switch_mutex_init(&amp;lot-&gt;mutex, SWITCH_MUTEX_NESTED, globals.pool);
+                switch_core_hash_init(&amp;lot-&gt;hash, NULL);
+                switch_core_hash_insert(globals.hash, name, lot);
+        }
+        return lot;
+}
+
+static switch_status_t valet_on_dtmf(switch_core_session_t *session, void *input, switch_input_type_t itype, void *buf, unsigned int buflen)
+{
+        switch (itype) {
+        case SWITCH_INPUT_TYPE_DTMF:
+                {
+                        switch_dtmf_t *dtmf = (switch_dtmf_t *) input;
+
+                        if (dtmf-&gt;digit == '#') {
+                                return SWITCH_STATUS_BREAK;
+                        }
+                }
+        default:
+                break;
+        }
+
+        return SWITCH_STATUS_SUCCESS;
+}
+
+
+#define VALET_APP_SYNTAX &quot;&lt;lotname&gt; &lt;extension&gt;|[ask [&lt;min&gt;] [&lt;max&gt;] [&lt;to&gt;] [&lt;prompt&gt;]]&quot;
+SWITCH_STANDARD_APP(valet_parking_function)
+{
+        char *argv[6], *lbuf;
+        int argc;
+        switch_channel_t *channel = switch_core_session_get_channel(session);
+
+        if (!switch_strlen_zero(data) &amp;&amp; (lbuf = switch_core_session_strdup(session, data))
+                &amp;&amp; (argc = switch_separate_string(lbuf, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) &gt;= 2) {
+                char *lot_name = argv[0];
+                char *ext = argv[1];
+                valet_lot_t *lot;
+                char *uuid;
+                const char *music = &quot;silence&quot;;
+                const char *tmp = NULL;
+                switch_status_t status;
+                switch_input_args_t args = { 0 };
+                char dbuf[10];
+
+                lot = valet_find_lot(lot_name);
+                switch_assert(lot);
+                
+                if (!strcasecmp(ext, &quot;ask&quot;)) {
+                        const char *prompt = &quot;ivr/ivr-enter_ext_pound.wav&quot;;
+                        char dtmf_buf[12] = &quot;&quot;;
+                        int min = 1;
+                        int max = 11;
+                        int to = 10000;
+                        int i;
+                        
+                        tmp = argv[2] ? argv[2] : switch_channel_get_variable(channel, &quot;valet_ext_min&quot;);
+                        if (tmp) {
+                                if ((i = atoi(tmp)) &gt; 0) {
+                                        min = i;
+                                }
+                        }
+                        
+                        tmp = argv[3] ? argv[3] : switch_channel_get_variable(channel, &quot;valet_ext_max&quot;);
+                        if (tmp) {
+                                if ((i = atoi(tmp)) &gt; 0) {
+                                        max = i;
+                                }
+                        }
+                        
+                        tmp = argv[4] ? argv[4] : switch_channel_get_variable(channel, &quot;valet_ext_to&quot;);
+                        if (tmp) {
+                                if ((i = atoi(tmp)) &gt; 0) {
+                                        to = i;
+                                }
+                        }
+                        
+                        tmp = argv[5] ? argv[5] : switch_channel_get_variable(channel, &quot;valet_ext_prompt&quot;);
+                        if (tmp) {
+                                prompt = tmp;
+                        }
+
+                        do {
+                                status = switch_ivr_read(session, min, max, prompt, NULL, dtmf_buf, sizeof(dtmf_buf), to, &quot;#&quot;);
+                        } while (status != SWITCH_STATUS_SUCCESS &amp;&amp; status != SWITCH_STATUS_FALSE);
+
+                        if (status == SWITCH_STATUS_SUCCESS) {
+                                ext = dtmf_buf;
+                        } else {
+                                switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
+                        }
+                }
+                
+                switch_mutex_lock(lot-&gt;mutex);
+                if ((uuid = switch_core_hash_find(lot-&gt;hash, ext))) {
+                        switch_ivr_uuid_bridge(switch_core_session_get_uuid(session), uuid);
+                        switch_mutex_unlock(lot-&gt;mutex);
+                        return;
+                }
+                        
+                if (!(tmp = switch_channel_get_variable(channel, &quot;valet_hold_music&quot;))) {
+                        tmp = switch_channel_get_variable(channel, &quot;hold_music&quot;);
+                }
+                if (tmp) music = tmp;
+                
+                switch_core_hash_insert(lot-&gt;hash, ext, switch_core_session_get_uuid(session));
+                
+                args.input_callback = valet_on_dtmf;
+                args.buf = dbuf;
+                args.buflen = sizeof(dbuf);
+
+                switch_mutex_unlock(lot-&gt;mutex);
+                if (!strcasecmp(music, &quot;silence&quot;)) {
+                        switch_ivr_collect_digits_callback(session, &amp;args, 0, 0);
+                } else {
+                        switch_ivr_play_file(session, NULL, music, &amp;args);
+                }
+                switch_mutex_lock(lot-&gt;mutex);
+                switch_core_hash_delete(lot-&gt;hash, ext);
+                switch_mutex_unlock(lot-&gt;mutex);
+        } else {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, &quot;Usage: %s\n&quot;, VALET_APP_SYNTAX);
+        }
+}
+
+/* Macro expands to: switch_status_t mod_valet_parking_load(switch_loadable_module_interface_t **module_interface, switch_memory_pool_t *pool) */
+SWITCH_MODULE_LOAD_FUNCTION(mod_valet_parking_load)
+{
+        switch_application_interface_t *app_interface;
+
+        switch_core_hash_init(&amp;globals.hash, NULL);
+        globals.pool = pool;
+
+        /* connect my internal structure to the blank pointer passed to me */
+        *module_interface = switch_loadable_module_create_module_interface(pool, modname);
+
+        SWITCH_ADD_APP(app_interface, &quot;valet_park&quot;, &quot;valet_park&quot;, &quot;valet_park&quot;, valet_parking_function, VALET_APP_SYNTAX, SAF_NONE);
+
+        return SWITCH_STATUS_NOUNLOAD;
+}
+
+/* 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>
</div>
<div id="footer">See you at ClueCon</div>

</body>
</html>