<html><body><div>Hi,<br><br>Firstly apologies for the newbie question.&nbsp; I've tried searching the various documentation and trying a few different things but to no avail, so I've come here to ask for help.&nbsp; I think my problem relates to sessions, but I'm not totally sure.<br><br>What I'm trying to do is:<br><br>1.&nbsp; A lua script is run by someone calling into FS (the initiator)<br>2.&nbsp; They select an option, which originates and makes an outbound call to another phone number<br>3.&nbsp; The 3rd party (hopefully) answers their phone and receives a prompt that they're going to be connected (the receiver)<br>4.&nbsp; Both parties join a conference and talk to each other (a conference as there may be other parties in future)<br><br>To do this I'm creating a session and using execute_on_answer to run the second script and provide the prompt to the receiving party.&nbsp; However the receiving party never hears a prompt, comes into the conference, immediately drops out and hangs up.<br><br>Here are the scripts, they're pretty simple;<br><br>The initiator:<br><br>session:answer()
<br>session:streamFile("WaitForOutdial.wav") <br>new_session = freeswitch.Session("[execute_on_answer=lua /usr/local/freeswitch/scripts/receivewithwhisper.lua]sofia/external/12345@mydest"); <br>session:execute("conference", "CONFTEST@default+flags{endconf, moderator}") <br>session:hangup();<br><br>The above works fine and the outbound call is placed.&nbsp; The script below is then executed but the receiving phone rings but nothing is heard, the conference is joined/exited and it terminates again;<br><br><br>The receiver (receivewithwhisper.lua):<br><br>session:answer() <br>session:streamFile("ConnectingToCaller.wav") <br>session:execute("conference", "CONFTEST@default+flags{endconf, moderator}") <br>session:hangup();<br><br>The receiving scripts runs when the receiver answers their phone, and executes (quickly) and terminates.&nbsp; I was expecting it to drop into the conference and I'd be able to talk to the other person.&nbsp; It does join the conference, but then exits right away and falls through to the hangup section.<br><br>As I say, I'm not exactly sure if this is the best way (maybe there's another - suggestions are welcome) and not exactly sure what the problem is although I suspect it's something to do with the sessions?<br><br>Any help, advice, corrections or examples would be appreciated.&nbsp; It's all done in lua and I've tried to avoid session.originate as I understand this is deprecated.<br><br>Thanks<br><br>Adam<br><br><br data-mce-bogus="1"></div></body></html>