Session speak

From FreeSWITCH Wiki
Jump to: navigation, search

Uses the TTS engine to say a phrase. You must have a TTS module loaded for this to work.




  • engine - the engine to use
  • voice - the name of the voice to use
  • phrase - what you want it to say
  • timer - optional timer to use (eg "soft")

in cepstral phrase can include SSML tags as well. See for more info

in cepstral if phrase starts with / it will open a file specified and read its contents instead of a string -- need windows specifics on path information


session.speak("cepstral","David","Hello from FreeSwitch");

with callback

function my_dtmf_callback(dtmf_str, digits, args)
    console_log("debug", "you dialed the following " + dtmf_str + " + digits + "\n");
    return true;
session.speak("cepstral", "david", '<break time="500ms"/>Hello this is a test of the break tag', my_dtmf_callback);

Be sure not to put the name of the callback function in quotes.

reading a file


See Also