[Freeswitch-users] Javascript IVR session question

Erik Dekkers erik.dekkers at wvds.nl
Tue Jan 25 11:57:51 MSK 2011


Michael,

It's like this. I would like to let the customer records a message. Then a technician should get called and the previous recorded message should be played.
So after the customer has records his message, the line should be hung up. Then a new call should be made from the IVR to the technician.

Regards,

Erik

Van: freeswitch-users-bounces at lists.freeswitch.org [mailto:freeswitch-users-bounces at lists.freeswitch.org] Namens Michael Collins
Verzonden: maandag 24 januari 2011 21:14
Aan: FreeSWITCH Users Help
Onderwerp: Re: [Freeswitch-users] Javascript IVR session question

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<mailto: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<mailto: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/20110125/09c93f92/attachment-0001.html 


More information about the FreeSWITCH-users mailing list