Phrase API

From FreeSWITCH Wiki

Jump to: navigation, search

The following example has been deprecated by the new session.sayPhrase API.

This example uses session.execute to invoke the SAY API to speak a phrase macro.


function sayphrase(phrase, args)
{
    console_log("sayphrase: phrase=[" + phrase + "] args=[" + args + "]\n");
    var rtn = session.execute("phrase", phrase + "," + args);
    return(rtn);
}

if (session.ready()) {
    session.answer();
    session.execute("sleep","1000");
    sayphrase("msgcount", "10");
    session.hangup();
}
Personal tools
Community