Methods
(static) activeCalls(companyId) → {Array}
- Description:
Show Active Calls
Example
const {C5} = require('cxCallControl');
const c5 = await C5(['am1fs1']);
const allActiveCalls = await c5.activeCalls ();
const companyActiveCalls = await c5.activeCalls (12345);
Parameters:
Name | Type | Description |
---|---|---|
companyId |
integer | Company ID Filter |
Returns:
- Type
- Array
(static) getQueue(queueNamenullable) → {Array}
- Description:
Show Queue
Example
const {C5} = require('cxCallControl');
const c5 = await C5(['am1fs1']);
const allQueues = await c5.getQueue();
// OR
const queue = await c5.getQueue(12345);
// Returns
[ { server: 'am1fs1', name: '1234', off_hook_agent: 5, caller_count: 0, on_hook_agent: 0, ring_agent_count: 0, idle_agent_count: 5, agent_count: 5 } ]
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
queueName |
string |
<nullable> |
Queue Name |
Returns:
- Type
- Array
(static) originate(companyId, class4ServerAlias, internalDestination, cli, destinationNumber, vars) → {EventEmitter}
- Description:
Originate
Example
const {C5} = require('cxCallControl');
const c5 = await C5(['am1fs1']);
const activeCall = await c5.originate (12345, 'myServer', 'myIvr', '987654321', '44123456789');
activeCall.on('CHANNEL_PROGRESS', (data) => {
console.log('Ringing', data)
}
activeCall.on('CHANNEL_ANSWER', () => {
console.log('Call Answered')
}
activeCall.on('CHANNEL_HANGUP_COMPLETE', (data) => {
console.log('Call Ended', data)
}
Parameters:
Name | Type | Description |
---|---|---|
companyId |
integer | ID of a company originating the call |
class4ServerAlias |
string | Alias of the class 4 server to route the call |
internalDestination |
string | After the call connects, where is the b-leg of the call connected to |
cli |
string | CLI used on the outbound call |
destinationNumber |
string | Destination Number to call |
vars |
object | Additional Variables |
Returns:
- Type
- EventEmitter
(static) queueAddAgent(queueNamenullable, usernamenullable, wrapUpTimenullable) → {Promise}
- Description:
Add On Hook Agent to Queue
Example
const {C5} = require('cxCallControl');
const c5 = await C5(['am1fs1']);
await c5.queueAddAgent ('myQueue', 'joe', 60);
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
queueName |
string |
<nullable> |
Queue Name |
username |
string |
<nullable> |
Username |
wrapUpTime |
integer |
<nullable> |
Wrap Up Time (Seconds) |
Returns:
- Type
- Promise
(static) queueCount(queueNamenullable) → {Array}
- Description:
Show Queue Count
Example
const {C5} = require('cxCallControl');
const c5 = await C5(['am1fs1']);
const allQueues = await c5.queueCount ();
// OR
const queue = await c5.queueCount (12345);
// Returns
[ { server: 'am1fs1', name: '1234', off_hook_agent: 5, caller_count: 0, on_hook_agent: 0, ring_agent_count: 0, idle_agent_count: 5, agent_count: 5 } ]
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
queueName |
string |
<nullable> |
Queue Name |
Returns:
- Type
- Array
(static) queueRemoveAgent(queueNamenullable, usernamenullable) → {Promise}
- Description:
Remove On Hook Agent to Queue
Example
const {C5} = require('cxCallControl');
const c5 = await C5(['am1fs1']);
await c5.queueRemoveAgent ('myQueue', 'joe');
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
queueName |
string |
<nullable> |
Queue Name |
username |
string |
<nullable> |
Username |
Returns:
- Type
- Promise