<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
Generally you could avoid this by checking session status. Below is an
example.<br>
<br>
function selectAge (langId)<br>
<br>
session:flushDigits()<br>
<br>
digits = ""<br>
while ("" == digits) do<br>
<br>
if not session:ready() then return nil end<br>
<br>
digits = session:playAndGetDigits(2, 3, 1, 5000, "#",<br>
wav_base .. langId .. "/" .. age_prompt_wav, <br>
wav_base .. langId .. "/" .. age_incorrect_wav,<br>
"\\d+");<br>
<br>
log("info", "Got dtmf: ".. digits .."\n");<br>
if "" ~= digits then<br>
if (age_max < tonumber(digits) or age_min >
tonumber(digits) ) then<br>
log("info", "Incorrect age: ".. digits ..".. retrying\n");<br>
session:streamFile (wav_base .. langId .. "/" ..
age_incorrect_wav)<br>
digits = "" <br>
end<br>
end<br>
<br>
end<br>
<br>
log("info", "Got age dtmf: ".. digits .."\n");<br>
return tonumber(digits)<br>
end<br>
<br>
<br>
<br>
On 02/10/2010 01:17 PM, Chia-Yen Wu wrote:
<blockquote
cite="mid:314dc3f81002100117h6b1bc49cna989624a1ae4e0e2@mail.gmail.com"
type="cite">
<div>Hello, </div>
<div>
<div>i tried to use Lua script to replace xml macro in dialplan,</div>
</div>
<div>but I found out that Lua wont terminate if client hangup,</div>
<div>,so the session is still on but client is already hangup,</div>
<div>is there a way to avoid this ?</div>
<div><br>
</div>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
FreeSWITCH-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a>
<a class="moz-txt-link-freetext" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a>
UNSUBSCRIBE:<a class="moz-txt-link-freetext" href="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</a>
<a class="moz-txt-link-freetext" href="http://www.freeswitch.org">http://www.freeswitch.org</a>
</pre>
</blockquote>
<br>
</body>
</html>