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@lists.freeswitch.org [mailto:freeswitch-users-bounces@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@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@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org