Javascript Teletone AddTone

From FreeSWITCH Wiki
Jump to: navigation, search

Contents

Description

This adds a tone and associates it with a 'digit' which can be alpha or numeric and is not limited to what is on a normal DTMF keypad

Synopsis

addTone(digit name, frequency1, frequencyN, 0.0)
  • digit name is a character that will be used to identify this tone
  • frequencies are a null terminated list of all the component frequencies that make this tone

Example

use("TeleTone");
var tts = new TeleTone(session);
tts.addTone("q", 2600.0, 2400.0, 0.0);
dtmf = session.((FreeSwitch Javascript Session GetDigits|getDigits))(1, "", 20000, true);
if (dtmf == "q") {
  // do something fun here
}

See Also