as soon as you play please hold there is no longer a chance for signaling based ringback<br>you could have used the application ring_ready to send your phone an 180 ringing if you did not play the file<br>once you played the file you are responsible for sending audio to the channel, think of it like a gui where the runtime loop takes input and you must not do anything blocking in that loop and you can&#39;t play the file and do something else at the same time without more threads which is not easy to do from an embedded script. <br>
<br><br><br><div class="gmail_quote">On Mon, Jan 18, 2010 at 1:11 PM, Troy Anderson <span dir="ltr">&lt;<a href="mailto:troy@tlainvestments.com">troy@tlainvestments.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I think there may be other ways to do this, but if I could understand how to do it from lua, I think it would help me understand more about what&#39;s going on and make the mod_lua even more valuable to me and anyone else struggling with this kind of issue.<br>

<br>
I am trying to answer a call in lua, exchange a bit of information with the caller, then I want to originate a call to another endpoint, and depending on what their response to some audio questions is, connect the original caller to them, or send the original caller away.  The problem is that I want the original caller to her ring tones or music on hold while they&#39;re waiting.  In addition to the way presented here, I&#39;ve tried parking the caller using uuid_park, but still can&#39;t figure out how to play music/ringback for them.<br>

<br>
session:answer();<br>
session:sleep(1000);<br>
session:execute(&quot;playback&quot;,&quot;pleasehold.wav&quot;)<br>
<br>
local targetEndpoint = &quot;1100@default&quot; -- or wherever<br>
<br>
-- ringback works only AFTER the bridge line, below.  How do I get it to start immediately?<br>
local destSession = freeswitch.Session(&quot;{ringback=&#39;myringback.wav&#39;}&quot;.. targetEndpoint)  -- this &quot;originates&quot; a call to targetEndpoint<br>
<br>
local digit destSession:playAndGetDigits(1,1,3,3000,&quot;#&quot;,&quot;instructions.wav&quot;,&quot;[1-3]&quot;)<br>
<br>
if (digit == &quot;1&quot;) then<br>
        freeswitch.bridge(session,destSession)<br>
else<br>
        session:execute(&quot;playback&quot;,&quot;goodbye.wav&quot;)<br>
        session:hangup()<br>
        destSession:hangup()<br>
end<br>
<br>
<br>
I appreciate any help on this.<br>
<br>
-Troy<br>
<br>
_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Anthony Minessale II<br><br>FreeSWITCH <a href="http://www.freeswitch.org/">http://www.freeswitch.org/</a><br>ClueCon <a href="http://www.cluecon.com/">http://www.cluecon.com/</a><br>
Twitter: <a href="http://twitter.com/FreeSWITCH_wire">http://twitter.com/FreeSWITCH_wire</a><br><br>AIM: anthm<br><a href="mailto:MSN%3Aanthony_minessale@hotmail.com">MSN:anthony_minessale@hotmail.com</a><br>GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com">PAYPAL:anthony.minessale@gmail.com</a><br>
IRC: <a href="http://irc.freenode.net">irc.freenode.net</a> #freeswitch<br><br>FreeSWITCH Developer Conference<br><a href="mailto:sip%3A888@conference.freeswitch.org">sip:888@conference.freeswitch.org</a><br><a href="http://iax:guest@conference.freeswitch.org/888">iax:guest@conference.freeswitch.org/888</a><br>
<a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org">googletalk:conf+888@conference.freeswitch.org</a><br>pstn:+19193869900<br>