Javascript Teletone OnDTMF

From FreeSWITCH Wiki
Jump to: navigation, search

Contents

Description

Causes a callback to be performed when DTMF is received.

Synopsis

onDTMF(callback)
  • callback - The name of the function to call when DTMF is present, it will pass an argument to this callback of the digits it received.

Example

use("TeleTone");
tts = new TeleTone(session);
function dtmf_test(digits)
{
    console_log("you pressed " + digits + "\n");
    return digits;
}

tts.onDTMF("dtmf_test");

See Also