new Telephony()
A plugin that provides Telephony functionality.
Instance will be created each time when new Wildix.IntegrationService instance is created.
Plugin could be accessible thought IntegrationService with Telephony property.
Plugin could be accessible thought IntegrationService with Telephony property.
Example
WIService.Telephony.subscribe();
Extends
Methods
answer(channel, callback) → {void}
Initiates an answer to the call for the specified channel.
Parameters:
Name | Type | Description |
---|---|---|
channel |
string | A call channel. |
callback |
function | Callback function called with result |
Returns:
- Type
- void
Example
WIService.Telephony.answer('SIP/108-00000050');
call(number, callback) → {void}
Initiates a call to a specified number.
Parameters:
Name | Type | Description |
---|---|---|
number |
string | A number to call. |
callback |
function | Callback function called with result |
Returns:
- Type
- void
Example
WIService.Telephony.call('101');
hangup(channel, callback) → {void}
Initiates a call hangup for the specified channel.
Parameters:
Name | Type | Description |
---|---|---|
channel |
string | A call channel. |
callback |
function | Callback function called with result |
Returns:
- Type
- void
Example
WIService.Telephony.hangup('SIP/108-00000050');
hold(channel, callback) → {void}
Initiates a call hold for the specified channel.
Parameters:
Name | Type | Description |
---|---|---|
channel |
string | A call channel. |
callback |
function | Callback function called with result |
Returns:
- Type
- void
Example
WIService.Telephony.hold('SIP/108-00000050');
isSubscribed() → {boolean}
Returns true if subscribed to a call event.
Returns:
- Type
- boolean
subscribe() → {void}
Initializes a subscription to call events
Returns:
- Type
- void
unhold(channel, callback) → {void}
Initiates a call unhold for the specified channel.
Parameters:
Name | Type | Description |
---|---|---|
channel |
string | A call channel. |
callback |
function | Callback function called with result |
Returns:
- Type
- void
Example
WIService.Telephony.unhold('SIP/108-00000050');
Events
answer
Indicates that the current user has answered the call.
Example
WIService.Telephony.on('answer', function (call) {
console.log('Answer to the call', call)
});
hangup
Indicates that someone of the call participants has a hang-up.
Example
WIService.Telephony.on('hangup', function (call) {
console.log('Hangup the call', call)
});
hold
Indicates that the current user has put the call on hold.
Example
WIService.Telephony.on('hold', function (call) {
console.log('Hold the call', call)
});
unhold
Indicates that the current user has unhold the call.
Example
WIService.Telephony.on('unhold', function (call) {
console.log('Unhold the call', call)
});