PlayTone

From SoftIVR

Jump to: navigation, search

playTone

playTone(frequency, duration[, options]) plays a tone to the caller.

Parameters

  • frequency - the frequency of the tone, in Hz
  • duration - the duration of the tone, in seconds
  • options - an optional string containing options

The allowable options are:

  • background - return immediately, so that the script can carry on processing while the tone is playing;
  • stop_on_dtmf - stop playing and return if the IVR receives DTMF during the tone.

Return values

The playTone function returns 0 on success.

Examples

Play a beep to the user of the form that might be used to indicate that it's time to record a message:

playTone(800, 0.4);

Return to Javascript functions.