##new SimpleCTI(username, password, statusCB, [ringCB], [upCB], [deadCB]) Creates a new SimpleCTI instance and initialises it with the user info that it will use to authenticate against the PBX. Plants callbacks that will be used to signal API startup completion and called when a call status changes on a line.
Params
- username
String
- A valid PBX username for a user who owns a phone - password
String
- Password - statusCB
statusCallback
- to call on error or successful API initialisation - [ringCB]
eventCallback
- to call when a line on users phone rings - [upCB]
eventCallback
- to call when a line on users phone is answered - [deadCB]
eventCallback
- to call when a line on users phone is hung up
##simpleCTI.dial(number, [line]) Dial a number, optionally specify line
Params
- number
number
- to dial - [line=0]
number
- line index (zero based)
##simpleCTI.hangup(id) Hangup a call
Params
- id
String
- ID of call to hangup
##simpleCTI.answer(id) Answer a call
Params
- id
String
- ID of call to answer
##callback: SimpleCTI~statusCallback Params
- ok
Boolean
- true or false: true: API successfully started false: error condition - code
number
- numeric API error code (status == false only) - text
String
- extual explanation suitable for user display
Scope: inner typedef of SimpleCTI
Type: function
##callback: SimpleCTI~eventCallback
This callback is displayed as a global member.
Params
- state
String
- one of 'ring', 'up', 'dead' - new state of call - number
String
- The Caller ID of the other party. Caution: may not be numeric in all cases - party
String
- 'caller' or 'callee' - defines which role we are - call
Object
- Raw underlying call object - line
Object
- Raw underlying line object
Scope: inner typedef of SimpleCTI
Type: function