as soon as you play please hold there is no longer a chance for signaling based ringback you could have used the application ring_ready to send your phone an 180 ringing if you did not play the file 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'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. On Mon, Jan 18, 2010 at 1:11 PM, Troy Anderson <troy@tlainvestments.com>wrote:
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's going on and make the mod_lua even more valuable to me and anyone else struggling with this kind of issue.
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're waiting. In addition to the way presented here, I've tried parking the caller using uuid_park, but still can't figure out how to play music/ringback for them.
session:answer(); session:sleep(1000); session:execute("playback","pleasehold.wav")
local targetEndpoint = "1100@default" -- or wherever
-- ringback works only AFTER the bridge line, below. How do I get it to start immediately? local destSession = freeswitch.Session("{ringback='myringback.wav'}".. targetEndpoint) -- this "originates" a call to targetEndpoint
local digit destSession:playAndGetDigits(1,1,3,3000,"#","instructions.wav","[1-3]")
if (digit == "1") then freeswitch.bridge(session,destSession) else session:execute("playback","goodbye.wav") session:hangup() destSession:hangup() end
I appreciate any help on this.
-Troy
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Anthony Minessale II FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire AIM: anthm MSN:anthony_minessale@hotmail.com <MSN%3Aanthony_minessale@hotmail.com> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<PAYPAL%3Aanthony.minessale@gmail.com> IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:888@conference.freeswitch.org <sip%3A888@conference.freeswitch.org> iax:guest@conference.freeswitch.org/888 googletalk:conf+888@conference.freeswitch.org<googletalk%3Aconf%2B888@conference.freeswitch.org> pstn:+19193869900