[Freeswitch-users] session.originate question

Tamas Cseke cstomi.levlist at gmail.com
Wed Apr 4 02:29:38 PDT 2007


Hello,

I'd like to make an ivr, what ask for a number, and call it. I try to 
write a js script.

As i see, the new session originate method return when the called party 
answer the call.
I need to play a soundfile back to the caller on 180 reply, what inform 
the call is ringing.
Is it possible somehow? If with js not, with anything else ? 
(mod_bridgecall or something)

(Maybe if would useful an other callback function setAnswerHook() ?)

Thanks any help,
Tamas

Anthony Minessale wrote:

>please update to 4773 or better and see the code examples
>in the commit log.
>
>http://fisheye.freeswitch.org/changelog/FreeSWITCH/?cs=4773
> 
>Anthony Minessale II
>
>FreeSWITCH http://www.freeswitch.org/
>ClueCon http://www.cluecon.com/
>
>AIM: anthm
>MSN:anthony_minessale at hotmail.com
>JABBER:anthony.minessale at gmail.com
>IRC: irc.freenode.net #freeswitch
>
>FreeSWITCH Developer Conference
>sip:888 at conference.freeswitch.org
>iax:guest at conference.freeswitch.org/888
>googletalk:conf+888 at conference.freeswitch.org
>pstn:213-799-1400
>
>
>----- Original Message ----
>From: Tamas Cseke <cstomi.levlist at gmail.com>
>To: freeswitch-users at lists.freeswitch.org
>Sent: Saturday, March 24, 2007 5:34:13 AM
>Subject: [Freeswitch-users] spidermonkey- session done->script terminate
>
>Hello,
>
>I need help using session object, please help me.
>"Note: While the JavaScript application will continue to execute after a
>hangup is detected the session object will be gone and any attempt to
>access it will cause the JavaScript to terminate. Save off any
>variables you might need for post hangup processing and use your local
>variables instead."
>
>How can i avoid the script termination, is it possible to somehow safely check if the session hungup?
>
>exactly i'd like to call an user, if don't answer call another, i can't use simply mod_bridgecall because
>
>i know the destinations just in runtime, i try use fetchURLHash to determine the next user, when one fails.
>
>
>
>var queue = argv;
>var hash = new Array();
>
>while (true) {
>
>// fetch first agent
>
>fetchURLHash("http://localhost:8000/lockagent/" + queue + "/"+session.uuid, "hash");
>var agent = hash["agent"];
>
>
>//call agent
>
>//...
>  new_session = new Session(session,
>                             "sofia/devil/" + agent + "%192.168.1.93", //dest
>                             "xml",//dialplan
>                             "default",//context
>
>                             "",//cid_name
>                             ""), //cid_num
>                             "",//network_addr
>                             "",//ani
>
>                             "",//anii
>                             "",//rdnis
>                             "",//username
>                             10);//to
>  
> 
>    // i need help in this condition
>
>    // on timeout, new_session is done, and if i try access its properties, script terminate
>
>    if (session.ready() && new_session.ready()) {
>
>      bridge(session, new_session);
>     fetchURLHash("
>http://localhost:8000/unlockagent/" + agent + "/" + session.uuid, "hash");
>     break;
>
>    }
>    else {
>        // should try again, but script terminated
>
>        console_log("notice","timeout, try again...\n");
>       //wait a bit
>    }
>     fetchURLHash("http://localhost:8000/unlockagent/
>" + agent + "/" + session.uuid, "hash");
>}
>
>Thanks any help,
>Tamas
>
>_______________________________________________
>Freeswitch-users mailing list
>Freeswitch-users at lists.freeswitch.org
>http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>http://www.freeswitch.org
>
>
>
>
>
>
>
> 
>____________________________________________________________________________________
>Be a PS3 game guru.
>Get your game face on with the latest PS3 news and previews at Yahoo! Games.
>http://videogames.yahoo.com/platform?platform=120121
>  
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Freeswitch-users mailing list
>Freeswitch-users at lists.freeswitch.org
>http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>http://www.freeswitch.org
>  
>





More information about the FreeSWITCH-users mailing list