Skip to main content

Monipy SDK

MONIPY Supervisor JS SDK allows supervisors to barge into ongoing calls.

Relationship with Other SDKs

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

AttributeDescriptionAllowed ValuesDefault Value
nameYour Display Name in Appstringnull
debugEnable debug messages in JS logtrue, falsefalse
autoplayEnable speaker access to your devicetrue, falsetrue
autoRebootAuto restart in case of failuretrue, falsefalse
ringTimeYour incoming call ringing time in secondsnumber60

Login

Validate your supervisor login ID and password.

monipy.login('YOUR_LOGIN_ID', 'YOUR_PASSWORD');

HTTP Status Codes (Login)

Status codeDescription
200Logged in successfully
401Invalid Login ID or Password, authentication failed
1001Already 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 codeDescription
183Incoming call status: ringing
200Incoming call status: answered
1002Already in a call

Reject Call

Reject an incoming call request.

monipy.reject();
Status codeDescription
200Incoming call status: hangup
1002No ongoing calls to reject

Terminate Call

Hang up the ongoing call.

monipy.terminate();
Status codeDescription
200Ongoing call status: hangup
1002No ongoing calls to terminate

Logout

Logout from the MONIPY SDK.

monipy.logout();
Status codeDescription
200Logged out successfully
1002Need to log in first