Commit 8eacaa0b authored by antirek's avatar antirek

add control streamFile

parent 17689d49
...@@ -11,62 +11,104 @@ events ...@@ -11,62 +11,104 @@ events
'hangup' - on hangup channel 'hangup' - on hangup channel
### context.[command] ### context.answer()
command like:
answer
asyncagiBreak
channelStatus
controlStreamFile
databaseDel
databaseDeltree
databaseGet
databasePut
exec
getData
getFullVariable
getOption
getVariable
gosub
hangup
noop
receiveChar
receiveText
recordFile
sayAlpha
sayDate
sayDatetime
sayDigits
sayNumber
sayPhonetic
sayTime
sendImage
sendText
setAutohangup
setCallerid
setContext
setExtension
setMusic
setPriority
setVariable
speechActivateGrammar
speechCreate
speechDeactivateGrammar
speechDestroy
speechLoadGrammar
speechRecognize
speechSet
speechUnloadGrammar
streamFile
tddMode
verbose
waitForDigit
### context.asyncagiBreak()
### context.channelStatus(channel)
### context.controlStreamFile(filename, escape_digits, skipms, ffchar, rewchr, pausechr, offsetms)
details https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+AGICommand_control+stream+file
### context.databaseDel(variable, value)
### context.databaseDeltree(key)
### context.databaseGet
### context.databasePut
### context.exec
### context.getData
### context.getFullVariable
### context.getOption
### context.getVariable
### context.gosub
### context.hangup
### context.noop
### context.receiveChar
### context.receiveText
### context.recordFile
### context.sayAlpha
### context.sayDate
### context.sayDatetime
### context.sayDigits
### context.sayNumber
### context.sayPhonetic
### context.sayTime
### context.sendImage
### context.sendText
### context.setAutohangup
### context.setCallerid
### context.setContext
### context.setExtension
### context.setMusic
### context.setPriority
### context.setVariable
### context.speechActivateGrammar
### context.speechCreate
### context.speechDeactivateGrammar
### context.speechDestroy
### context.speechLoadGrammar
### context.speechRecognize
### context.speechSet
### context.speechUnloadGrammar
### context.streamFile
### context.tddMode
### context.verbose
### context.waitForDigit
### context.exec(command, [args]) ### context.exec(command, [args])
Dispatches the `EXEC` AGI command to asterisk with supplied command name and arguments. _callback_ is called with the result of the dispatch. Dispatches the `EXEC` AGI command to asterisk with supplied command name and arguments.
```js ```js
context.exec('Dial', opt1, opt2, .., optN) context.exec('Dial', opt1, opt2, .., optN)
......
...@@ -302,6 +302,19 @@ Context.prototype.sayPhonetic = function (string, escape_digits) { ...@@ -302,6 +302,19 @@ Context.prototype.sayPhonetic = function (string, escape_digits) {
return this.sendCommand('SAY PHONETIC ' + string + ' "' + escape_digits + '"'); return this.sendCommand('SAY PHONETIC ' + string + ' "' + escape_digits + '"');
}; };
Context.prototype.controlStreamFile = function (filename, escape_digits, skipms, ffchar, rewchr, pausechr, offsetms) {
var str = [
filename,
escape_digits,
skipms,
ffchar,
rewchr,
pausechr,
offsetms
].join(" ");
return this.sendCommand('CONTROL STREAM FILE ' + str);
};
Context.prototype.streamFile = function (filename, digits) { Context.prototype.streamFile = function (filename, digits) {
var acceptDigits = digits ? digits : "1234567890#*"; var acceptDigits = digits ? digits : "1234567890#*";
return this.sendCommand('STREAM FILE "' + filename + '" "' + acceptDigits + '"'); return this.sendCommand('STREAM FILE "' + filename + '" "' + acceptDigits + '"');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment