<!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][14984] </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=14984">14984</a></dd>
<dt>Author</dt> <dd>mochouinard</dd>
<dt>Date</dt> <dd>2009-09-25 14:48:46 -0500 (Fri, 25 Sep 2009)</dd>
</dl>

<h3>Log Message</h3>
<pre>mod_directory: New Search by Name Directory IVR (<a href="http://jira.freeswitch.org/browse/MODAPP-325">MODAPP-325</a>)</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="#freeswitchtrunkconflangenenxml">freeswitch/trunk/conf/lang/en/en.xml</a></li>
<li><a href="#freeswitchtrunkconflangfrfrxml">freeswitch/trunk/conf/lang/fr/fr.xml</a></li>
<li><a href="#freeswitchtrunkdocsphrasephrase_enxml">freeswitch/trunk/docs/phrase/phrase_en.xml</a></li>
<li><a href="#freeswitchtrunkdocsphrasephrase_frxml">freeswitch/trunk/docs/phrase/phrase_fr.xml</a></li>
<li><a href="#freeswitchtrunkfreeswitchspec">freeswitch/trunk/freeswitch.spec</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#freeswitchtrunkconfautoload_configsdirectoryconfxml">freeswitch/trunk/conf/autoload_configs/directory.conf.xml</a></li>
<li>freeswitch/trunk/conf/lang/en/dir/</li>
<li><a href="#freeswitchtrunkconflangendirsoundsxml">freeswitch/trunk/conf/lang/en/dir/sounds.xml</a></li>
<li><a href="#freeswitchtrunkconflangendirttsxml">freeswitch/trunk/conf/lang/en/dir/tts.xml</a></li>
<li>freeswitch/trunk/conf/lang/fr/dir/</li>
<li><a href="#freeswitchtrunkconflangfrdirsoundsxml">freeswitch/trunk/conf/lang/fr/dir/sounds.xml</a></li>
<li><a href="#freeswitchtrunkconflangfrdirttsxml">freeswitch/trunk/conf/lang/fr/dir/tts.xml</a></li>
<li><a href="#freeswitchtrunksrcmodapplicationsmod_directoryMakefile">freeswitch/trunk/src/mod/applications/mod_directory/Makefile</a></li>
<li><a href="#freeswitchtrunksrcmodapplicationsmod_directorymod_directory2008vcproj">freeswitch/trunk/src/mod/applications/mod_directory/mod_directory.2008.vcproj</a></li>
<li><a href="#freeswitchtrunksrcmodapplicationsmod_directorymod_directoryc">freeswitch/trunk/src/mod/applications/mod_directory/mod_directory.c</a></li>
<li><a href="#freeswitchtrunksrcmodapplicationsmod_directorymod_directoryvcproj">freeswitch/trunk/src/mod/applications/mod_directory/mod_directory.vcproj</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 (14983 => 14984)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/build/modules.conf.in        2009-09-25 19:48:28 UTC (rev 14983)
+++ freeswitch/trunk/build/modules.conf.in        2009-09-25 19:48:46 UTC (rev 14984)
</span><span class="lines">@@ -10,6 +10,7 @@
</span><span class="cx"> #applications/mod_fax
</span><span class="cx"> #applications/mod_curl
</span><span class="cx"> applications/mod_voicemail
</span><ins>+#applications/mod_directory
</ins><span class="cx"> #applications/mod_lcr
</span><span class="cx"> applications/mod_limit
</span><span class="cx"> applications/mod_expr
</span></span></pre></div>
<a id="freeswitchtrunkconfautoload_configsdirectoryconfxml"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/conf/autoload_configs/directory.conf.xml (0 => 14984)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/conf/autoload_configs/directory.conf.xml                                (rev 0)
+++ freeswitch/trunk/conf/autoload_configs/directory.conf.xml        2009-09-25 19:48:46 UTC (rev 14984)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+&lt;configuration name=&quot;directory.conf&quot; description=&quot;Directory&quot;&gt;
+  &lt;settings&gt;
+  &lt;/settings&gt;
+  &lt;profiles&gt;
+    &lt;profile name=&quot;default&quot;&gt;
+      &lt;param name=&quot;max-menu-attempts&quot; value=&quot;3&quot;/&gt;
+      &lt;param name=&quot;min-search-digits&quot; value=&quot;3&quot;/&gt;
+      &lt;param name=&quot;terminator-key&quot; value=&quot;#&quot;/&gt;
+      &lt;param name=&quot;digit-timeout&quot; value=&quot;3000&quot;/&gt;
+      &lt;param name=&quot;max-result&quot; value=&quot;5&quot;/&gt;
+      &lt;param name=&quot;next-key&quot; value=&quot;6&quot;/&gt;
+      &lt;param name=&quot;prev-key&quot; value=&quot;4&quot;/&gt;
+      &lt;param name=&quot;switch-order-key&quot; value=&quot;*&quot;/&gt;
+      &lt;param name=&quot;select-name-key&quot; value=&quot;1&quot;/&gt;
+      &lt;param name=&quot;new-search-key&quot; value=&quot;3&quot;/&gt;
+      &lt;param name=&quot;search-order&quot; value=&quot;last_name&quot;/&gt;
+    &lt;/profile&gt;
+  &lt;/profiles&gt;
+&lt;/configuration&gt; 
</ins></span></pre></div>
<a id="freeswitchtrunkconfautoload_configsmodulesconfxml"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/conf/autoload_configs/modules.conf.xml (14983 => 14984)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/conf/autoload_configs/modules.conf.xml        2009-09-25 19:48:28 UTC (rev 14983)
+++ freeswitch/trunk/conf/autoload_configs/modules.conf.xml        2009-09-25 19:48:46 UTC (rev 14984)
</span><span class="lines">@@ -44,6 +44,7 @@
</span><span class="cx">     &lt;load module=&quot;mod_expr&quot;/&gt;
</span><span class="cx">     &lt;load module=&quot;mod_fifo&quot;/&gt;
</span><span class="cx">     &lt;load module=&quot;mod_voicemail&quot;/&gt;
</span><ins>+    &lt;load module=&quot;mod_directory&quot;/&gt;
</ins><span class="cx">     &lt;!--&lt;load module=&quot;mod_fax&quot;/&gt;--&gt;
</span><span class="cx">     &lt;!--&lt;load module=&quot;mod_lcr&quot;/&gt;--&gt;
</span><span class="cx">     &lt;load module=&quot;mod_limit&quot;/&gt;
</span></span></pre></div>
<a id="freeswitchtrunkconflangendirsoundsxml"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/conf/lang/en/dir/sounds.xml (0 => 14984)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/conf/lang/en/dir/sounds.xml                                (rev 0)
+++ freeswitch/trunk/conf/lang/en/dir/sounds.xml        2009-09-25 19:48:46 UTC (rev 14984)
</span><span class="lines">@@ -0,0 +1,121 @@
</span><ins>+&lt;include&gt;&lt;!--This line will be ignored it's here to validate the xml and is optional --&gt;
+        &lt;macro name=&quot;directory_intro&quot;&gt;
+                &lt;input pattern=&quot;^(last_name)&quot; break_on_match=&quot;false&quot;&gt;
+                        &lt;match&gt;
+                                &lt;action function=&quot;play-file&quot; data=&quot;directory/dir-enter-person.wav&quot;/&gt;
+                                &lt;action function=&quot;play-file&quot; data=&quot;directory/dir-last_name.wav&quot;/&gt;
+                        &lt;/match&gt;
+                &lt;/input&gt;
+                &lt;input pattern=&quot;^(first_name)&quot; break_on_match=&quot;false&quot;&gt;
+                        &lt;match&gt;
+                &lt;action function=&quot;play-file&quot; data=&quot;directory/dir-enter-person.wav&quot;/&gt;
+                &lt;action function=&quot;play-file&quot; data=&quot;directory/dir-first_name.wav&quot;/&gt;
+                        &lt;/match&gt;
+                &lt;/input&gt;
+                &lt;input pattern=&quot;^(last_name):([0-9#*])$&quot; break_on_match=&quot;false&quot;&gt;
+                        &lt;match&gt;
+                                &lt;action function=&quot;play-file&quot; data=&quot;directory/dir-to_search_by.wav&quot;/&gt;
+                                &lt;action function=&quot;play-file&quot; data=&quot;directory/dir-first_name.wav&quot;/&gt;
+                                &lt;action function=&quot;play-file&quot; data=&quot;directory/dir-press.wav&quot;/&gt;
+                                &lt;action function=&quot;say&quot; data=&quot;$2&quot; method=&quot;pronounced&quot; type=&quot;name_spelled&quot;/&gt;
+                        &lt;/match&gt;
+                &lt;/input&gt;
+                &lt;input pattern=&quot;^(first_name):([0-9#*])$&quot; break_on_match=&quot;false&quot;&gt;
+                        &lt;match&gt;
+                                &lt;action function=&quot;play-file&quot; data=&quot;directory/dir-to_search_by.wav&quot;/&gt;
+                                &lt;action function=&quot;play-file&quot; data=&quot;directory/dir-last_name.wav&quot;/&gt;
+                                &lt;action function=&quot;play-file&quot; data=&quot;directory/dir-press.wav&quot;/&gt;
+                                &lt;action function=&quot;say&quot; data=&quot;$2&quot; method=&quot;pronounced&quot; type=&quot;name_spelled&quot;/&gt;
+                        &lt;/match&gt;
+                &lt;/input&gt;
+        &lt;/macro&gt;
+
+        &lt;macro name=&quot;directory_min_search_digits&quot;&gt;
+                &lt;input pattern=&quot;^(.*)$&quot;&gt;
+                        &lt;match&gt;
+                                &lt;action function=&quot;play-file&quot; data=&quot;directory/dir-specify_mininum_first.wav&quot;/&gt;
+                                &lt;action function=&quot;say&quot; data=&quot;$1&quot; method=&quot;pronounced&quot; type=&quot;items&quot;/&gt;
+                                &lt;action function=&quot;play-file&quot; data=&quot;directory/dir-letters_of_person_name.wav&quot;/&gt;
+                        &lt;/match&gt;
+                &lt;/input&gt;
+        &lt;/macro&gt;
+
+        &lt;macro name=&quot;directory_result_count&quot;&gt;
+                &lt;input pattern=&quot;^0$&quot; break_on_match=&quot;true&quot;&gt;
+                        &lt;match&gt;
+                                &lt;action function=&quot;play-file&quot; data=&quot;directory/dir-no_match_entry.wav&quot;/&gt;
+                        &lt;/match&gt;
+                &lt;/input&gt;
+                &lt;input pattern=&quot;^(.*)$&quot;&gt;
+                        &lt;match&gt;
+                                &lt;action function=&quot;say&quot; data=&quot;$1&quot; method=&quot;pronounced&quot; type=&quot;items&quot;/&gt;
+                                &lt;action function=&quot;play-file&quot; data=&quot;directory/dir-result_match.wav&quot;/&gt;
+                        &lt;/match&gt;
+                &lt;/input&gt;
+        &lt;/macro&gt;
+
+        &lt;macro name=&quot;directory_result_count_too_large&quot;&gt;
+                &lt;input pattern=&quot;^(.*)$&quot;&gt;
+                        &lt;match&gt;
+                                &lt;action function=&quot;play-file&quot; data=&quot;directory/dir-to_many_result.wav&quot;/&gt;
+                        &lt;/match&gt;
+                &lt;/input&gt;
+
+        &lt;/macro&gt;
+
+        &lt;macro name=&quot;directory_result_last&quot;&gt;
+                &lt;input pattern=&quot;^(.*)$&quot;&gt;
+                        &lt;match&gt;
+                                &lt;action function=&quot;play-file&quot; data=&quot;directory/dir-no_more_result.wav&quot;/&gt;
+                        &lt;/match&gt;
+                &lt;/input&gt;
+
+        &lt;/macro&gt;
+
+        &lt;macro name=&quot;directory_result_item&quot;&gt;
+                &lt;input pattern=&quot;^(.*)$&quot;&gt;
+                        &lt;match&gt;
+                                &lt;action function=&quot;play-file&quot; data=&quot;directory/dir-result_number.wav&quot;/&gt;
+                                &lt;action function=&quot;say&quot; data=&quot;$1&quot; method=&quot;pronounced&quot; type=&quot;items&quot;/&gt;
+                        &lt;/match&gt;
+                &lt;/input&gt;
+        &lt;/macro&gt;
+
+        &lt;macro name=&quot;directory_result_at&quot;&gt;
+                &lt;input pattern=&quot;^(.*)$&quot;&gt;
+                        &lt;match&gt;
+                                &lt;action function=&quot;play-file&quot; data=&quot;directory/dir-at_extension.wav&quot;/&gt;
+                                &lt;action function=&quot;say&quot; data=&quot;$1&quot; method=&quot;pronounced&quot; type=&quot;name_spelled&quot;/&gt;
+                        &lt;/match&gt;
+                &lt;/input&gt;
+        &lt;/macro&gt;
+
+        &lt;macro name=&quot;directory_result_menu&quot;&gt;
+                &lt;input pattern=&quot;^([0-9#*]),([0-9#*]),([0-9#*]),([0-9#*])$&quot;&gt;
+                        &lt;match&gt;
+                                &lt;action function=&quot;play-file&quot; data=&quot;directory/dir-to_select_entry.wav&quot;/&gt;
+                                &lt;action function=&quot;play-file&quot; data=&quot;directory/dir-press.wav&quot;/&gt;
+                                &lt;action function=&quot;say&quot; data=&quot;$1&quot; method=&quot;pronounced&quot; type=&quot;name_spelled&quot;/&gt;
+                                &lt;action function=&quot;play-file&quot; data=&quot;directory/dir-for_next.wav&quot;/&gt;
+                                &lt;action function=&quot;play-file&quot; data=&quot;directory/dir-press.wav&quot;/&gt;
+                                &lt;action function=&quot;say&quot; data=&quot;$2&quot; method=&quot;pronounced&quot; type=&quot;name_spelled&quot;/&gt;
+                                &lt;action function=&quot;play-file&quot; data=&quot;directory/dir-for_prev.wav&quot;/&gt;
+                                &lt;action function=&quot;play-file&quot; data=&quot;directory/dir-press.wav&quot;/&gt;
+                                &lt;action function=&quot;say&quot; data=&quot;$3&quot; method=&quot;pronounced&quot; type=&quot;name_spelled&quot;/&gt;
+                                &lt;action function=&quot;play-file&quot; data=&quot;directory/dir-to_make_new_search.wav&quot;/&gt;
+                                &lt;action function=&quot;play-file&quot; data=&quot;directory/dir-press.wav&quot;/&gt;
+                                &lt;action function=&quot;say&quot; data=&quot;$4&quot; method=&quot;pronounced&quot; type=&quot;name_spelled&quot;/&gt;
+
+                        &lt;/match&gt;
+                &lt;/input&gt;
+        &lt;/macro&gt;
+
+        &lt;macro name=&quot;directory_result_say_name&quot;&gt;
+                &lt;input pattern=&quot;^(.*)$&quot;&gt;
+                        &lt;match&gt;
+                                &lt;action function=&quot;say&quot; data=&quot;$1&quot; method=&quot;pronounced&quot; type=&quot;name_spelled&quot;/&gt;
+                        &lt;/match&gt;
+                &lt;/input&gt;
+        &lt;/macro&gt;
+
+&lt;/include&gt;&lt;!--This line will be ignored it's here to validate the xml and is optional --&gt;
</ins></span></pre></div>
<a id="freeswitchtrunkconflangendirttsxml"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/conf/lang/en/dir/tts.xml (0 => 14984)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/conf/lang/en/dir/tts.xml                                (rev 0)
+++ freeswitch/trunk/conf/lang/en/dir/tts.xml        2009-09-25 19:48:46 UTC (rev 14984)
</span><span class="lines">@@ -0,0 +1,96 @@
</span><ins>+&lt;include&gt;&lt;!--This line will be ignored it's here to validate the xml and is optional --&gt;
+
+        &lt;macro name=&quot;directory_intro&quot;&gt;
+                &lt;input pattern=&quot;^(last_name)&quot; break_on_match=&quot;false&quot;&gt;
+                        &lt;match&gt;
+                                &lt;action function=&quot;speak-text&quot; data=&quot;Please enter the first few digit of the person last name&quot;/&gt;
+                        &lt;/match&gt;
+                &lt;/input&gt;
+                &lt;input pattern=&quot;^(first_name)&quot; break_on_match=&quot;false&quot;&gt;
+                        &lt;match&gt;
+                                &lt;action function=&quot;speak-text&quot; data=&quot;Please enter the first few digit of the person first name&quot;/&gt;
+                        &lt;/match&gt;
+                &lt;/input&gt;
+                &lt;input pattern=&quot;^(last_name):([0-9#*])$&quot; break_on_match=&quot;false&quot;&gt;
+                        &lt;match&gt;
+                                &lt;action function=&quot;speak-text&quot; data=&quot;to search by first name, press $2&quot;/&gt;
+                        &lt;/match&gt;
+                &lt;/input&gt;
+                &lt;input pattern=&quot;^(first_name):([0-9#*])$&quot; break_on_match=&quot;false&quot;&gt;
+                        &lt;match&gt;
+                                &lt;action function=&quot;speak-text&quot; data=&quot;to search by last name, press $2&quot;/&gt;
+                        &lt;/match&gt;
+                &lt;/input&gt;
+        &lt;/macro&gt;
+
+        &lt;macro name=&quot;directory_min_search_digits&quot;&gt;
+                &lt;input pattern=&quot;^(.*)$&quot;&gt;
+                        &lt;match&gt;
+                                &lt;action function=&quot;speak-text&quot; data=&quot;You need to specify a minimum the first $1 letters of the person name, try again.&quot;/&gt;
+                        &lt;/match&gt;
+                &lt;/input&gt;
+        &lt;/macro&gt;
+
+        &lt;macro name=&quot;directory_result_count&quot;&gt;
+                &lt;input pattern=&quot;^0$&quot; break_on_match=&quot;true&quot;&gt;
+                        &lt;match&gt;
+                                &lt;action function=&quot;speak-text&quot; data=&quot;Your search match no user on this system, try again.&quot;/&gt;
+                        &lt;/match&gt;
+                &lt;/input&gt;
+                &lt;input pattern=&quot;^(.*)$&quot;&gt;
+                        &lt;match&gt;
+                                &lt;action function=&quot;speak-text&quot; data=&quot;$1 result match your search&quot;/&gt;
+                        &lt;/match&gt;
+                &lt;/input&gt;
+        &lt;/macro&gt;
+
+        &lt;macro name=&quot;directory_result_count_too_large&quot;&gt;
+                &lt;input pattern=&quot;^(.*)$&quot;&gt;
+                        &lt;match&gt;
+                                &lt;action function=&quot;speak-text&quot; data=&quot;Your search returned too many result, please try again&quot;/&gt;
+                        &lt;/match&gt;
+                &lt;/input&gt;
+
+        &lt;/macro&gt;
+
+        &lt;macro name=&quot;directory_result_last&quot;&gt;
+                &lt;input pattern=&quot;^(.*)$&quot;&gt;
+                        &lt;match&gt;
+                                &lt;action function=&quot;speak-text&quot; data=&quot;No more result&quot;/&gt;
+                        &lt;/match&gt;
+                &lt;/input&gt;
+
+        &lt;/macro&gt;
+
+        &lt;macro name=&quot;directory_result_item&quot;&gt;
+                &lt;input pattern=&quot;^(.*)$&quot;&gt;
+                        &lt;match&gt;
+                                &lt;action function=&quot;speak-text&quot; data=&quot;Result number $1&quot;/&gt;
+                        &lt;/match&gt;
+                &lt;/input&gt;
+        &lt;/macro&gt;
+
+        &lt;macro name=&quot;directory_result_menu&quot;&gt;
+                &lt;input pattern=&quot;^([0-9#*]),([0-9#*]),([0-9#*]),([0-9#*])$&quot;&gt;
+                        &lt;match&gt;
+                                &lt;action function=&quot;speak-text&quot; data=&quot;To select this entry press $1, for the next entry press $2, for the previous entry press $3, to make a new search press $4&quot;/&gt;
+                        &lt;/match&gt;
+                &lt;/input&gt;
+        &lt;/macro&gt;
+
+        &lt;macro name=&quot;directory_result_at&quot;&gt;
+                &lt;input pattern=&quot;^(.*)$&quot;&gt;
+                        &lt;match&gt;
+                                &lt;action function=&quot;speak-text&quot; data=&quot;at extension $1&quot;/&gt;
+                        &lt;/match&gt;
+                &lt;/input&gt;
+        &lt;/macro&gt;
+        &lt;macro name=&quot;directory_result_say_name&quot;&gt;
+                &lt;input pattern=&quot;^(.*)$&quot;&gt;
+                        &lt;match&gt;
+                                &lt;action function=&quot;speak-text&quot; data=&quot;$1&quot;/&gt;
+                        &lt;/match&gt;
+                &lt;/input&gt;
+        &lt;/macro&gt;
+
+&lt;/include&gt;&lt;!--This line will be ignored it's here to validate the xml and is optional --&gt;
</ins></span></pre></div>
<a id="freeswitchtrunkconflangenenxml"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/conf/lang/en/en.xml (14983 => 14984)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/conf/lang/en/en.xml        2009-09-25 19:48:28 UTC (rev 14983)
+++ freeswitch/trunk/conf/lang/en/en.xml        2009-09-25 19:48:46 UTC (rev 14984)
</span><span class="lines">@@ -3,5 +3,6 @@
</span><span class="cx">     &lt;X-PRE-PROCESS cmd=&quot;include&quot; data=&quot;demo/*.xml&quot;/&gt; &lt;!-- Note: this now grabs whole subdir, previously grabbed only demo.xml --&gt;
</span><span class="cx">     &lt;!--voicemail_en_tts is purely implemented with tts, we have the files based one that is the default. --&gt;
</span><span class="cx">     &lt;X-PRE-PROCESS cmd=&quot;include&quot; data=&quot;vm/sounds.xml&quot;/&gt;  &lt;!-- vm/tts.xml if you want to use tts and have cepstral --&gt;
</span><ins>+    &lt;X-PRE-PROCESS cmd=&quot;include&quot; data=&quot;dir/sounds.xml&quot;/&gt;  &lt;!-- dir/tts.xml if you want to use tts and have cepstral --&gt;
</ins><span class="cx">   &lt;/language&gt;
</span><span class="cx"> &lt;/include&gt;
</span></span></pre></div>
<a id="freeswitchtrunkconflangfrdirsoundsxml"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/conf/lang/fr/dir/sounds.xml (0 => 14984)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/conf/lang/fr/dir/sounds.xml                                (rev 0)
+++ freeswitch/trunk/conf/lang/fr/dir/sounds.xml        2009-09-25 19:48:46 UTC (rev 14984)
</span><span class="lines">@@ -0,0 +1,121 @@
</span><ins>+&lt;include&gt;&lt;!--This line will be ignored it's here to validate the xml and is optional --&gt;
+        &lt;macro name=&quot;directory_intro&quot;&gt;
+                &lt;input pattern=&quot;^(last_name)&quot; break_on_match=&quot;false&quot;&gt;
+                        &lt;match&gt;
+                                &lt;action function=&quot;play-file&quot; data=&quot;directory/dir-enter-person.wav&quot;/&gt;
+                                &lt;action function=&quot;play-file&quot; data=&quot;directory/dir-last_name.wav&quot;/&gt;
+                        &lt;/match&gt;
+                &lt;/input&gt;
+                &lt;input pattern=&quot;^(first_name)&quot; break_on_match=&quot;false&quot;&gt;
+                        &lt;match&gt;
+                &lt;action function=&quot;play-file&quot; data=&quot;directory/dir-enter-person.wav&quot;/&gt;
+                &lt;action function=&quot;play-file&quot; data=&quot;directory/dir-first_name.wav&quot;/&gt;
+                        &lt;/match&gt;
+                &lt;/input&gt;
+                &lt;input pattern=&quot;^(last_name):([0-9#*])$&quot; break_on_match=&quot;false&quot;&gt;
+                        &lt;match&gt;
+                                &lt;action function=&quot;play-file&quot; data=&quot;directory/dir-to_search_by.wav&quot;/&gt;
+                                &lt;action function=&quot;play-file&quot; data=&quot;directory/dir-first_name.wav&quot;/&gt;
+                                &lt;action function=&quot;play-file&quot; data=&quot;directory/dir-press.wav&quot;/&gt;
+                                &lt;action function=&quot;say&quot; data=&quot;$2&quot; method=&quot;pronounced&quot; type=&quot;name_spelled&quot;/&gt;
+                        &lt;/match&gt;
+                &lt;/input&gt;
+                &lt;input pattern=&quot;^(first_name):([0-9#*])$&quot; break_on_match=&quot;false&quot;&gt;
+                        &lt;match&gt;
+                                &lt;action function=&quot;play-file&quot; data=&quot;directory/dir-to_search_by.wav&quot;/&gt;
+                                &lt;action function=&quot;play-file&quot; data=&quot;directory/dir-last_name.wav&quot;/&gt;
+                                &lt;action function=&quot;play-file&quot; data=&quot;directory/dir-press.wav&quot;/&gt;
+                                &lt;action function=&quot;say&quot; data=&quot;$2&quot; method=&quot;pronounced&quot; type=&quot;name_spelled&quot;/&gt;
+                        &lt;/match&gt;
+                &lt;/input&gt;
+        &lt;/macro&gt;
+
+        &lt;macro name=&quot;directory_min_search_digits&quot;&gt;
+                &lt;input pattern=&quot;^(.*)$&quot;&gt;
+                        &lt;match&gt;
+                                &lt;action function=&quot;play-file&quot; data=&quot;directory/dir-specify_mininum_first.wav&quot;/&gt;
+                                &lt;action function=&quot;say&quot; data=&quot;$1&quot; method=&quot;pronounced&quot; type=&quot;items&quot;/&gt;
+                                &lt;action function=&quot;play-file&quot; data=&quot;directory/dir-letters_of_person_name.wav&quot;/&gt;
+                        &lt;/match&gt;
+                &lt;/input&gt;
+        &lt;/macro&gt;
+
+        &lt;macro name=&quot;directory_result_count&quot;&gt;
+                &lt;input pattern=&quot;^0$&quot; break_on_match=&quot;true&quot;&gt;
+                        &lt;match&gt;
+                                &lt;action function=&quot;play-file&quot; data=&quot;directory/dir-no_match_entry.wav&quot;/&gt;
+                        &lt;/match&gt;
+                &lt;/input&gt;
+                &lt;input pattern=&quot;^(.*)$&quot;&gt;
+                        &lt;match&gt;
+                                &lt;action function=&quot;say&quot; data=&quot;$1&quot; method=&quot;pronounced&quot; type=&quot;items&quot;/&gt;
+                                &lt;action function=&quot;play-file&quot; data=&quot;directory/dir-result_match.wav&quot;/&gt;
+                        &lt;/match&gt;
+                &lt;/input&gt;
+        &lt;/macro&gt;
+
+        &lt;macro name=&quot;directory_result_count_too_large&quot;&gt;
+                &lt;input pattern=&quot;^(.*)$&quot;&gt;
+                        &lt;match&gt;
+                                &lt;action function=&quot;play-file&quot; data=&quot;directory/dir-to_many_result.wav&quot;/&gt;
+                        &lt;/match&gt;
+                &lt;/input&gt;
+
+        &lt;/macro&gt;
+
+        &lt;macro name=&quot;directory_result_last&quot;&gt;
+                &lt;input pattern=&quot;^(.*)$&quot;&gt;
+                        &lt;match&gt;
+                                &lt;action function=&quot;play-file&quot; data=&quot;directory/dir-no_more_result.wav&quot;/&gt;
+                        &lt;/match&gt;
+                &lt;/input&gt;
+
+        &lt;/macro&gt;
+
+        &lt;macro name=&quot;directory_result_item&quot;&gt;
+                &lt;input pattern=&quot;^(.*)$&quot;&gt;
+                        &lt;match&gt;
+                                &lt;action function=&quot;play-file&quot; data=&quot;directory/dir-result_number.wav&quot;/&gt;
+                                &lt;action function=&quot;say&quot; data=&quot;$1&quot; method=&quot;pronounced&quot; type=&quot;items&quot;/&gt;
+                        &lt;/match&gt;
+                &lt;/input&gt;
+        &lt;/macro&gt;
+
+        &lt;macro name=&quot;directory_result_at&quot;&gt;
+                &lt;input pattern=&quot;^(.*)$&quot;&gt;
+                        &lt;match&gt;
+                                &lt;action function=&quot;play-file&quot; data=&quot;directory/dir-at_extension.wav&quot;/&gt;
+                                &lt;action function=&quot;say&quot; data=&quot;$1&quot; method=&quot;pronounced&quot; type=&quot;name_spelled&quot;/&gt;
+                        &lt;/match&gt;
+                &lt;/input&gt;
+        &lt;/macro&gt;
+
+        &lt;macro name=&quot;directory_result_menu&quot;&gt;
+                &lt;input pattern=&quot;^([0-9#*]),([0-9#*]),([0-9#*]),([0-9#*])$&quot;&gt;
+                        &lt;match&gt;
+                                &lt;action function=&quot;play-file&quot; data=&quot;directory/dir-to_select_entry.wav&quot;/&gt;
+                                &lt;action function=&quot;play-file&quot; data=&quot;directory/dir-press.wav&quot;/&gt;
+                                &lt;action function=&quot;say&quot; data=&quot;$1&quot; method=&quot;pronounced&quot; type=&quot;name_spelled&quot;/&gt;
+                                &lt;action function=&quot;play-file&quot; data=&quot;directory/dir-for_next.wav&quot;/&gt;
+                                &lt;action function=&quot;play-file&quot; data=&quot;directory/dir-press.wav&quot;/&gt;
+                                &lt;action function=&quot;say&quot; data=&quot;$2&quot; method=&quot;pronounced&quot; type=&quot;name_spelled&quot;/&gt;
+                                &lt;action function=&quot;play-file&quot; data=&quot;directory/dir-for_prev.wav&quot;/&gt;
+                                &lt;action function=&quot;play-file&quot; data=&quot;directory/dir-press.wav&quot;/&gt;
+                                &lt;action function=&quot;say&quot; data=&quot;$3&quot; method=&quot;pronounced&quot; type=&quot;name_spelled&quot;/&gt;
+                                &lt;action function=&quot;play-file&quot; data=&quot;directory/dir-to_make_new_search.wav&quot;/&gt;
+                                &lt;action function=&quot;play-file&quot; data=&quot;directory/dir-press.wav&quot;/&gt;
+                                &lt;action function=&quot;say&quot; data=&quot;$4&quot; method=&quot;pronounced&quot; type=&quot;name_spelled&quot;/&gt;
+
+                        &lt;/match&gt;
+                &lt;/input&gt;
+        &lt;/macro&gt;
+
+        &lt;macro name=&quot;directory_result_say_name&quot;&gt;
+                &lt;input pattern=&quot;^(.*)$&quot;&gt;
+                        &lt;match&gt;
+                                &lt;action function=&quot;say&quot; data=&quot;$1&quot; method=&quot;pronounced&quot; type=&quot;name_spelled&quot;/&gt;
+                        &lt;/match&gt;
+                &lt;/input&gt;
+        &lt;/macro&gt;
+
+&lt;/include&gt;&lt;!--This line will be ignored it's here to validate the xml and is optional --&gt;
</ins></span></pre></div>
<a id="freeswitchtrunkconflangfrdirttsxml"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/conf/lang/fr/dir/tts.xml (0 => 14984)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/conf/lang/fr/dir/tts.xml                                (rev 0)
+++ freeswitch/trunk/conf/lang/fr/dir/tts.xml        2009-09-25 19:48:46 UTC (rev 14984)
</span><span class="lines">@@ -0,0 +1,101 @@
</span><ins>+&lt;include&gt;&lt;!--This line will be ignored it's here to validate the xml and is optional --&gt;
+
+        &lt;macro name=&quot;directory_intro&quot;&gt;
+                &lt;input pattern=&quot;^(last_name)&quot; break_on_match=&quot;false&quot;&gt;
+                        &lt;match&gt;
+                                &lt;action function=&quot;speak-text&quot; data=&quot;Veuillez entrer les premiere lettre du nom de famille&quot;/&gt;
+                        &lt;/match&gt;
+                &lt;/input&gt;
+                &lt;input pattern=&quot;^(first_name)&quot; break_on_match=&quot;false&quot;&gt;
+                        &lt;match&gt;
+                                &lt;action function=&quot;speak-text&quot; data=&quot;Veuillez entrer les premiere lettre du prénom&quot;/&gt;
+                        &lt;/match&gt;
+                &lt;/input&gt;
+                &lt;input pattern=&quot;^(last_name):([0-9#*])$&quot; break_on_match=&quot;false&quot;&gt;
+                        &lt;match&gt;
+                                &lt;action function=&quot;speak-text&quot; data=&quot;pour chercher par prénom, appuyer sur le $2&quot;/&gt;
+                        &lt;/match&gt;
+                &lt;/input&gt;
+                &lt;input pattern=&quot;^(first_name):([0-9#*])$&quot; break_on_match=&quot;false&quot;&gt;
+                        &lt;match&gt;
+                                &lt;action function=&quot;speak-text&quot; data=&quot;pour chercher par nom de famille, appuyer sur le $2&quot;/&gt;
+                        &lt;/match&gt;
+                &lt;/input&gt;
+        &lt;/macro&gt;
+
+        &lt;macro name=&quot;directory_min_search_digits&quot;&gt;
+                &lt;input pattern=&quot;^(1)$&quot;&gt;
+                        &lt;match&gt;
+                                &lt;action function=&quot;speak-text&quot; data=&quot;Vous devez entré au minimum une lettre du nom de la personne, essayer de nouveaux&quot;/&gt;
+                        &lt;/match&gt;
+                &lt;/input&gt;
+                &lt;input pattern=&quot;^(.*)$&quot;&gt;
+                        &lt;match&gt;
+                                &lt;action function=&quot;speak-text&quot; data=&quot;Vous devez entré au minimum $1 lettre du nom de la personne, essayer de nouveaux&quot;/&gt;
+                        &lt;/match&gt;
+                &lt;/input&gt;
+        &lt;/macro&gt;
+
+        &lt;macro name=&quot;directory_result_count&quot;&gt;
+                &lt;input pattern=&quot;^0$&quot; break_on_match=&quot;true&quot;&gt;
+                        &lt;match&gt;
+                                &lt;action function=&quot;speak-text&quot; data=&quot;Votre recherche a retourner aucune résultat, essayer de nouveaux&quot;/&gt;
+                        &lt;/match&gt;
+                &lt;/input&gt;
+                &lt;input pattern=&quot;^(.*)$&quot;&gt;
+                        &lt;match&gt;
+                                &lt;action function=&quot;speak-text&quot; data=&quot;$1 résultats correspond a votre recherche&quot;/&gt;
+                        &lt;/match&gt;
+                &lt;/input&gt;
+        &lt;/macro&gt;
+
+        &lt;macro name=&quot;directory_result_count_too_large&quot;&gt;
+                &lt;input pattern=&quot;^(.*)$&quot;&gt;
+                        &lt;match&gt;
+                                &lt;action function=&quot;speak-text&quot; data=&quot;Votre recherche retourne trop de résultat, essayer de nouveaux.&quot;/&gt;
+                        &lt;/match&gt;
+                &lt;/input&gt;
+
+        &lt;/macro&gt;
+
+        &lt;macro name=&quot;directory_result_last&quot;&gt;
+                &lt;input pattern=&quot;^(.*)$&quot;&gt;
+                        &lt;match&gt;
+                                &lt;action function=&quot;speak-text&quot; data=&quot;Fin des résultats.&quot;/&gt;
+                        &lt;/match&gt;
+                &lt;/input&gt;
+
+        &lt;/macro&gt;
+
+        &lt;macro name=&quot;directory_result_item&quot;&gt;
+                &lt;input pattern=&quot;^(.*)$&quot;&gt;
+                        &lt;match&gt;
+                                &lt;action function=&quot;speak-text&quot; data=&quot;Résultat numéro $1&quot;/&gt;
+                        &lt;/match&gt;
+                &lt;/input&gt;
+        &lt;/macro&gt;
+
+        &lt;macro name=&quot;directory_result_menu&quot;&gt;
+                &lt;input pattern=&quot;^([0-9#*]),([0-9#*]),([0-9#*]),([0-9#*])$&quot;&gt;
+                        &lt;match&gt;
+                                &lt;action function=&quot;speak-text&quot; data=&quot;Pour selectionner ce nom appuyer sur le $1, pour le nom suivant appuyer sur le $2, pour le nom précédent appuyer sur le $3 ou pour faire une nouvelle recherche appuyer sur le $4&quot;/&gt;
+                        &lt;/match&gt;
+                &lt;/input&gt;
+        &lt;/macro&gt;
+
+        &lt;macro name=&quot;directory_result_at&quot;&gt;
+                &lt;input pattern=&quot;^(.*)$&quot;&gt;
+                        &lt;match&gt;
+                                &lt;action function=&quot;speak-text&quot; data=&quot;aux poste $1&quot;/&gt;
+                        &lt;/match&gt;
+                &lt;/input&gt;
+        &lt;/macro&gt;
+        &lt;macro name=&quot;directory_result_say_name&quot;&gt;
+                &lt;input pattern=&quot;^(.*)$&quot;&gt;
+                        &lt;match&gt;
+                                &lt;action function=&quot;speak-text&quot; data=&quot;$1&quot;/&gt;
+                        &lt;/match&gt;
+                &lt;/input&gt;
+        &lt;/macro&gt;
+
+&lt;/include&gt;&lt;!--This line will be ignored it's here to validate the xml and is optional --&gt;
</ins></span></pre></div>
<a id="freeswitchtrunkconflangfrfrxml"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/conf/lang/fr/fr.xml (14983 => 14984)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/conf/lang/fr/fr.xml        2009-09-25 19:48:28 UTC (rev 14983)
+++ freeswitch/trunk/conf/lang/fr/fr.xml        2009-09-25 19:48:46 UTC (rev 14984)
</span><span class="lines">@@ -2,6 +2,7 @@
</span><span class="cx">   &lt;language name=&quot;fr&quot; sound-path=&quot;/snds&quot; tts-engine=&quot;cepstral&quot; tts-voice=&quot;david&quot;&gt;
</span><span class="cx">     &lt;X-PRE-PROCESS cmd=&quot;include&quot; data=&quot;demo/demo.xml&quot;/&gt;
</span><span class="cx">     &lt;!--voicemail_fr_tts is purely implemented with tts, we need a files based implementation too --&gt;
</span><del>-    &lt;X-PRE-PROCESS cmd=&quot;include&quot; data=&quot;vm/sounds.xml&quot;/&gt;
</del><ins>+        &lt;X-PRE-PROCESS cmd=&quot;include&quot; data=&quot;vm/sounds.xml&quot;/&gt;
+        &lt;X-PRE-PROCESS cmd=&quot;include&quot; data=&quot;dir/sounds.xml&quot;/&gt;  &lt;!-- dir/tts.xml if you want to use tts and have cepstral --&gt;
</ins><span class="cx">   &lt;/language&gt;
</span><span class="cx"> &lt;/include&gt;
</span></span></pre></div>
<a id="freeswitchtrunkdocsphrasephrase_enxml"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/docs/phrase/phrase_en.xml (14983 => 14984)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/docs/phrase/phrase_en.xml        2009-09-25 19:48:28 UTC (rev 14983)
+++ freeswitch/trunk/docs/phrase/phrase_en.xml        2009-09-25 19:48:46 UTC (rev 14984)
</span><span class="lines">@@ -219,6 +219,25 @@
</span><span class="cx">       &lt;prompt phrase=&quot;urgent&quot; filename=&quot;vm-urgent.wav&quot;/&gt;
</span><span class="cx">       &lt;prompt phrase=&quot;That mailbox is full. Please try your call again later.&quot; filename=&quot;vm-mailbox_full.wav&quot;/&gt;
</span><span class="cx">     &lt;/voicemail&gt;
</span><ins>+    &lt;directory&gt;
+          &lt;prompt phrase=&quot;Please enter the first few letters of the persons&quot; filename=&quot;dir-enter-person.wav&quot;/&gt;
+          &lt;prompt phrase=&quot;last name.&quot; filename=&quot;dir-last_name.wav&quot;/&gt;
+          &lt;prompt phrase=&quot;To search by&quot; filename=&quot;dir-to_search_by.wav&quot;/&gt;
+          &lt;prompt phrase=&quot;first name.&quot; filename=&quot;dir-first_name.wav&quot;/&gt;
+          &lt;prompt phrase=&quot;Your search matched no results, try again.&quot; filename=&quot;dir-no_match_entry.wav&quot;/&gt;
+          &lt;prompt phrase=&quot;results matched your search.&quot; filename=&quot;dir-result_match.wav&quot;/&gt;
+          &lt;prompt phrase=&quot;Your search returned too many results, please try again.&quot; filename=&quot;dir-to_many_result.wav&quot;/&gt;
+          &lt;prompt phrase=&quot;No more results.&quot; filename=&quot;dir-no_more_result.wav&quot;/&gt;
+          &lt;prompt phrase=&quot;Result number.&quot; filename=&quot;dir-result_number.wav&quot;/&gt;
+          &lt;prompt phrase=&quot;at extension&quot; filename=&quot;dir-at_extension.wav&quot;/&gt;
+          &lt;prompt phrase=&quot;To select this entry&quot; filename=&quot;dir-to_select_entry.wav&quot;/&gt;
+          &lt;prompt phrase=&quot;For the next entry&quot; filename=&quot;dir-for_next.wav&quot;/&gt;
+          &lt;prompt phrase=&quot;For the previous entry&quot; filename=&quot;dir-for_prev.wav&quot;/&gt;
+          &lt;prompt phrase=&quot;To start a new search&quot; filename=&quot;dir-to_make_new_search.wav&quot;/&gt;
+          &lt;prompt phrase=&quot;You need to specify a minimum of&quot; filename=&quot;dir-specify_mininum_first.wav&quot;/&gt;
+          &lt;prompt phrase=&quot;letters of the person name, try again.&quot; filename=&quot;dir-letters_of_person_name.wav&quot;/&gt;
+          &lt;prompt phrase=&quot;press&quot; filename=&quot;dir-press.wav&quot;/&gt;
+    &lt;/directory&gt;
</ins><span class="cx">     &lt;conference&gt;
</span><span class="cx">       &lt;prompt phrase=&quot;NULL&quot; filename=&quot;conf-ack.wav&quot; type=&quot;tone&quot;/&gt;
</span><span class="cx">       &lt;prompt phrase=&quot;NULL&quot; filename=&quot;conf-nack.wav&quot; type=&quot;tone&quot;/&gt;
</span></span></pre></div>
<a id="freeswitchtrunkdocsphrasephrase_frxml"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/docs/phrase/phrase_fr.xml (14983 => 14984)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/docs/phrase/phrase_fr.xml        2009-09-25 19:48:28 UTC (rev 14983)
+++ freeswitch/trunk/docs/phrase/phrase_fr.xml        2009-09-25 19:48:46 UTC (rev 14984)
</span><span class="lines">@@ -218,7 +218,26 @@
</span><span class="cx">         &lt;prompt phrase=&quot;pour répondre Ã  cet appel tout de suite&quot; filename=&quot;vm-return_call.wav&quot;/&gt;
</span><span class="cx">         &lt;prompt phrase=&quot;urgent&quot; filename=&quot;vm-urgent.wav&quot;/&gt;
</span><span class="cx">     &lt;/voicemail&gt;
</span><del>-    &lt;conference&gt;
</del><ins>+        &lt;directory&gt;
+                &lt;prompt phrase=&quot;Veuillez entrer les premiere lettre du&quot; filename=&quot;dir-enter-person.wav&quot;/&gt;
+                &lt;prompt phrase=&quot;nom de famille.&quot; filename=&quot;dir-last_name.wav&quot;/&gt;
+                &lt;prompt phrase=&quot;Pour chercher par&quot; filename=&quot;dir-to_search_by.wav&quot;/&gt;
+                &lt;prompt phrase=&quot;prénom.&quot; filename=&quot;dir-first_name.wav&quot;/&gt;
+                &lt;prompt phrase=&quot;Votre recherche a retourner aucune résultat, essayer de nouveaux.&quot; filename=&quot;dir-no_match_entry.wav&quot;/&gt;
+                &lt;prompt phrase=&quot;résultats correspond a votre recherche.&quot; filename=&quot;dir-result_match.wav&quot;/&gt;
+                &lt;prompt phrase=&quot;Votre recherche retourne trop de résultat, essayer de nouveaux.&quot; filename=&quot;dir-to_many_result.wav&quot;/&gt;
+                &lt;prompt phrase=&quot;Fin des résultats.&quot; filename=&quot;dir-no_more_result.wav&quot;/&gt;
+                &lt;prompt phrase=&quot;Résultat numéro&quot; filename=&quot;dir-result_number.wav&quot;/&gt;
+                &lt;prompt phrase=&quot;aux poste&quot; filename=&quot;dir-at_extension.wav&quot;/&gt;
+                &lt;prompt phrase=&quot;Pour selectionner ce nom&quot; filename=&quot;dir-to_select_entry.wav&quot;/&gt;
+                &lt;prompt phrase=&quot;Pour le nom suivant&quot; filename=&quot;dir-for_next.wav&quot;/&gt;
+                &lt;prompt phrase=&quot;Pour le nom précédent&quot; filename=&quot;dir-for_prev.wav&quot;/&gt;
+                &lt;prompt phrase=&quot;Pour faire une nouvelle recherche&quot; filename=&quot;dir-to_make_new_search.wav&quot;/&gt;
+                &lt;prompt phrase=&quot;Vous devez entré au minimum&quot; filename=&quot;dir-specify_mininum_first.wav&quot;/&gt;
+                &lt;prompt phrase=&quot;lettre du nom de la personne, essayer de nouveaux.&quot; filename=&quot;dir-letters_of_person_name.wav&quot;/&gt;
+                &lt;prompt phrase=&quot;Appuyez&quot; filename=&quot;dir-press.wav&quot;/&gt;
+        &lt;/directory&gt;
+        &lt;conference&gt;
</ins><span class="cx">       &lt;prompt phrase=&quot;NULL&quot; filename=&quot;conf-ack.wav&quot; type=&quot;tone&quot;/&gt;
</span><span class="cx">       &lt;prompt phrase=&quot;NULL&quot; filename=&quot;conf-nack.wav&quot; type=&quot;tone&quot;/&gt;
</span><span class="cx">       &lt;prompt phrase=&quot;Personne ne peut vous entendre.&quot; filename=&quot;conf-mute.wav&quot;/&gt;
</span></span></pre></div>
<a id="freeswitchtrunkfreeswitchspec"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/freeswitch.spec (14983 => 14984)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/freeswitch.spec        2009-09-25 19:48:28 UTC (rev 14983)
+++ freeswitch/trunk/freeswitch.spec        2009-09-25 19:48:46 UTC (rev 14984)
</span><span class="lines">@@ -314,7 +314,7 @@
</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><span class="cx"> 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;
</span><del>-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_fsv applications/mod_lcr applications/mod_easyroute applications/mod_stress applications/mod_vmd applications/mod_limit applications/mod_soundtouch applications/mod_fax&quot;
</del><ins>+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;
</ins><span class="cx"> CODECS_MODULES=&quot;codecs/mod_ilbc codecs/mod_h26x codecs/mod_voipcodecs codecs/mod_speex codecs/mod_celt codecs/mod_siren&quot;
</span><span class="cx"> DIALPLANS_MODULES=&quot;dialplans/mod_dialplan_asterisk dialplans/mod_dialplan_directory dialplans/mod_dialplan_xml&quot;
</span><span class="cx"> DIRECTORIES_MODULES=&quot;&quot;
</span><span class="lines">@@ -541,6 +541,7 @@
</span><span class="cx"> %{prefix}/mod/mod_limit.so*
</span><span class="cx"> %{prefix}/mod/mod_rss.so*
</span><span class="cx"> %{prefix}/mod/mod_voicemail.so*
</span><ins>+%{prefix}/mod/mod_directory.so*
</ins><span class="cx"> %{prefix}/mod/mod_pocketsphinx.so*
</span><span class="cx"> %{prefix}/mod/mod_flite.so*
</span><span class="cx"> %{prefix}/mod/mod_ilbc.so* 
</span></span></pre></div>
<a id="freeswitchtrunksrcmodapplicationsmod_directoryMakefile"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/src/mod/applications/mod_directory/Makefile (0 => 14984)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/applications/mod_directory/Makefile                                (rev 0)
+++ freeswitch/trunk/src/mod/applications/mod_directory/Makefile        2009-09-25 19:48:46 UTC (rev 14984)
</span><span class="lines">@@ -0,0 +1,2 @@
</span><ins>+BASE=../../../..
+include $(BASE)/build/modmake.rules
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="freeswitchtrunksrcmodapplicationsmod_directorymod_directory2008vcproj"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/src/mod/applications/mod_directory/mod_directory.2008.vcproj (0 => 14984)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/applications/mod_directory/mod_directory.2008.vcproj                                (rev 0)
+++ freeswitch/trunk/src/mod/applications/mod_directory/mod_directory.2008.vcproj        2009-09-25 19:48:46 UTC (rev 14984)
</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_directory&quot;
+        ProjectGUID=&quot;{11C9BC3D-45E9-46E3-BE84-B8CEE4685E39}&quot;
+        RootNamespace=&quot;mod_directory&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_directory.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_directorymod_directoryc"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/src/mod/applications/mod_directory/mod_directory.c (0 => 14984)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/applications/mod_directory/mod_directory.c                                (rev 0)
+++ freeswitch/trunk/src/mod/applications/mod_directory/mod_directory.c        2009-09-25 19:48:46 UTC (rev 14984)
</span><span class="lines">@@ -0,0 +1,990 @@
</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):
+ * 
+ * Marc Olivier Chouinard &lt;mochouinard at moctel dot com&gt;
+ *
+ *
+ * mod_directory.c -- Search by Name Directory IVR
+ *
+ */
+#include &lt;switch.h&gt;
+
+/* Prototypes */
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_directory_shutdown);
+SWITCH_MODULE_LOAD_FUNCTION(mod_directory_load);
+
+SWITCH_MODULE_DEFINITION(mod_directory, mod_directory_load, mod_directory_shutdown, NULL);
+
+static const char *global_cf = &quot;directory.conf&quot;;
+
+static char dir_sql[] =
+&quot;CREATE TABLE directory_search (\n&quot;
+&quot;   hostname         VARCHAR(255),\n&quot;
+&quot;   uuid             VARCHAR(255),\n&quot;
+&quot;   extension        VARCHAR(255),\n&quot;
+&quot;   full_name        VARCHAR(255),\n&quot;
+&quot;   full_name_digit  VARCHAR(255),\n&quot;
+&quot;   first_name       VARCHAR(255),\n&quot;
+&quot;   first_name_digit VARCHAR(255),\n&quot;
+&quot;   last_name        VARCHAR(255),\n&quot;
+&quot;   last_name_digit  VARCHAR(255),\n&quot;
+&quot;   name_visible          INTEGER,\n&quot;
+&quot;   exten_visible         INTEGER\n&quot;
+&quot;);\n&quot;;
+
+#define DIR_RESULT_ITEM &quot;directory_result_item&quot;
+#define DIR_RESULT_SAY_NAME &quot;directory_result_say_name&quot;
+#define DIR_RESULT_AT &quot;directory_result_at&quot;
+#define DIR_RESULT_MENU &quot;directory_result_menu&quot;
+#define DIR_INTRO &quot;directory_intro&quot;
+#define DIR_MIN_SEARCH_DIGITS &quot;directory_min_search_digits&quot;
+#define DIR_RESULT_COUNT &quot;directory_result_count&quot;
+#define DIR_RESULT_COUNT_TOO_LARGE &quot;directory_result_count_too_large&quot;
+#define DIR_RESULT_LAST &quot;directory_result_last&quot;
+
+static switch_xml_config_string_options_t config_dtmf = { NULL, 2, &quot;[0-9#\\*]&quot; };
+static switch_xml_config_int_options_t config_int_digit_timeout = { SWITCH_TRUE, 0, SWITCH_TRUE, 30000 };
+static switch_xml_config_int_options_t config_int_ht_0 = { SWITCH_TRUE, 0 };
+
+static struct {
+        switch_hash_t *profile_hash;
+        char hostname[256];
+        int integer;
+        int debug;
+        char *dbname;
+        switch_mutex_t *mutex;
+        switch_memory_pool_t *pool;
+} globals;
+
+#define DIR_PROFILE_CONFIGITEM_COUNT 100
+
+struct dir_profile {
+        char *name;
+
+        char next_key[2];
+        char prev_key[2];
+        char select_name_key[2];
+        char new_search_key[2];
+
+        char terminator_key[2];
+        char switch_order_key[2];
+
+        char *search_order;
+
+        uint32_t min_search_digits;
+        uint32_t max_menu_attempt;
+        uint32_t digit_timeout;
+        uint32_t max_result;
+        switch_mutex_t *mutex;
+
+        switch_thread_rwlock_t *rwlock;
+        switch_memory_pool_t *pool;
+
+        switch_xml_config_item_t config[DIR_PROFILE_CONFIGITEM_COUNT];
+        switch_xml_config_string_options_t config_str_pool;
+        uint32_t flags;
+};
+
+typedef struct dir_profile dir_profile_t;
+
+typedef enum {
+        PFLAG_DESTROY = 1 &lt;&lt; 0
+} dir_flags_t;
+
+static int digit_matching_keypad(char letter) {
+        int result = -1;
+        switch(toupper(letter)) {
+                case 'A':
+                case 'B':
+                case 'C':
+                        result = 2;
+                        break;
+                case 'D':
+                case 'E':
+                case 'F':
+                        result = 3;
+                        break;
+                case 'G':
+                case 'H':
+                case 'I':
+                        result = 4;
+                        break;
+                case 'J':
+                case 'K':
+                case 'L':
+                        result = 5;
+                        break;
+                case 'M':
+                case 'N':
+                case 'O':
+                        result = 6;
+                        break;
+                case 'P':
+                case 'Q':
+                case 'R':
+                case 'S':
+                        result = 7;
+                        break;
+                case 'T':
+                case 'U':
+                case 'V':
+                        result = 8;
+                        break;
+                case 'W':
+                case 'X':
+                case 'Y':
+                case 'Z':
+                        result = 9;
+                        break;
+        }
+
+
+        return result;
+
+}
+
+char *string_to_keypad_digit(const char *in)
+{
+        const char *s = NULL;
+        char *dst = NULL;
+        char *d = NULL;
+
+        if (in) {
+                s = in;
+                dst = strdup(in);
+                d = dst;
+
+                while (*s) {
+                        char c;
+                        if ((c = digit_matching_keypad(*s++)) &gt; 0) {
+                                *d++ = c + 48;
+                        }
+                }
+                if (*d) {
+                        *d = '\0';
+                }
+        }        
+        return dst;
+}
+
+static switch_status_t directory_execute_sql(char *sql, switch_mutex_t *mutex)
+{
+        switch_core_db_t *db;
+        switch_status_t status = SWITCH_STATUS_SUCCESS;
+
+        if (mutex) {
+                switch_mutex_lock(mutex);
+        }
+
+        if (!(db = switch_core_db_open_file(globals.dbname))) {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, &quot;Error Opening DB %s\n&quot;, globals.dbname);
+                status = SWITCH_STATUS_FALSE;
+                goto end;
+        }
+        status = switch_core_db_persistant_execute(db, sql, 1);
+        switch_core_db_close(db);
+
+end:
+        if (mutex) {
+                switch_mutex_unlock(mutex);
+        }
+
+        return status;
+}
+
+typedef enum {
+        ENTRY_MOVE_NEXT,
+        ENTRY_MOVE_PREV
+} entry_move_t;
+
+struct search_params {
+        char digits[255];
+        char transfer_to[255];
+        char domain[255];
+        char profile[255];
+        int search_by_last_name;
+        int timeout;
+        int try_again;
+};
+typedef struct search_params search_params_t;
+
+struct listing_callback {
+        char extension[255];
+        char fullname[255];
+        char first_name[255];
+        char last_name[255];
+        char transfer_to[255];
+        int name_visible;
+        int exten_visible;
+        int new_search;
+        int index;
+        int want;
+        entry_move_t move;
+        search_params_t *params;
+};
+typedef struct listing_callback listing_callback_t;
+
+static int listing_callback(void *pArg, int argc, char **argv, char **columnNames)
+{
+        listing_callback_t *cbt = (listing_callback_t *) pArg;
+        if (cbt-&gt;index++ != cbt-&gt;want) {
+                return 0;
+        }
+        switch_copy_string(cbt-&gt;extension, argv[0], 255);
+        switch_copy_string(cbt-&gt;fullname, argv[1], 255);
+        switch_copy_string(cbt-&gt;last_name, argv[2], 255);
+        switch_copy_string(cbt-&gt;first_name, argv[3], 255);
+        cbt-&gt;name_visible = atoi(argv[4]);
+        cbt-&gt;exten_visible = atoi(argv[5]);
+        return -1;
+}
+
+
+struct callback {
+        char *buf;
+        size_t len;
+        int matches;
+};
+typedef struct callback callback_t;
+
+static int sql2str_callback(void *pArg, int argc, char **argv, char **columnNames)
+{
+        callback_t *cbt = (callback_t *) pArg;
+
+        switch_copy_string(cbt-&gt;buf, argv[0], cbt-&gt;len);
+        cbt-&gt;matches++;
+        return 0;
+}
+
+static switch_bool_t directory_execute_sql_callback(switch_mutex_t *mutex, char *sql, switch_core_db_callback_func_t callback, void *pdata)
+{
+        switch_bool_t ret = SWITCH_FALSE;
+        switch_core_db_t *db;
+        char *errmsg = NULL;
+
+        if (mutex) {
+                switch_mutex_lock(mutex);
+        }
+
+        if (!(db = switch_core_db_open_file(globals.dbname))) {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, &quot;Error Opening DB %s\n&quot;, globals.dbname);
+                goto end;
+        }
+
+        switch_core_db_exec(db, sql, callback, pdata, &amp;errmsg);
+
+        if (errmsg) {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, &quot;SQL ERR: [%s] %s\n&quot;, sql, errmsg);
+                free(errmsg);
+        }
+
+        if (db) {
+                switch_core_db_close(db);
+        }
+
+end:
+        if (mutex) {
+                switch_mutex_unlock(mutex);
+        }
+
+        return ret;
+}
+
+#define DIR_DESC &quot;directory&quot;
+#define DIR_USAGE &quot;&lt;profile_name&gt; &lt;domain_name&gt;&quot;
+
+static void free_profile(dir_profile_t *profile)
+{
+        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, &quot;Destroying Profile %s\n&quot;, profile-&gt;name);
+        switch_core_destroy_memory_pool(&amp;profile-&gt;pool);
+}
+
+static void profile_rwunlock(dir_profile_t *profile)
+{
+        switch_thread_rwlock_unlock(profile-&gt;rwlock);
+        if (switch_test_flag(profile, PFLAG_DESTROY)) {
+                if (switch_thread_rwlock_tryrdlock(profile-&gt;rwlock) == SWITCH_STATUS_SUCCESS) {
+                        free_profile(profile);
+                }
+        }
+}
+
+dir_profile_t *profile_set_config(dir_profile_t *profile)
+{
+        int i = 0;
+
+        profile-&gt;config_str_pool.pool = profile-&gt;pool;
+
+        SWITCH_CONFIG_SET_ITEM(profile-&gt;config[i++], &quot;next-key&quot;, SWITCH_CONFIG_STRING, CONFIG_RELOADABLE,
+                        &amp;profile-&gt;next_key, &quot;6&quot;, &amp;config_dtmf, NULL, NULL);
+        SWITCH_CONFIG_SET_ITEM(profile-&gt;config[i++], &quot;prev-key&quot;, SWITCH_CONFIG_STRING, CONFIG_RELOADABLE,
+                        &amp;profile-&gt;prev_key, &quot;4&quot;, &amp;config_dtmf, NULL, NULL);
+        SWITCH_CONFIG_SET_ITEM(profile-&gt;config[i++], &quot;terminator-key&quot;, SWITCH_CONFIG_STRING, CONFIG_RELOADABLE,
+                        &amp;profile-&gt;terminator_key, &quot;#&quot;, &amp;config_dtmf, NULL, NULL);
+        SWITCH_CONFIG_SET_ITEM(profile-&gt;config[i++], &quot;switch-order-key&quot;, SWITCH_CONFIG_STRING, CONFIG_RELOADABLE,
+                        &amp;profile-&gt;switch_order_key, &quot;*&quot;, &amp;config_dtmf, NULL, NULL);
+        SWITCH_CONFIG_SET_ITEM(profile-&gt;config[i++], &quot;select-name-key&quot;, SWITCH_CONFIG_STRING, CONFIG_RELOADABLE,
+                        &amp;profile-&gt;select_name_key, &quot;1&quot;, &amp;config_dtmf, NULL, NULL);
+        SWITCH_CONFIG_SET_ITEM(profile-&gt;config[i++], &quot;new-search-key&quot;, SWITCH_CONFIG_STRING, CONFIG_RELOADABLE,
+                        &amp;profile-&gt;new_search_key, &quot;3&quot;, &amp;config_dtmf, NULL, NULL);
+        SWITCH_CONFIG_SET_ITEM(profile-&gt;config[i++], &quot;search-order&quot;, SWITCH_CONFIG_STRING, CONFIG_RELOADABLE,
+                        &amp;profile-&gt;search_order, &quot;last_name&quot;, &amp;profile-&gt;config_str_pool, NULL, NULL);
+        SWITCH_CONFIG_SET_ITEM(profile-&gt;config[i++], &quot;digit-timeout&quot;, SWITCH_CONFIG_INT, CONFIG_RELOADABLE,
+                        &amp;profile-&gt;digit_timeout, 3000, &amp;config_int_digit_timeout, NULL, NULL);
+        SWITCH_CONFIG_SET_ITEM(profile-&gt;config[i++], &quot;min-search-digits&quot;, SWITCH_CONFIG_INT, CONFIG_RELOADABLE,
+                        &amp;profile-&gt;min_search_digits, 3, &amp;config_int_ht_0, NULL, NULL);
+        SWITCH_CONFIG_SET_ITEM(profile-&gt;config[i++], &quot;max-menu-attempts&quot;, SWITCH_CONFIG_INT, CONFIG_RELOADABLE,
+                        &amp;profile-&gt;max_menu_attempt, 3, &amp;config_int_ht_0, NULL, NULL);
+        SWITCH_CONFIG_SET_ITEM(profile-&gt;config[i++], &quot;max-result&quot;, SWITCH_CONFIG_INT, CONFIG_RELOADABLE,
+                        &amp;profile-&gt;max_result, 5, &amp;config_int_ht_0, NULL, NULL);
+
+        return profile;
+
+}
+
+static dir_profile_t * load_profile(const char *profile_name)
+{
+        dir_profile_t *profile = NULL;
+        switch_xml_t x_profiles, x_profile, cfg, xml = NULL;
+        switch_event_t *event = NULL;
+
+        if (!(xml = switch_xml_open_cfg(global_cf, &amp;cfg, NULL))) {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, &quot;Open of %s failed\n&quot;, global_cf);
+                return profile;
+        }
+        if (!(x_profiles = switch_xml_child(cfg, &quot;profiles&quot;))) {
+                goto end;
+        }
+
+        if ((x_profile = switch_xml_find_child(x_profiles, &quot;profile&quot;, &quot;name&quot;, profile_name))) {
+                switch_memory_pool_t *pool;
+                int count;
+
+                if (switch_core_new_memory_pool(&amp;pool) != SWITCH_STATUS_SUCCESS) {
+                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, &quot;Pool Failure\n&quot;);
+                        goto end;
+                }
+
+                if (!(profile = switch_core_alloc(pool, sizeof(dir_profile_t)))) {
+                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, &quot;Alloc Failure\n&quot;);
+                        switch_core_destroy_memory_pool(&amp;pool);
+                        goto end;
+                }
+
+                profile-&gt;pool = pool;
+                profile_set_config(profile);
+
+                /* Add the params to the event structure */
+                count = switch_event_import_xml(switch_xml_child(x_profile, &quot;param&quot;), &quot;name&quot;, &quot;value&quot;, &amp;event);
+
+                if (switch_xml_config_parse_event(event, count, SWITCH_FALSE, profile-&gt;config) != SWITCH_STATUS_SUCCESS) {
+                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, &quot;Failed to process configuration\n&quot;);
+                        switch_core_destroy_memory_pool(&amp;pool);
+                        goto end;
+                }
+
+                switch_thread_rwlock_create(&amp;profile-&gt;rwlock, pool);
+                profile-&gt;name = switch_core_strdup(pool, profile_name);
+
+                switch_mutex_init(&amp;profile-&gt;mutex, SWITCH_MUTEX_NESTED, profile-&gt;pool);
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, &quot;Added Profile %s\n&quot;, profile-&gt;name);
+                switch_core_hash_insert(globals.profile_hash, profile-&gt;name, profile);
+        }
+
+end:
+        switch_xml_free(xml);
+
+        return profile;
+}
+
+static switch_status_t load_config(switch_bool_t reload)
+{
+        switch_xml_t cfg, xml = NULL, settings, param, x_profiles, x_profile;
+
+        if (!(xml = switch_xml_open_cfg(global_cf, &amp;cfg, NULL))) {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, &quot;Open of %s failed\n&quot;, global_cf);
+                return SWITCH_STATUS_TERM;
+        }
+
+        switch_mutex_lock(globals.mutex);
+        if ((settings = switch_xml_child(cfg, &quot;settings&quot;))) {
+                for (param = switch_xml_child(settings, &quot;param&quot;); param; param = param-&gt;next) {
+                        char *var = (char *) switch_xml_attr_soft(param, &quot;name&quot;);
+                        char *val = (char *) switch_xml_attr_soft(param, &quot;value&quot;);
+
+                        if (!strcasecmp(var, &quot;debug&quot;)) {
+                                globals.debug = atoi(val);
+                        }
+                }
+        }
+
+        if ((x_profiles = switch_xml_child(cfg, &quot;profiles&quot;))) {
+                for (x_profile = switch_xml_child(x_profiles, &quot;profile&quot;); x_profile; x_profile = x_profile-&gt;next) {
+                        load_profile(switch_xml_attr_soft(x_profile, &quot;name&quot;));
+                }
+        }
+        switch_mutex_unlock(globals.mutex);
+
+        switch_xml_free(xml);
+        return SWITCH_STATUS_SUCCESS;
+}
+
+static dir_profile_t * get_profile(const char *profile_name)
+{
+        dir_profile_t *profile = NULL;
+
+        switch_mutex_lock(globals.mutex);
+        if (!(profile = switch_core_hash_find(globals.profile_hash, profile_name))) {
+                profile = load_profile(profile_name);
+        }
+        if (profile) {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, &quot;[%s] rwlock\n&quot;, profile-&gt;name);
+
+                switch_thread_rwlock_rdlock(profile-&gt;rwlock);
+        }
+        switch_mutex_unlock(globals.mutex);
+
+        return profile;
+}
+
+static switch_status_t populate_database(switch_core_session_t *session, dir_profile_t * profile, const char *domain_name) {
+        switch_status_t status = SWITCH_STATUS_SUCCESS;
+
+        char *sql = NULL;
+        char *sqlvalues = NULL;
+        char *sqltmp = NULL;
+
+        switch_xml_t xml_root = NULL, x_domain;
+        switch_xml_t ut;
+
+        switch_event_t *xml_params = NULL;
+        switch_xml_t group = NULL, groups = NULL, users = NULL, x_params = NULL, x_param = NULL, x_vars = NULL, x_var = NULL;
+        switch_event_create(&amp;xml_params, SWITCH_EVENT_REQUEST_PARAMS);
+        switch_assert(xml_params);
+
+        if (switch_xml_locate_domain(domain_name, xml_params, &amp;xml_root, &amp;x_domain) != SWITCH_STATUS_SUCCESS) {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, &quot;Cannot locate domain %s\n&quot;, domain_name);
+                status = SWITCH_STATUS_FALSE;
+                goto end;
+        }
+
+        if ((groups = switch_xml_child(x_domain, &quot;groups&quot;))) {
+                for (group = switch_xml_child(groups, &quot;group&quot;); group; group = group-&gt;next) {
+                        if ((users = switch_xml_child(group, &quot;users&quot;))) {
+                                for (ut = switch_xml_child(users, &quot;user&quot;); ut; ut = ut-&gt;next) {
+                                        int name_visible = 1;
+                                        int exten_visible = 1;
+                                        const char *type = switch_xml_attr_soft(ut, &quot;type&quot;);
+                                        const char *id = switch_xml_attr_soft(ut, &quot;id&quot;);
+                                        char *fullName = NULL;
+                                        char *caller_name = NULL;
+                                        char *caller_name_override = NULL;
+                                        char *firstName = NULL;
+                                        char *lastName = NULL;
+                                        char *fullNameDigit = NULL;
+                                        char *firstNameDigit = NULL;
+                                        char *lastNameDigit = NULL;
+
+                                        if (!strcasecmp(type, &quot;pointer&quot;)) {
+                                                continue;
+                                        }
+                                        /* Check all the user params */
+                                        if ((x_params = switch_xml_child(ut, &quot;params&quot;))) {
+                                                for (x_param = switch_xml_child(x_params, &quot;param&quot;); x_param; x_param = x_param-&gt;next) {
+                                                        const char *var = switch_xml_attr_soft(x_param, &quot;name&quot;);
+                                                        const char *val = switch_xml_attr_soft(x_param, &quot;value&quot;);
+                                                        if (!strcasecmp(var, &quot;directory-visible&quot;)) {
+                                                                name_visible = switch_true(val);
+                                                        }
+                                                        if (!strcasecmp(var, &quot;directory-exten-visible&quot;)) {
+                                                                exten_visible = switch_true(val);
+                                                        }
+
+                                                }
+                                        }
+                                        /* Check all the user variables */
+                                        if ((x_vars = switch_xml_child(ut, &quot;variables&quot;))) {
+                                                for (x_var = switch_xml_child(x_vars, &quot;variable&quot;); x_var; x_var = x_var-&gt;next) {
+                                                        const char *var = switch_xml_attr_soft(x_var, &quot;name&quot;);
+                                                        const char *val = switch_xml_attr_soft(x_var, &quot;value&quot;);
+                                                        if (!strcasecmp(var, &quot;effective_caller_id_name&quot;)) {
+                                                                caller_name = switch_core_session_strdup(session, val);
+                                                        }
+                                                        if (!strcasecmp(var, &quot;directory_full_name&quot;)) {
+                                                                caller_name_override = switch_core_session_strdup(session, val);
+                                                        }
+                                                }
+                                        }
+                                        if (caller_name_override) {
+                                                fullName = caller_name_override;
+                                        } else {
+                                                fullName = caller_name;
+                                        }
+                                        if (switch_strlen_zero(fullName)) {
+                                                continue;
+                                        }
+                                        firstName = switch_core_session_strdup(session, fullName);
+
+                                        if ((lastName = strrchr(firstName, ' '))) {
+                                                *lastName++ = '\0';
+                                        } else {
+                                                lastName = switch_core_session_strdup(session, firstName);
+                                        }
+
+                                        /* switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, &quot;FullName %s firstName [%s] lastName [%s]\n&quot;, fullName, firstName, lastName); */
+
+                                        /* Generate Digits key mapping */
+                                        fullNameDigit = string_to_keypad_digit(fullName);
+                                        lastNameDigit = string_to_keypad_digit(lastName);
+                                        firstNameDigit = string_to_keypad_digit(firstName);
+
+                                        /* add user into DB */
+                                        sql = switch_mprintf(&quot;insert into directory_search values('%q','%q','%q','%q','%q','%q','%q','%q','%q','%d','%d')&quot;, 
+                                                        globals.hostname, switch_core_session_get_uuid(session), id, fullName, fullNameDigit, firstName, firstNameDigit, lastName, lastNameDigit, name_visible, exten_visible);
+
+                                        if (sqlvalues) {
+                                                sqltmp = sqlvalues;
+                                                sqlvalues = switch_mprintf(&quot;%s;%s&quot;, sqlvalues, sql);
+                                                switch_safe_free(sqltmp);
+                                        } else {
+                                                sqlvalues = sql;
+                                                sql = NULL;
+                                        }
+                                        switch_safe_free(sql);
+                                        switch_safe_free(fullNameDigit);
+                                        switch_safe_free(lastNameDigit);
+                                        switch_safe_free(firstNameDigit);
+                                }
+                        }
+                }
+        }
+        sql = switch_mprintf(&quot;BEGIN;%s;COMMIT;&quot;,sqlvalues);
+        directory_execute_sql(sql, profile-&gt;mutex);
+
+end:
+        switch_safe_free(sql);
+        switch_safe_free(sqlvalues);
+        switch_event_destroy(&amp;xml_params);
+        switch_xml_free(xml_root);
+
+        return status;
+}
+
+struct cb_result {
+        char digits[255];
+        char digit;
+        dir_profile_t *profile;
+};
+
+typedef struct cb_result cbr_t;
+
+static switch_status_t 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;
+                                cbr_t *cbr = (cbr_t *) buf;
+                                cbr-&gt;digit = dtmf-&gt;digit;
+                                if (dtmf-&gt;digit == *cbr-&gt;profile-&gt;terminator_key || dtmf-&gt;digit == *cbr-&gt;profile-&gt;switch_order_key) {
+                                        return SWITCH_STATUS_BREAK;
+                                }
+
+                                if (strlen(cbr-&gt;digits) &lt; sizeof(cbr-&gt;digits) - 2) {
+                                        int at = strlen(cbr-&gt;digits);
+                                        cbr-&gt;digits[at++] = dtmf-&gt;digit;
+                                        cbr-&gt;digits[at] = '\0';
+                                } else {
+                                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, &quot;DTMF buffer is full\n&quot;);
+                                        return SWITCH_STATUS_BREAK;
+                                }
+                        }
+                        break;
+                default:
+                        break;
+        }
+
+        return SWITCH_STATUS_BREAK;
+}
+
+static switch_status_t listen_entry(switch_core_session_t *session, dir_profile_t *profile, listing_callback_t *cbt)
+{
+        char buf[2] = &quot;&quot;;
+        char macro[256] = &quot;&quot;;
+        char recorded_name[256] = &quot;&quot;;
+
+        /* Try to use the recorded name from voicemail if it exist */
+        if (switch_loadable_module_exists(&quot;mod_voicemail&quot;) == SWITCH_STATUS_SUCCESS) {
+                char *cmd = NULL;
+                switch_stream_handle_t stream = { 0 };
+                SWITCH_STANDARD_STREAM(stream);
+
+                cmd = switch_core_session_sprintf(session, &quot;%s/%s@%s|name_path&quot;, cbt-&gt;params-&gt;profile, cbt-&gt;extension, cbt-&gt;params-&gt;domain);
+                switch_api_execute(&quot;vm_prefs&quot;, cmd, session, &amp;stream);
+                if (strncmp(&quot;-ERR&quot;, stream.data, 4)) {
+                        switch_copy_string(recorded_name, (char *) stream.data, sizeof(recorded_name));
+                }
+                switch_safe_free(stream.data);
+        }
+
+        if (switch_strlen_zero(buf)) {
+                switch_snprintf(macro, sizeof(macro), &quot;phrase:%s:%d&quot;, DIR_RESULT_ITEM, cbt-&gt;want+1);
+                switch_ivr_read(session, 0, 1, macro, NULL, buf, sizeof(buf), 1, profile-&gt;terminator_key);
+        }
+
+        if (!switch_strlen_zero(recorded_name) &amp;&amp; switch_strlen_zero(buf)) {
+        switch_ivr_read(session, 0, 1, recorded_name, NULL, buf, sizeof(buf), 1, profile-&gt;terminator_key);
+
+        }
+        if (switch_strlen_zero(recorded_name) &amp;&amp; switch_strlen_zero(buf)) {
+                switch_snprintf(macro, sizeof(macro), &quot;phrase:%s:%s&quot;, DIR_RESULT_SAY_NAME, cbt-&gt;fullname);
+                switch_ivr_read(session, 0, 1, macro, NULL, buf, sizeof(buf), 1, profile-&gt;terminator_key);
+        }
+        if (cbt-&gt;exten_visible &amp;&amp; switch_strlen_zero(buf)) {
+                switch_snprintf(macro, sizeof(macro), &quot;phrase:%s:%s&quot;, DIR_RESULT_AT, cbt-&gt;extension);
+                switch_ivr_read(session, 0, 1, macro, NULL, buf, sizeof(buf), 1, profile-&gt;terminator_key);
+        }
+        if (switch_strlen_zero(buf)) {
+                switch_snprintf(macro, sizeof(macro), &quot;phrase:%s:%c,%c,%c,%c&quot;, DIR_RESULT_MENU, *profile-&gt;select_name_key, *profile-&gt;next_key, *profile-&gt;prev_key, *profile-&gt;new_search_key);
+                switch_ivr_read(session, 0, 1, macro, NULL, buf, sizeof(buf), profile-&gt;digit_timeout, profile-&gt;terminator_key);
+        }
+
+        if (!switch_strlen_zero(buf)) {
+                if (buf[0] == *profile-&gt;select_name_key) {
+                        switch_copy_string(cbt-&gt;transfer_to, cbt-&gt;extension, 255);
+                }
+                if (buf[0] == *profile-&gt;new_search_key) {
+                        cbt-&gt;new_search = 1;
+                }
+                if (buf[0] == *profile-&gt;prev_key) {
+                        cbt-&gt;move = ENTRY_MOVE_PREV;
+                }
+        } else {
+                return SWITCH_STATUS_TIMEOUT;
+        }
+
+        return SWITCH_STATUS_SUCCESS;
+}
+
+switch_status_t gather_name_digit(switch_core_session_t *session, dir_profile_t *profile, search_params_t *params) {
+        switch_channel_t *channel = switch_core_session_get_channel(session);
+        switch_status_t status = SWITCH_STATUS_SUCCESS;
+        cbr_t cbr;
+        int loop = 1;
+
+        switch_input_args_t args = { 0 };
+        args.input_callback = on_dtmf;
+        args.buf = &amp;cbr;
+
+        while (switch_channel_ready(channel) &amp;&amp; loop) {
+                char macro[255];
+                loop = 0;
+                memset(&amp;cbr, 0, sizeof(cbr));
+                cbr.profile = profile;
+                params-&gt;timeout = 0;
+
+                /* Gather the user Name */
+
+                switch_snprintf(macro, sizeof(macro), &quot;%s:%c&quot;, (params-&gt;search_by_last_name?&quot;last_name&quot;:&quot;first_name&quot;), *profile-&gt;switch_order_key);
+                switch_ivr_phrase_macro(session, DIR_INTRO, macro, NULL, &amp;args);
+
+                while (switch_channel_ready(channel)) {
+                        if (cbr.digit == *profile-&gt;terminator_key) {
+                                status = SWITCH_STATUS_BREAK;
+                                break;
+                        }
+                        if (cbr.digit == *profile-&gt;switch_order_key) {
+                                if (params-&gt;search_by_last_name) {
+                                        params-&gt;search_by_last_name = 0;
+                                } else {
+                                        params-&gt;search_by_last_name = 1;
+                                }
+                                loop = 1;
+                                break;
+                        }
+
+                        if (switch_ivr_collect_digits_callback(session, &amp;args, profile-&gt;digit_timeout, 0) == SWITCH_STATUS_TIMEOUT) {
+                                params-&gt;timeout = 1;
+                                break;
+                        }
+
+                }
+        }
+        switch_copy_string(params-&gt;digits, cbr.digits, 255);
+
+        return status;
+}
+
+switch_status_t navigate_entrys(switch_core_session_t *session, dir_profile_t *profile, search_params_t *params) {
+        switch_status_t status = SWITCH_STATUS_SUCCESS;
+        char *sql = NULL;
+        char entry_count[80] = &quot;&quot;;
+        callback_t cbt = { 0 };
+        int result_count;
+        char macro[256] = &quot;&quot;;
+        listing_callback_t listing_cbt;
+        int cur_entry = 0;
+        cbt.buf = entry_count;
+        cbt.len = sizeof(entry_count);
+
+        sql = switch_mprintf(&quot;select count(*) from directory_search where hostname = '%q' and uuid = '%q' and name_visible = 1 and %s like '%q%%'&quot;, globals.hostname, switch_core_session_get_uuid(session), (params-&gt;search_by_last_name?&quot;last_name_digit&quot;:&quot;first_name_digit&quot;), params-&gt;digits);
+
+        directory_execute_sql_callback(profile-&gt;mutex, sql, sql2str_callback, &amp;cbt);
+        switch_safe_free(sql);
+
+        result_count = atoi(entry_count);
+
+        if (result_count == 0) {
+                switch_snprintf(macro, sizeof(macro), &quot;%d&quot;, result_count);
+                switch_ivr_phrase_macro(session, DIR_RESULT_COUNT, macro, NULL, NULL);
+                params-&gt;try_again = 1;
+                return SWITCH_STATUS_BREAK;
+        } else if (profile-&gt;max_result != 0 &amp;&amp; result_count &gt; profile-&gt;max_result) {
+                switch_ivr_phrase_macro(session, DIR_RESULT_COUNT_TOO_LARGE, NULL, NULL, NULL);
+                params-&gt;try_again = 1;
+                return SWITCH_STATUS_BREAK;
+        } else {
+                switch_snprintf(macro, sizeof(macro), &quot;%d&quot;, result_count);
+                switch_ivr_phrase_macro(session, DIR_RESULT_COUNT, macro, NULL, NULL);
+        }
+
+        memset(&amp;listing_cbt, 0, sizeof(listing_cbt));
+        listing_cbt.params = params;
+
+        sql = switch_mprintf(&quot;select extension, full_name, last_name, first_name, name_visible, exten_visible from directory_search where hostname = '%q' and uuid = '%q' and name_visible = 1 and %s like '%q%%' order by last_name, first_name&quot;, globals.hostname, switch_core_session_get_uuid(session), (params-&gt;search_by_last_name?&quot;last_name_digit&quot;:&quot;first_name_digit&quot;), params-&gt;digits);
+
+        for (cur_entry = 0; cur_entry &lt; result_count; cur_entry++) {
+                listing_cbt.index = 0;
+                listing_cbt.want = cur_entry;
+                listing_cbt.move = ENTRY_MOVE_NEXT;
+                directory_execute_sql_callback(profile-&gt;mutex, sql, listing_callback, &amp;listing_cbt);
+                status = listen_entry(session, profile, &amp;listing_cbt);
+                if (!switch_strlen_zero(listing_cbt.transfer_to)) {
+                        switch_copy_string(params-&gt;transfer_to, listing_cbt.transfer_to, 255);
+                        break;
+                }
+                if (listing_cbt.new_search) {
+                        params-&gt;try_again = 1;
+                        goto end;
+
+                }
+                if (listing_cbt.move == ENTRY_MOVE_NEXT) {
+                        if (cur_entry == result_count - 1) {
+                                switch_snprintf(macro, sizeof(macro), &quot;%d&quot;, result_count);
+                                switch_ivr_phrase_macro(session, DIR_RESULT_LAST, macro, NULL, NULL);
+                                cur_entry -= 1;
+                        }
+                }
+                if (listing_cbt.move == ENTRY_MOVE_PREV) {
+                        if (cur_entry &lt;= 0) {
+                                cur_entry = -1;
+                        } else {
+                                cur_entry -= 2;
+                        }
+                }
+                if (status == SWITCH_STATUS_TIMEOUT) {
+                        goto end;
+                }
+                if (status != SWITCH_STATUS_SUCCESS &amp;&amp; status != SWITCH_STATUS_BREAK) {
+                        goto end;
+                }
+        }
+
+end:
+        switch_safe_free(sql);
+        return status;
+
+}
+
+SWITCH_STANDARD_APP(directory_function)
+{
+        switch_channel_t *channel = switch_core_session_get_channel(session);
+        int argc = 0;
+        char *argv[6] = { 0 };
+        char *mydata = NULL;
+        const char *profile_name = NULL;
+        const char *domain_name = NULL; 
+        dir_profile_t * profile = NULL;
+        int x = 0;
+        char *sql = NULL;
+        search_params_t s_param;
+        int attempts = 3;
+        char macro[255];
+
+        if (!switch_strlen_zero(data)) {
+                mydata = switch_core_session_strdup(session, data);
+                argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
+        }
+        if (argv[x]) {
+                profile_name = argv[x++];
+        }
+
+        if (argv[x]) {
+                domain_name = argv[x++];
+        }
+
+
+        if (!(profile = get_profile(profile_name))) {
+                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, &quot;Error invalid profile %s\n&quot;, profile_name);
+                goto end;
+        }
+
+        populate_database(session, profile, domain_name);
+
+        memset(&amp;s_param, 0, sizeof(s_param));
+        s_param.search_by_last_name = 1;
+        s_param.try_again = 1;
+        switch_copy_string(s_param.profile, profile_name, 255);
+        switch_copy_string(s_param.domain, domain_name, 255);
+
+        if (strcasecmp(profile-&gt;search_order, &quot;last_name&quot;)) {
+                s_param.search_by_last_name = 0;
+        }
+        attempts = profile-&gt;max_menu_attempt;
+        s_param.try_again = 1;        
+        while (switch_channel_ready(channel) &amp;&amp; (s_param.try_again &amp;&amp; attempts-- &gt; 0)) {
+                s_param.try_again = 0;
+                gather_name_digit(session, profile, &amp;s_param);
+
+                if (switch_strlen_zero(s_param.digits)) {
+                        s_param.try_again = 1;
+                        continue;
+                }
+
+                if (strlen(s_param.digits) &lt; profile-&gt;min_search_digits) {
+                        switch_snprintf(macro, sizeof(macro), &quot;%d&quot;, profile-&gt;min_search_digits);
+                        switch_ivr_phrase_macro(session, DIR_MIN_SEARCH_DIGITS, macro, NULL, NULL);
+                        s_param.try_again = 1;
+                        continue;
+                }
+
+                navigate_entrys(session, profile, &amp;s_param);
+        }
+
+        if (!switch_strlen_zero(s_param.transfer_to)) {
+                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, &quot;Directory transfering call to : %s\n&quot;, s_param.transfer_to);
+                switch_ivr_session_transfer(session, s_param.transfer_to, &quot;XML&quot;, domain_name);
+        }
+
+end:
+        /* Delete all sql entry for this call */
+        sql = switch_mprintf(&quot;delete from directory_search where hostname = '%q' and uuid = '%q'&quot;, globals.hostname, switch_core_session_get_uuid(session));
+        directory_execute_sql(sql, profile-&gt;mutex);
+        switch_safe_free(sql);
+
+
+        profile_rwunlock(profile);
+
+}
+
+SWITCH_MODULE_LOAD_FUNCTION(mod_directory_load)
+{
+        switch_application_interface_t *app_interface;
+        switch_status_t status;
+        switch_core_db_t *db = NULL;
+        char *sql = NULL;
+
+        memset(&amp;globals, 0, sizeof(globals));
+        globals.pool = pool;
+
+        switch_core_hash_init(&amp;globals.profile_hash, globals.pool);
+        switch_mutex_init(&amp;globals.mutex, SWITCH_MUTEX_NESTED, globals.pool);
+
+        if ((status = load_config(SWITCH_FALSE)) != SWITCH_STATUS_SUCCESS) {
+                return status;
+        }
+
+        /* connect my internal structure to the blank pointer passed to me */
+        *module_interface = switch_loadable_module_create_module_interface(pool, modname);
+
+        gethostname(globals.hostname, sizeof(globals.hostname));
+
+        globals.dbname = switch_core_sprintf(pool, &quot;directory&quot;);
+
+        if ((db = switch_core_db_open_file(globals.dbname))) {
+                switch_core_db_test_reactive(db, &quot;select count(uuid),name_visible from directory_search&quot;, &quot;drop table directory_search&quot;, dir_sql);
+                switch_core_db_close(db);
+        } else {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, &quot;Failed to open db name : %s\n&quot;, globals.dbname);
+                return SWITCH_STATUS_FALSE;
+
+        }
+
+        sql = switch_mprintf(&quot;delete from directory_search where hostname = '%q'&quot;, globals.hostname);
+        directory_execute_sql(sql, globals.mutex);
+        switch_safe_free(sql);
+
+        SWITCH_ADD_APP(app_interface, &quot;directory&quot;, &quot;directory&quot;, DIR_DESC, directory_function, DIR_USAGE, SAF_NONE);
+
+        /* indicate that the module should continue to be loaded */
+        return SWITCH_STATUS_SUCCESS;
+}
+
+/*
+   Called when the system shuts down
+   Macro expands to: switch_status_t mod_directory_shutdown() */
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_directory_shutdown)
+{
+        switch_hash_index_t *hi;
+        dir_profile_t *profile;
+        void *val = NULL;
+        const void *key;
+        switch_ssize_t keylen;
+        char *sql = NULL;
+
+        switch_mutex_lock(globals.mutex);
+
+        while((hi = switch_hash_first(NULL, globals.profile_hash))) {
+                switch_hash_this(hi, &amp;key, &amp;keylen, &amp;val);
+                profile = (dir_profile_t *) val;
+
+                switch_core_hash_delete(globals.profile_hash, profile-&gt;name);
+
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, &quot;Waiting for write lock (Profile %s)\n&quot;, profile-&gt;name);
+                switch_thread_rwlock_wrlock(profile-&gt;rwlock);
+
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, &quot;Destroying Profile %s\n&quot;, profile-&gt;name);
+                switch_core_destroy_memory_pool(&amp;profile-&gt;pool);
+                profile = NULL;
+        }
+
+        sql = switch_mprintf(&quot;delete from directory_search where hostname = '%q'&quot;, globals.hostname);
+        directory_execute_sql(sql, globals.mutex);
+        switch_safe_free(sql);
+
+        switch_mutex_unlock(globals.mutex);
+        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="freeswitchtrunksrcmodapplicationsmod_directorymod_directoryvcproj"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/src/mod/applications/mod_directory/mod_directory.vcproj (0 => 14984)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/applications/mod_directory/mod_directory.vcproj                                (rev 0)
+++ freeswitch/trunk/src/mod/applications/mod_directory/mod_directory.vcproj        2009-09-25 19:48:46 UTC (rev 14984)
</span><span class="lines">@@ -0,0 +1,153 @@
</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_directory&quot;
+        ProjectGUID=&quot;{75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD}&quot;
+        RootNamespace=&quot;mod_directory&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\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;
+                        /&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\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;
+                        /&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_directory.c&quot;
+                        &gt;
+                &lt;/File&gt;
+        &lt;/Files&gt;
+        &lt;Globals&gt;
+        &lt;/Globals&gt;
+&lt;/VisualStudioProject&gt;
</ins></span></pre>
</div>
</div>
<div id="footer">See you at ClueCon</div>

</body>
</html>