<!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][14981] </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=14981">14981</a></dd>
<dt>Author</dt> <dd>brian</dd>
<dt>Date</dt> <dd>2009-09-25 14:07:20 -0500 (Fri, 25 Sep 2009)</dd>
</dl>

<h3>Log Message</h3>
<pre> <a href="http://jira.freeswitch.org/browse/MODAPP-325">MODAPP-325</a> part 1 </pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#freeswitchtrunksrcincludeswitch_cpph">freeswitch/trunk/src/include/switch_cpp.h</a></li>
<li><a href="#freeswitchtrunksrcincludeswitch_ivrh">freeswitch/trunk/src/include/switch_ivr.h</a></li>
<li><a href="#freeswitchtrunksrcmodapplicationsmod_fifomod_fifoc">freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c</a></li>
<li><a href="#freeswitchtrunksrcmodlanguagesmod_managedfreeswitch_wrapcxx">freeswitch/trunk/src/mod/languages/mod_managed/freeswitch_wrap.cxx</a></li>
<li><a href="#freeswitchtrunksrcmodlanguagesmod_managedmanagedswigcs">freeswitch/trunk/src/mod/languages/mod_managed/managed/swig.cs</a></li>
<li><a href="#freeswitchtrunksrcmodlanguagesmod_spidermonkeymod_spidermonkeyc">freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c</a></li>
<li><a href="#freeswitchtrunksrcswitch_cppcpp">freeswitch/trunk/src/switch_cpp.cpp</a></li>
<li><a href="#freeswitchtrunksrcswitch_ivrc">freeswitch/trunk/src/switch_ivr.c</a></li>
<li><a href="#freeswitchtrunksrcswitch_ivr_play_sayc">freeswitch/trunk/src/switch_ivr_play_say.c</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="freeswitchtrunksrcincludeswitch_cpph"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/include/switch_cpp.h (14980 => 14981)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/include/switch_cpp.h        2009-09-25 18:26:47 UTC (rev 14980)
+++ freeswitch/trunk/src/include/switch_cpp.h        2009-09-25 19:07:20 UTC (rev 14981)
</span><span class="lines">@@ -286,7 +286,8 @@
</span><span class="cx">          * For timeout milliseconds, call the dtmf function set previously
</span><span class="cx">          * by setDTMFCallback whenever a dtmf or event is received
</span><span class="cx">          */
</span><del>-                 SWITCH_DECLARE(int) collectDigits(int timeout);
</del><ins>+                 SWITCH_DECLARE(int) collectDigits(int abs_timeout);
+                 SWITCH_DECLARE(int) collectDigits(int digit_timeout, int abs_timeout);
</ins><span class="cx"> 
</span><span class="cx">         /** 
</span><span class="cx">          * Collect up to maxdigits digits worth of digits
</span></span></pre></div>
<a id="freeswitchtrunksrcincludeswitch_ivrh"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/include/switch_ivr.h (14980 => 14981)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/include/switch_ivr.h        2009-09-25 18:26:47 UTC (rev 14980)
+++ freeswitch/trunk/src/include/switch_ivr.h        2009-09-25 19:07:20 UTC (rev 14981)
</span><span class="lines">@@ -122,7 +122,7 @@
</span><span class="cx">   \param timeout a timeout in milliseconds
</span><span class="cx">   \return SWITCH_STATUS_SUCCESS to keep the collection moving.
</span><span class="cx"> */
</span><del>-SWITCH_DECLARE(switch_status_t) switch_ivr_collect_digits_callback(switch_core_session_t *session, switch_input_args_t *args, uint32_t timeout);
</del><ins>+SWITCH_DECLARE(switch_status_t) switch_ivr_collect_digits_callback(switch_core_session_t *session, switch_input_args_t *args, uint32_t digit_timeout, uint32_t abs_timeout);
</ins><span class="cx"> 
</span><span class="cx"> /*!
</span><span class="cx">   \brief Wait for specified number of DTMF digits, untile terminator is received or until the channel hangs up.
</span></span></pre></div>
<a id="freeswitchtrunksrcmodapplicationsmod_fifomod_fifoc"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c (14980 => 14981)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c        2009-09-25 18:26:47 UTC (rev 14980)
+++ freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c        2009-09-25 19:07:20 UTC (rev 14981)
</span><span class="lines">@@ -1011,7 +1011,7 @@
</span><span class="cx">                                         goto abort;
</span><span class="cx">                                 }
</span><span class="cx">                         } else {
</span><del>-                                switch_ivr_collect_digits_callback(session, &amp;args, 0);
</del><ins>+                                switch_ivr_collect_digits_callback(session, &amp;args, 0, 0);
</ins><span class="cx">                         }
</span><span class="cx"> 
</span><span class="cx">                         if (caller_exit_key &amp;&amp; *buf == *caller_exit_key) {
</span></span></pre></div>
<a id="freeswitchtrunksrcmodlanguagesmod_managedfreeswitch_wrapcxx"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/languages/mod_managed/freeswitch_wrap.cxx (14980 => 14981)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/languages/mod_managed/freeswitch_wrap.cxx        2009-09-25 18:26:47 UTC (rev 14980)
+++ freeswitch/trunk/src/mod/languages/mod_managed/freeswitch_wrap.cxx        2009-09-25 19:07:20 UTC (rev 14981)
</span><span class="lines">@@ -22136,17 +22136,19 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_collect_digits_callback(void * jarg1, void * jarg2, unsigned long jarg3) {
</del><ins>+SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_collect_digits_callback(void * jarg1, void * jarg2, unsigned long jarg3, unsigned long jarg4) {
</ins><span class="cx">   int jresult ;
</span><span class="cx">   switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
</span><span class="cx">   switch_input_args_t *arg2 = (switch_input_args_t *) 0 ;
</span><span class="cx">   uint32_t arg3 ;
</span><ins>+  uint32_t arg4 ;
</ins><span class="cx">   switch_status_t result;
</span><span class="cx">   
</span><span class="cx">   arg1 = (switch_core_session_t *)jarg1; 
</span><span class="cx">   arg2 = (switch_input_args_t *)jarg2; 
</span><span class="cx">   arg3 = (uint32_t)jarg3; 
</span><del>-  result = (switch_status_t)switch_ivr_collect_digits_callback(arg1,arg2,arg3);
</del><ins>+  arg4 = (uint32_t)jarg4; 
+  result = (switch_status_t)switch_ivr_collect_digits_callback(arg1,arg2,arg3,arg4);
</ins><span class="cx">   jresult = result; 
</span><span class="cx">   return jresult;
</span><span class="cx"> }
</span><span class="lines">@@ -28912,7 +28914,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-SWIGEXPORT int SWIGSTDCALL CSharp_CoreSession_CollectDigits(void * jarg1, int jarg2) {
</del><ins>+SWIGEXPORT int SWIGSTDCALL CSharp_CoreSession_CollectDigits__SWIG_0(void * jarg1, int jarg2) {
</ins><span class="cx">   int jresult ;
</span><span class="cx">   CoreSession *arg1 = (CoreSession *) 0 ;
</span><span class="cx">   int arg2 ;
</span><span class="lines">@@ -28926,6 +28928,22 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> 
</span><ins>+SWIGEXPORT int SWIGSTDCALL CSharp_CoreSession_CollectDigits__SWIG_1(void * jarg1, int jarg2, int jarg3) {
+  int jresult ;
+  CoreSession *arg1 = (CoreSession *) 0 ;
+  int arg2 ;
+  int arg3 ;
+  int result;
+  
+  arg1 = (CoreSession *)jarg1; 
+  arg2 = (int)jarg2; 
+  arg3 = (int)jarg3; 
+  result = (int)(arg1)-&gt;collectDigits(arg2,arg3);
+  jresult = result; 
+  return jresult;
+}
+
+
</ins><span class="cx"> SWIGEXPORT char * SWIGSTDCALL CSharp_CoreSession_GetDigits__SWIG_0(void * jarg1, int jarg2, char * jarg3, int jarg4) {
</span><span class="cx">   char * jresult ;
</span><span class="cx">   CoreSession *arg1 = (CoreSession *) 0 ;
</span></span></pre></div>
<a id="freeswitchtrunksrcmodlanguagesmod_managedmanagedswigcs"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/languages/mod_managed/managed/swig.cs (14980 => 14981)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/languages/mod_managed/managed/swig.cs        2009-09-25 18:26:47 UTC (rev 14980)
+++ freeswitch/trunk/src/mod/languages/mod_managed/managed/swig.cs        2009-09-25 19:07:20 UTC (rev 14981)
</span><span class="lines">@@ -282,11 +282,16 @@
</span><span class="cx">     freeswitchPINVOKE.CoreSession_SetTtsParameters(swigCPtr, tts_name, voice_name);
</span><span class="cx">   }
</span><span class="cx"> 
</span><del>-  public int CollectDigits(int timeout) {
-    int ret = freeswitchPINVOKE.CoreSession_CollectDigits(swigCPtr, timeout);
</del><ins>+  public int CollectDigits(int abs_timeout) {
+    int ret = freeswitchPINVOKE.CoreSession_CollectDigits__SWIG_0(swigCPtr, abs_timeout);
</ins><span class="cx">     return ret;
</span><span class="cx">   }
</span><span class="cx"> 
</span><ins>+  public int CollectDigits(int digit_timeout, int abs_timeout) {
+    int ret = freeswitchPINVOKE.CoreSession_CollectDigits__SWIG_1(swigCPtr, digit_timeout, abs_timeout);
+    return ret;
+  }
+
</ins><span class="cx">   public string GetDigits(int maxdigits, string terminators, int timeout) {
</span><span class="cx">     string ret = freeswitchPINVOKE.CoreSession_GetDigits__SWIG_0(swigCPtr, maxdigits, terminators, timeout);
</span><span class="cx">     return ret;
</span><span class="lines">@@ -3178,8 +3183,8 @@
</span><span class="cx">     return ret;
</span><span class="cx">   }
</span><span class="cx"> 
</span><del>-  public static switch_status_t switch_ivr_collect_digits_callback(SWIGTYPE_p_switch_core_session session, switch_input_args_t args, uint timeout) {
-    switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_collect_digits_callback(SWIGTYPE_p_switch_core_session.getCPtr(session), switch_input_args_t.getCPtr(args), timeout);
</del><ins>+  public static switch_status_t switch_ivr_collect_digits_callback(SWIGTYPE_p_switch_core_session session, switch_input_args_t args, uint digit_timeout, uint abs_timeout) {
+    switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_collect_digits_callback(SWIGTYPE_p_switch_core_session.getCPtr(session), switch_input_args_t.getCPtr(args), digit_timeout, abs_timeout);
</ins><span class="cx">     return ret;
</span><span class="cx">   }
</span><span class="cx"> 
</span><span class="lines">@@ -9901,7 +9906,7 @@
</span><span class="cx">   public static extern int switch_ivr_park(HandleRef jarg1, HandleRef jarg2);
</span><span class="cx"> 
</span><span class="cx">   [DllImport(&quot;mod_managed&quot;, EntryPoint=&quot;CSharp_switch_ivr_collect_digits_callback&quot;)]
</span><del>-  public static extern int switch_ivr_collect_digits_callback(HandleRef jarg1, HandleRef jarg2, uint jarg3);
</del><ins>+  public static extern int switch_ivr_collect_digits_callback(HandleRef jarg1, HandleRef jarg2, uint jarg3, uint jarg4);
</ins><span class="cx"> 
</span><span class="cx">   [DllImport(&quot;mod_managed&quot;, EntryPoint=&quot;CSharp_switch_ivr_collect_digits_count&quot;)]
</span><span class="cx">   public static extern int switch_ivr_collect_digits_count(HandleRef jarg1, string jarg2, HandleRef jarg3, HandleRef jarg4, string jarg5, string jarg6, uint jarg7, uint jarg8, uint jarg9);
</span><span class="lines">@@ -11430,9 +11435,12 @@
</span><span class="cx">   [DllImport(&quot;mod_managed&quot;, EntryPoint=&quot;CSharp_CoreSession_SetTtsParameters&quot;)]
</span><span class="cx">   public static extern void CoreSession_SetTtsParameters(HandleRef jarg1, string jarg2, string jarg3);
</span><span class="cx"> 
</span><del>-  [DllImport(&quot;mod_managed&quot;, EntryPoint=&quot;CSharp_CoreSession_CollectDigits&quot;)]
-  public static extern int CoreSession_CollectDigits(HandleRef jarg1, int jarg2);
</del><ins>+  [DllImport(&quot;mod_managed&quot;, EntryPoint=&quot;CSharp_CoreSession_CollectDigits__SWIG_0&quot;)]
+  public static extern int CoreSession_CollectDigits__SWIG_0(HandleRef jarg1, int jarg2);
</ins><span class="cx"> 
</span><ins>+  [DllImport(&quot;mod_managed&quot;, EntryPoint=&quot;CSharp_CoreSession_CollectDigits__SWIG_1&quot;)]
+  public static extern int CoreSession_CollectDigits__SWIG_1(HandleRef jarg1, int jarg2, int jarg3);
+
</ins><span class="cx">   [DllImport(&quot;mod_managed&quot;, EntryPoint=&quot;CSharp_CoreSession_GetDigits__SWIG_0&quot;)]
</span><span class="cx">   public static extern string CoreSession_GetDigits__SWIG_0(HandleRef jarg1, int jarg2, string jarg3, int jarg4);
</span><span class="cx"> 
</span></span></pre></div>
<a id="freeswitchtrunksrcmodlanguagesmod_spidermonkeymod_spidermonkeyc"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c (14980 => 14981)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c        2009-09-25 18:26:47 UTC (rev 14980)
+++ freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c        2009-09-25 19:07:20 UTC (rev 14981)
</span><span class="lines">@@ -1463,7 +1463,9 @@
</span><span class="cx">         switch_channel_t *channel;
</span><span class="cx">         void *bp = NULL;
</span><span class="cx">         int len = 0;
</span><del>-        int32 to = 0;
</del><ins>+        int32 abs_timeout = 0;
+        int32 digit_timeout = 0;
+
</ins><span class="cx">         switch_input_callback_function_t dtmf_func = NULL;
</span><span class="cx">         struct input_callback_state cb_state = { 0 };
</span><span class="cx">         JSFunction *function;
</span><span class="lines">@@ -1494,8 +1496,11 @@
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if (argc &gt; 2) {
-                JS_ValueToInt32(jss-&gt;cx, argv[2], &amp;to);
</del><ins>+        if (argc == 3) {
+                JS_ValueToInt32(jss-&gt;cx, argv[2], &amp;abs_timeout);
+        } else if (argc &gt; 3) {
+                JS_ValueToInt32(jss-&gt;cx, argv[2], &amp;digit_timeout);
+                JS_ValueToInt32(jss-&gt;cx, argv[3], &amp;abs_timeout);
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         cb_state.saveDepth = JS_SuspendRequest(cx);
</span><span class="lines">@@ -1503,7 +1508,7 @@
</span><span class="cx">         args.buf = bp;
</span><span class="cx">         args.buflen = len;
</span><span class="cx"> 
</span><del>-        switch_ivr_collect_digits_callback(jss-&gt;session, &amp;args, to);
</del><ins>+        switch_ivr_collect_digits_callback(jss-&gt;session, &amp;args, digit_timeout, abs_timeout);
</ins><span class="cx">         JS_ResumeRequest(cx, cb_state.saveDepth);
</span><span class="cx">         check_hangup_hook(jss, &amp;ret);
</span><span class="cx">         *rval = cb_state.ret;
</span></span></pre></div>
<a id="freeswitchtrunksrcswitch_cppcpp"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/switch_cpp.cpp (14980 => 14981)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/switch_cpp.cpp        2009-09-25 18:26:47 UTC (rev 14980)
+++ freeswitch/trunk/src/switch_cpp.cpp        2009-09-25 19:07:20 UTC (rev 14981)
</span><span class="lines">@@ -684,11 +684,15 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-SWITCH_DECLARE(int) CoreSession::collectDigits(int timeout) {
</del><ins>+SWITCH_DECLARE(int) CoreSession::collectDigits(int abs_timeout) {
+        return collectDigits(0, abs_timeout);
+}
+
+SWITCH_DECLARE(int) CoreSession::collectDigits(int digit_timeout, int abs_timeout) {
</ins><span class="cx">         this_check(-1);
</span><span class="cx">         sanity_check(-1);
</span><span class="cx">     begin_allow_threads();
</span><del>-        switch_ivr_collect_digits_callback(session, ap, timeout);
</del><ins>+        switch_ivr_collect_digits_callback(session, ap, digit_timeout, abs_timeout);
</ins><span class="cx">     end_allow_threads();
</span><span class="cx">     return SWITCH_STATUS_SUCCESS;
</span><span class="cx"> } 
</span></span></pre></div>
<a id="freeswitchtrunksrcswitch_ivrc"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/switch_ivr.c (14980 => 14981)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/switch_ivr.c        2009-09-25 18:26:47 UTC (rev 14980)
+++ freeswitch/trunk/src/switch_ivr.c        2009-09-25 19:07:20 UTC (rev 14981)
</span><span class="lines">@@ -815,21 +815,23 @@
</span><span class="cx">         return status;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-SWITCH_DECLARE(switch_status_t) switch_ivr_collect_digits_callback(switch_core_session_t *session, switch_input_args_t *args, uint32_t timeout)
</del><ins>+SWITCH_DECLARE(switch_status_t) switch_ivr_collect_digits_callback(switch_core_session_t *session, switch_input_args_t *args, uint32_t digit_timeout, uint32_t abs_timeout)
</ins><span class="cx"> {
</span><span class="cx">         switch_channel_t *channel = switch_core_session_get_channel(session);
</span><span class="cx">         switch_status_t status = SWITCH_STATUS_SUCCESS;
</span><del>-        switch_time_t started = 0;
-        uint32_t elapsed;
</del><ins>+        switch_time_t abs_started = 0, digit_started = 0;
+        uint32_t abs_elapsed = 0, digit_elapsed = 0;
</ins><span class="cx"> 
</span><span class="cx">         if (!args || !args-&gt;input_callback) {
</span><span class="cx">                 return SWITCH_STATUS_GENERR;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if (timeout) {
-                started = switch_micro_time_now();
</del><ins>+        if (abs_timeout) {
+                abs_started = switch_micro_time_now();
</ins><span class="cx">         }
</span><del>-
</del><ins>+        if (digit_timeout) {
+                digit_started = switch_micro_time_now();
+        }
</ins><span class="cx">         while (switch_channel_ready(channel)) {
</span><span class="cx">                 switch_frame_t *read_frame = NULL;
</span><span class="cx">                 switch_event_t *event;
</span><span class="lines">@@ -841,12 +843,20 @@
</span><span class="cx">                         break;
</span><span class="cx">                 }
</span><span class="cx"> 
</span><del>-                if (timeout) {
-                        elapsed = (uint32_t) ((switch_micro_time_now() - started) / 1000);
-                        if (elapsed &gt;= timeout) {
</del><ins>+                if (abs_timeout) {
+                        abs_elapsed = (uint32_t) ((switch_micro_time_now() - abs_started) / 1000);
+                        if (abs_elapsed &gt;= abs_timeout) {
+                                status = SWITCH_STATUS_TIMEOUT;
</ins><span class="cx">                                 break;
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><ins>+                if (digit_timeout) {
+                        digit_elapsed = (uint32_t) ((switch_micro_time_now() - digit_started) / 1000);
+                        if (digit_elapsed &gt;= digit_timeout) {
+                                status = SWITCH_STATUS_TIMEOUT;
+                                break;
+                        }
+                }
</ins><span class="cx"> 
</span><span class="cx">                 if (switch_core_session_private_event_count(session)) {
</span><span class="cx">                         switch_ivr_parse_all_events(session);
</span><span class="lines">@@ -855,6 +865,9 @@
</span><span class="cx">                 if (switch_channel_has_dtmf(channel)) {
</span><span class="cx">                         switch_channel_dequeue_dtmf(channel, &amp;dtmf);
</span><span class="cx">                         status = args-&gt;input_callback(session, (void *) &amp;dtmf, SWITCH_INPUT_TYPE_DTMF, args-&gt;buf, args-&gt;buflen);
</span><ins>+                        if (digit_timeout) {
+                                digit_started = switch_micro_time_now();
+                        }
</ins><span class="cx">                 }
</span><span class="cx"> 
</span><span class="cx">                 if (switch_core_session_dequeue_event(session, &amp;event, SWITCH_FALSE) == SWITCH_STATUS_SUCCESS) {
</span></span></pre></div>
<a id="freeswitchtrunksrcswitch_ivr_play_sayc"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/switch_ivr_play_say.c (14980 => 14981)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/switch_ivr_play_say.c        2009-09-25 18:26:47 UTC (rev 14980)
+++ freeswitch/trunk/src/switch_ivr_play_say.c        2009-09-25 19:07:20 UTC (rev 14981)
</span><span class="lines">@@ -2223,7 +2223,7 @@
</span><span class="cx">                         if (!switch_strlen_zero(moh) &amp;&amp; strcasecmp(moh, &quot;silence&quot;)) {
</span><span class="cx">                                 switch_ivr_play_file(session, NULL, moh, &amp;args);
</span><span class="cx">                         } else {
</span><del>-                                switch_ivr_collect_digits_callback(session, &amp;args, 0);
</del><ins>+                                switch_ivr_collect_digits_callback(session, &amp;args, 0, 0);
</ins><span class="cx">                         }
</span><span class="cx"> 
</span><span class="cx">                         if (moh_br) {
</span></span></pre>
</div>
</div>
<div id="footer">See you at ClueCon</div>

</body>
</html>