Javascript DTMF Callback Function
From FreeSWITCH Wiki
Contents |
[edit]
Description
Respond to a DTMF digit
[edit]
Synopsis
This callback function is passed as a parameter to such functions as session.RecordFile, and session.StreamFile
function <dtmf_callback> ( session, type, obj, user_data ) {
.. do something ..
return <value>;
}
type is an "event" object dtmf is a dtmf object
dtmf.digit and dtmf.duration are part of the dtmf object so you can not only get the digit but the duration that it was pressed.
This callback function should return one of the values below.
[edit]
Return Values
[edit]
Recording
- true - keep recording
- false - stop
- "pause"
- "restart"
[edit]
Playing Back
- true - keep going, do not interrupt the current operation
- false - stop, and exit the current operation
- "seek:[+/-][value]" in milliseconds
- "speed:[+/-][value]" in some unknown unit
- Relative:
- return("speed:+");
- return("speed:-");
- return("speed:+5");
- return("speed:-5");
- Absolute:
- return("speed:0");
- return("speed:5");
- Relative:
- "pause" (sending a second pause will unpause)
- "restart"
[edit]
Bridging
- true - keep going, do not interrupt the current operation
- false - stop, and exit the current operation
The special session global will be set to the Session object that the event was generated by.
[edit]
Other
- true - keep going, do not interrupt the current operation
- false - stop, and exit the current operation
[edit]
