<br><br><div class="gmail_quote">On Tue, Apr 27, 2010 at 11:04 AM, Jesse Cloutier <span dir="ltr"><<a href="mailto:jesse@cronomagic.com">jesse@cronomagic.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div 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></font></div></blockquote><div><br>uuid_broadcast and sched_broadcast are not dialplan apps that you execute, they are API commands. You need an API object. Try this:<br><a href="http://wiki.freeswitch.org/wiki/Lua#For_making_API_calls">http://wiki.freeswitch.org/wiki/Lua#For_making_API_calls</a><br>
<br>Try it out and let us know what happens.<br>-MC<br></div></div><br>