Monipy SDK
MONIPY Supervisor JS SDK allows supervisors to barge into ongoing calls.
While the WebRTC Browser SDK allows agents to make and receive calls, and the Voice Feed SDK displays ongoing call details, Monipy is specifically designed for supervisors to authenticate and participate in (barge/monitor) those calls.
When a barge request is initiated from the Voice Feed SDK using a Supervisor ID, the supervisor must be logged into Monipy using their Supervisor ID and Password to successfully handle the request.
Installation
You can install MONIPY using npm:
npm install monipy
Initializing the MONIPY SDK Object
The MONIPY SDK object needs to be initialized with your configuration.
var monipy = new MONIPY({
name: 'Supervisor Name',
debug: false,
autoplay: true,
autoReboot: false,
ringTime: 60
});
Configuration Parameters
| Attribute | Description | Allowed Values | Default Value |
|---|---|---|---|
| name | Your Display Name in App | string | null |
| debug | Enable debug messages in JS log | true, false | false |
| autoplay | Enable speaker access to your device | true, false | true |
| autoReboot | Auto restart in case of failure | true, false | false |
| ringTime | Your incoming call ringing time in seconds | number | 60 |
Login
Validate your supervisor login ID and password.
monipy.login('YOUR_LOGIN_ID', 'YOUR_PASSWORD');
HTTP Status Codes (Login)
| Status code | Description |
|---|---|
| 200 | Logged in successfully |
| 401 | Invalid Login ID or Password, authentication failed |
| 1001 | Already logged in |
Event Listeners
You can listen for various events emitted by the SDK.
monipy.on('login', function (object) {
console.log('Login success:', object);
});
monipy.on('inComingCall', function (object) {
console.log('Incoming call:', object);
monipy.answer(); // Automatically answer incoming barge/monitor requests
});
monipy.on('answered', function (object) {
console.log('Call answered:', object);
});
monipy.on('ended', function (object) {
console.log('Call ended:', object);
});
monipy.on('error', function (object) {
console.log('Error:', object);
});
List of Events
login: Triggered on successful login.logout: Triggered on successful logout.loginFailed: Triggered when authentication fails.inComingCall: Triggered when a barge or monitor request is received.answered: Triggered when a call is answered.ringing: Triggered when the call is ringing.ended: Triggered when the call ends.hangup: Triggered when the call is hung up.trying: Triggered when attempting to connect.callStream: Triggered when the media stream is established.error: Triggered when an error occurs.
Methods
Answer Call
Answer an incoming call request.
monipy.answer();
| Status code | Description |
|---|---|
| 183 | Incoming call status: ringing |
| 200 | Incoming call status: answered |
| 1002 | Already in a call |
Reject Call
Reject an incoming call request.
monipy.reject();
| Status code | Description |
|---|---|
| 200 | Incoming call status: hangup |
| 1002 | No ongoing calls to reject |
Terminate Call
Hang up the ongoing call.
monipy.terminate();
| Status code | Description |
|---|---|
| 200 | Ongoing call status: hangup |
| 1002 | No ongoing calls to terminate |
Logout
Logout from the MONIPY SDK.
monipy.logout();
| Status code | Description |
|---|---|
| 200 | Logged out successfully |
| 1002 | Need to log in first |