[Freeswitch-users] session.originate question
Anthony Minessale
anthmct at yahoo.com
Wed Apr 4 06:49:58 PDT 2007
It's all the same as when you do it in the dialplan.
If you set the ringback channel var to the name of a file
or a ttml script it will play it while the B leg originates providing
that the inbound leg is passed to the new session's originate method:
session.setVariable("ringback", "%(2000, 4000, 440.0, 480.0)");
//or
//session.setVariable("ringback", "/path/to/proper_sample_rate.wav");
new_session = new Session();
new_session.originate(session, "sofia/foo at bar.com");
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: Wednesday, April 4, 2007 4:29:38 AM
Subject: [Freeswitch-users] session.originate question
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
>
>
_______________________________________________
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
____________________________________________________________________________________
Get your own web address.
Have a HUGE year through Yahoo! Small Business.
http://smallbusiness.yahoo.com/domains/?p=BESTDEAL
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20070404/2e9b7639/attachment-0002.html
More information about the FreeSWITCH-users
mailing list