<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">There is no reason to re-create this functionality in lua, it already exists.<div><br></div><div><a href="http://wiki.freeswitch.org/wiki/Freeswitch_IVR_Originate">http://wiki.freeswitch.org/wiki/Freeswitch_IVR_Originate</a></div><div><br></div><div><a href="http://wiki.freeswitch.org/wiki/Variable_ringback">http://wiki.freeswitch.org/wiki/Variable_ringback</a></div><div><br></div><div><br></div><div>Mike</div><div><br><div><div>On Oct 15, 2009, at 8:55 PM, Peter Volchek wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">
<div bgcolor="#ffffff" text="#000000">
<tt>Hi Guys,<br>
Here is the task I need your help with.<br>
<br>
The feature I am trying to build is called 'Find Me" or 'Follow Me'.<br>
When the call comes in, I am trying the call the predefined list of
numbers in sequence, and if none answers, I am going into voice
receiving mode.<br>
<br>
I am using the lua language.<br>
<br>
Here is what I am doing (pseudo code)<br>
I'll be asking the question just in the code<br>
<br>
<br>
session:answer();<br>
<br>
playPrompt('transfer_greeting');<br>
<br>
next_number = getNextNumber();<br>
<br>
<b>-- Question #1:<br>
</b>-- I am about to start a new session. <br>
-- However, at this point I'd like to play some moho (music on hold)
for the existing one<br>
<br>
<br>
-- Creating a new session. The destination phone start ringing<br>
local session1 = freeswitch.Session("sofia/192.168.1.52/" .. </tt><tt>next_number
</tt><tt>);<br>
</tt><tt><b>-- Question #2:<br>
</b>-- How could I specify the number of rings to wait before session
answers? Or maybe the timeout<br>
</tt><tt><br>
<br>
<br>
if( session1:ready() == true ) then<br>
<b>&nbsp; -- Question #3<br>
</b>&nbsp; -- Session answered. At this point I need to stop the music on
hold. How?<br>
&nbsp; -- Now I need to join the existing session with the newly created one<br>
&nbsp; -- there is a session:transfer method, but I can't see how I can use
it here<br>
else<br>
&nbsp;&nbsp;&nbsp; playPrompt("Can't find. Please leave a message");<br>
&nbsp;&nbsp;&nbsp; doReceiveMessage()'<br>
end<br>
<br>
<br>
<br>
<br>
Has anyone worked on that feature before. I would appreciate all
possible solutions and explanations.<br>
Thank you in advance.<br></tt></div></blockquote></div><br></div></body></html>