[Freeswitch-users] Javascript IVR session question
Michael Collins
msc at freeswitch.org
Mon Jan 24 23:13:33 MSK 2011
If I read this correctly you are hanging up the channel that you later wish
to bridge to user/202. Why do you need to hangup? Perhaps you could describe
a little more about the application? I'm sure we can help you iron out the
details.
-MC
On Sun, Jan 23, 2011 at 12:48 PM, Erik Dekkers <erik.dekkers at wvds.nl> wrote:
> Hey ppl,
>
> At the moment im building a Javascript based IVR but im kind of stuck on a
> part.
>
> The IVR should do this:
>
> - Answer session (working)
> - Play some wav files (working)
> - Record a message to file (working)
> - Hang up the first session (working)
> - Call the second session (not working)
> - Play the previous recorded file (not working)
>
> After I dial the second session, the console says "channel is hungup
> already". How should i do this?
>
> Kind regards,
>
> Erik Dekkers (wvds-nl on IRC)
>
>
>
> my script:
>
> var allDigits = "";
> function on_dtmf(session, type, digits, arg)
> {
> if (digits.digit == "#") {
> return allDigits;
> }
> if (digits.digit == "*") {
> return false; //stop the recording.
> }
> console_log("digit: " + digits.digit + "\n");
> allDigits += digits.digit;
> return(allDigits);
> }
> session.answer();
> if (session.ready()) {
> allDigits = "";
> var rtn;
> rtn = session.streamFile("/home/edekkers/sounds/10_spreek_in.wav",
> on_dtmf, "");
> if (session.ready()) {
> var tmp_Filename = "/tmp/test.wav";
> if (session.ready()) {
> rtn = session.recordFile(tmp_Filename, on_dtmf, "", 120);
> }
> rtn =
> session.streamFile("/home/edekkers/sounds/11_bericht_is_ontvangen.wav",
> on_dtmf, "");
> if (session.ready()) {
> session.hangup();
> }
> }
> }
> session.execute("bridge","user/202")
> if (session.ready()) {
> session.streamFile("/tmp/test.wav");
> }
>
>
>
> _______________________________________________
> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20110124/2a0ecf77/attachment.html
More information about the FreeSWITCH-users
mailing list