Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
alvagi
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
alvagi
Commits
17689d49
Commit
17689d49
authored
Jun 22, 2015
by
antirek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
e07922c7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
92 additions
and
32 deletions
+92
-32
API.md
API.md
+89
-0
README.md
README.md
+3
-32
No files found.
API.md
0 → 100644
View file @
17689d49
# 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
().
```
README.md
View file @
17689d49
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment