Commit 17689d49 authored by antirek's avatar antirek

fix

parent e07922c7
# API
attention: using javascript promises
### context.onEvent(event)
events
'variables' - on start call
'close' - on end session
'hangup' - on hangup channel
### context.[command]
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.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.
```js
context.exec('Dial', opt1, opt2, .., optN)
.then(function(result)
//the channel call app Dial with options
});
context.exec('RecieveFax', '/tmp/myfax.tif')
.then(function(result) {
//fax has been recieved by asterisk and written to /tmp/myfax.tif
});
```
### context.hangup()
Dispatches the 'HANGUP' AGI command to asterisk. Does __not__ close the sockets automatically. _callback_ is called with the result of the dispatch.
```js
context.hangup().
```
...@@ -56,42 +56,13 @@ agi.start(3000); ...@@ -56,42 +56,13 @@ agi.start(3000);
exten = > 1000,1,AGI(agi://localhost:3000) exten = > 1000,1,AGI(agi://localhost:3000)
````` `````
### And call to 1000 and view asterisk output. ### And call to 1000 and view asterisk output. Profit!
## API
see [API.md](API.md)
## API
attention: using javascript promises
### 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.
```js
context.exec('Dial', opt1, opt2, .., optN)
.then(function(result)
//the channel call app Dial with options
});
context.exec('RecieveFax', '/tmp/myfax.tif')
.then(function(result) {
//fax has been recieved by asterisk and written to /tmp/myfax.tif
});
```
### context.hangup()
Dispatches the 'HANGUP' AGI command to asterisk. Does __not__ close the sockets automatically. _callback_ is called with the result of the dispatch.
```js
context.hangup()
.then(function(){
//do something
});
```
## Links ## Links
......
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