<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body text="#000000" bgcolor="#ffffff">
<font size="-1">Hello, I am having trouble with a lua script that i am
trying to put together. <br>
<br>
The script basically makes a recording using the "session:recordFile()"
function, and is terminated by a callback function that returns "break"
on dtmf "#"<br>
<br>
What I would like to do is have the system say the date and time (
session:say() ) into the recording at the end of the recording. It
should be triggered by<br>
the call back.<br>
<br>
When I try it out it works great, I hear the system say the date /
time, except that it is never recorded into the recording. <br>
<br>
I have been searching the docs for something that might clear up why
its not recording but I can't find anything. I thought maybe doing a
uuid_broadcast would fix the problem<br>
but there is no builtin function for that in the lua api and I was not
able to make it work using the "session:execute" function either.<br>
<br>
Any help would be really appreaciated!<br>
<br>
This is the relavent code, for testing purposes I am having the date
spoken using an alternative digit, you can also see my attempt to do a
uuid_broadcast and sched_broadcast commented out:<br>
<br>
######################<br>
--call back function<br>
function onInputRecord(s, type, obj) -- function to end recording<br>
<br>
if (type == "dtmf") then<br>
if ( obj['digit'] == '1') then<br>
curDate = os.date();<br>
session:say(curDate, "en", "CURRENT_DATE_TIME", "pronounced");<br>
<br>
--uuidBroadcast = " say::en CURRENT_DATE_TIME pronounced " ..
os.date() .. " both";<br>
--session:execute("uuid_broadcast ".. UUID, uuidBroadcast);<br>
--session:execute("sched_broadcast", "data=\"+1
/usr/local/freeswitch/sounds/en/us/callie/ivr/8000/ivr-hello.wav
both\"");<br>
<br>
return true;<br>
elseif ( obj['digit'] == '#' ) then<br>
return "break";<br>
end<br>
end <br>
end <br>
<br>
session:setInputCallback("onInputRecord", ""); <br>
RECORD_PATH = /parth/to/file <br>
session:recordFile(RECORD_PATH, 30000, 10, 10); -- pressing # ends the
recording<br>
####################<br>
<br>
Thanks alot!<br>
<br>
JC<br>
<br>
<br>
<br>
</font>
</body>
</html>