<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:courier,monaco,monospace,sans-serif;font-size:12pt">It's all the same as when you do it in the dialplan.<br>If you set the ringback channel var to the name of a file<br>or a ttml script it will play it while the B leg originates providing<br>that the inbound leg is passed to the new session's originate method:<br><br>session.setVariable("ringback", "%(2000, 4000, 440.0, 480.0)");<br>//or<br>//session.setVariable("ringback", "/path/to/proper_sample_rate.wav");<br>
<br>new_session = new Session();<br>new_session.originate(session, "sofia/foo@bar.com");<br><br><div> </div><div>Anthony Minessale II<br><br><span>FreeSWITCH <a target="_blank" href="http://www.freeswitch.org/">http://www.freeswitch.org/</a></span><br><span>ClueCon <a target="_blank" href="http://www.cluecon.com/">http://www.cluecon.com/</a></span><br><br>AIM: anthm<br>MSN:anthony_minessale@hotmail.com<br>JABBER:anthony.minessale@gmail.com<br>IRC: irc.freenode.net #freeswitch</div><div><br>FreeSWITCH Developer Conference<br>sip:888@conference.freeswitch.org<br>iax:guest@conference.freeswitch.org/888<br>googletalk:conf+888@conference.freeswitch.org<br>pstn:213-799-1400</div><div style="font-family: courier,monaco,monospace,sans-serif; font-size: 12pt;"><br><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">----- Original Message ----<br>From: Tamas Cseke <cstomi.levlist@gmail.com><br>To:
freeswitch-users@lists.freeswitch.org<br>Sent: Wednesday, April 4, 2007 4:29:38 AM<br>Subject: [Freeswitch-users] session.originate question<br><br><div>Hello,<br><br>I'd like to make an ivr, what ask for a number, and call it. I try to <br>write a js script.<br><br>As i see, the new session originate method return when the called party <br>answer the call.<br>I need to play a soundfile back to the caller on 180 reply, what inform <br>the call is ringing.<br>Is it possible somehow? If with js not, with anything else ? <br>(mod_bridgecall or something)<br><br>(Maybe if would useful an other callback function setAnswerHook() ?)<br><br>Thanks any help,<br>Tamas<br><br>Anthony Minessale wrote:<br><br>>please update to 4773 or better and see the code examples<br>>in the commit log.<br>><br>><a target="_blank" href="http://fisheye.freeswitch.org/changelog/FreeSWITCH/?cs=4773">http://fisheye.freeswitch.org/changelog/FreeSWITCH/?cs=4773</a><br>> <br>>Anthony
Minessale II<br>><br>>FreeSWITCH <a target="_blank" href="http://www.freeswitch.org/">http://www.freeswitch.org/</a><br>>ClueCon <a target="_blank" href="http://www.cluecon.com/">http://www.cluecon.com/</a><br>><br>>AIM: anthm<br>>MSN:anthony_minessale@hotmail.com<br>>JABBER:anthony.minessale@gmail.com<br>>IRC: irc.freenode.net #freeswitch<br>><br>>FreeSWITCH Developer Conference<br>>sip:888@conference.freeswitch.org<br>>iax:guest@conference.freeswitch.org/888<br>>googletalk:conf+888@conference.freeswitch.org<br>>pstn:213-799-1400<br>><br>><br>>----- Original Message ----<br>>From: Tamas Cseke <cstomi.levlist@gmail.com><br>>To: freeswitch-users@lists.freeswitch.org<br>>Sent: Saturday, March 24, 2007 5:34:13 AM<br>>Subject: [Freeswitch-users] spidermonkey- session done->script terminate<br>><br>>Hello,<br>><br>>I need help using session object, please help me.<br>>"Note: While the
JavaScript application will continue to execute after a<br>>hangup is detected the session object will be gone and any attempt to<br>>access it will cause the JavaScript to terminate. Save off any<br>>variables you might need for post hangup processing and use your local<br>>variables instead."<br>><br>>How can i avoid the script termination, is it possible to somehow safely check if the session hungup?<br>><br>>exactly i'd like to call an user, if don't answer call another, i can't use simply mod_bridgecall because<br>><br>>i know the destinations just in runtime, i try use fetchURLHash to determine the next user, when one fails.<br>><br>><br>><br>>var queue = argv;<br>>var hash = new Array();<br>><br>>while (true) {<br>><br>>// fetch first agent<br>><br>>fetchURLHash("<a target="_blank" href="http://localhost:8000/lockagent/%22">http://localhost:8000/lockagent/"</a>; + queue + "/"+session.uuid,
"hash");<br>>var agent = hash["agent"];<br>><br>><br>>//call agent<br>><br>>//...<br>> new_session = new Session(session,<br>> "sofia/devil/" + agent + "%192.168.1.93", //dest<br>> "xml",//dialplan<br>> "default",//context<br>><br>>
"",//cid_name<br>> ""), //cid_num<br>> "",//network_addr<br>> "",//ani<br>><br>> "",//anii<br>>
"",//rdnis<br>> "",//username<br>> 10);//to<br>> <br>> <br>> // i need help in this condition<br>><br>> // on timeout, new_session is done, and if i try access its properties, script terminate<br>><br>> if (session.ready() && new_session.ready()) {<br>><br>> bridge(session, new_session);<br>> fetchURLHash("<br>><a target="_blank" href="http://localhost:8000/unlockagent/%22">http://localhost:8000/unlockagent/"</a>; + agent + "/" + session.uuid,
"hash");<br>> break;<br>><br>> }<br>> else {<br>> // should try again, but script terminated<br>><br>> console_log("notice","timeout, try again...\n");<br>> //wait a bit<br>> }<br>> fetchURLHash("<a target="_blank" href="http://localhost:8000/unlockagent/">http://localhost:8000/unlockagent/</a><br>>" + agent + "/" + session.uuid, "hash");<br>>}<br>><br>>Thanks any help,<br>>Tamas<br>><br>>_______________________________________________<br>>Freeswitch-users mailing list<br>>Freeswitch-users@lists.freeswitch.org<br>><a target="_blank"
href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>>UNSUBSCRIBE:<a target="_blank" href="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>><a target="_blank" href="http://www.freeswitch.org">http://www.freeswitch.org</a><br>><br>><br>><br>><br>><br>><br>><br>> <br>>____________________________________________________________________________________<br>>Be a PS3 game guru.<br>>Get your game face on with the latest PS3 news and previews at Yahoo! Games.<br>><a target="_blank"
href="http://videogames.yahoo.com/platform?platform=120121">http://videogames.yahoo.com/platform?platform=120121</a><br>> <br>><br>>------------------------------------------------------------------------<br>><br>>_______________________________________________<br>>Freeswitch-users mailing list<br>>Freeswitch-users@lists.freeswitch.org<br>><a target="_blank" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>>UNSUBSCRIBE:<a target="_blank" href="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>><a target="_blank" href="http://www.freeswitch.org">http://www.freeswitch.org</a><br>> <br>><br><br><br>_______________________________________________<br>Freeswitch-users mailing list<br>Freeswitch-users@lists.freeswitch.org<br><a target="_blank"
href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>UNSUBSCRIBE:<a target="_blank" href="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br><a target="_blank" href="http://www.freeswitch.org">http://www.freeswitch.org</a><br></div></div><br></div></div><br>
<hr size=1><a href="
http://us.rd.yahoo.com/evt=49981/*http://advision.webevents.yahoo.com/mailbeta/features_spam.html">Sucker-punch spam</a> with award-winning protection.<br> Try the <a href="
http://us.rd.yahoo.com/evt=49981/*http://advision.webevents.yahoo.com/mailbeta/features_spam.html">free Yahoo! Mail Beta.</a></body></html>