API Reference Guide

Jodo World Toolbar Widget

This is simple but very powerful option of tight integration. System Integrator / ISV can implement following functionality using widgets

  • Login & Logout to Jodo World

  • Receive Call and Screen Pop-up

  • Make Call to Customer Contacts

  • End Active Call

  • Hold & Unhold Call

  • Change Status – Presence Status

  • Save Selected Disposition

Following features are available from Toolbar

  • Transfer Call

  • Conference Call

Following events can be received

  • Status changed

  • New Call Received

  • Active Call Terminated

  • Hold / Unhold Success & Failure

How to include Jodo World Toolbar Widget in CRM / Business Applicatio?

To include Jodo World Toolbar Widget in CRM / Business Application, following javascript should be added at end of project. It is essential to not refresh page. If page is reloaded, it will reload widget and agent will be logged out. It is recommended to follow IFRAME approach for CRM / Business Application so entire page is not reloaded.

				
					<script type="text/javascript" src="https://serverip:portnumber/toolbarwidget/js/jodocloudtoolbar.js"></script>
<script type="text/javascript" src="https://serverip:portnumber/toolbarwidget/js/HandleCRMRequest.js"></script>
<script type="text/javascript" src="js/CRM.js"></script>
				
			

Method: Login()

				
					var loginrequest = {
	"Login_ID": StrLogin,
	"Password": Strpasswd
};
sendLoginParameters(loginrequest);
				
			

Description: This method is used to login into Jodo World. CRM / Business Application can invoke this method with user name & password. When logged in successfully, CRM / Business Application can receive events and invoke methods. Jodo World does not honor any requests till Login() method is invoked.

Method: Logout()

Parameters: None

Description: This method is used to logout from Jodo World. User must be logged in to Jodo World before invoking this API. After successful logout, Jodo World Widget stops sending events and processing requests.

Method: DisposeCall()

Purpose: This method is used to dispose interaction (call). Once Disposition is saved, user can receive / initiate next interaction. Jodo World User must be in Wrap-Up / AUX state to invoke this method. Method fails if user is in different status.

Jodo World processes request and return result as per parameter value. If call is disposed successfully on Jodo World end, Jodo World sends available / ready status if configured for auto available or remain in same status when auto ready / auto available is disabled.

Input Parameters:

Sample Request

				
					var saverequest = {
	“dispoMasterId”: 10,
	“dispoReasonId”:5,
	“dispomatertext”:”Not Interested”,
	“disporeasontext”:”Call after 3 months”,
	“CallbackContactNo”:”0987xxxx545”,
	“callbackDate”:”10-Dec-2016 11:00:15”,
	“nAuditCode”:0,
	“remarktest”:”Recently purchased product”
}
DisposeCall (saverequest);
				
			

Response is communicated in event handler

Method: MakePhoneCall()

Purpose: This method is used to initiate phone call directly from CRM / Business Application.

CRM / Business Application has to send following parameters to dial a call

Sample Request:

				
					var request = {
	“phone_no”:”875485485345”,
	“processid”:10
}
MakePhoneCall (request);
				
			

Method: EndCall()

Purpose: This method is used to end active call. It can be invoked any time when call is in progress or active / connected

EndCall();

Response is communicated in event handler

Method: HoldCall()

Purpose: This method is used to put active call on hold.

HoldCall();

Response is communicated in event handler

Method: UnholdCall()

Purpose: This method is used to unhold call, which was kept on hold previously.

Sample Request:

UnholdCall();

Response is communicated in event handler

Method: ChangeStatus()

Purpose: This method to change status / mode of logged in user. We need to pass status code as parameter.

Parameters:
Request
				
					var newstatus = {
	“status”;1
}
				
			

Agent Status Codes

Response is communicated in event handler

How to implement Event Handler?

Event handler is important part of communication between Jodo and Business Application. Events sent by Jodo are received in this method and processed as required. It is recommended not to block this method and push events in queue for processing if it takes longer time.

				
					function callURL(a)
{
    console.log("Response from Jodo World ::" + a);
    var data = JSON.parse(a);
    var ncommand = JSON.stringify(data.command);
    var message = JSON.stringify(data.message);
    console.log("command: " + ncommand + " message: " + message);
    try
    {
        if (data.command === "astatus")
        {
            if (data.message === "Available" || data.message === "available")
            {
                callflag = 0;
                // Agent is available to receive calls
                console.log("Agent is available to receive calls");
                document.getElementById("acsstatus").innerHTML = "Available";
                // disable / hide Avaiable button and show / enable Not Available button
            }
            if (data.message === "NotAvailable" || data.message === "notavailable")
            {
                // Agent is available to receive calls
                console.log("Agent is Not available to receive calls");
                document.getElementById("acsstatus").innerHTML = "Not Available";
                // disable / hide Not Avaiable button and show / enable Available button
            }
            else if (data.message === "Dialing" || data.message === "dialing")
            {
                // Call is being dialed
                document.getElementById("acsstatus").innerHTML = "Dialing";
                // disable / hide Not Avaiable / Avaiable / Dial button
            }
            else if (data.message === "Talking" || data.message === "talking")
            {
                // Agent is talking to customer
                // Show & Enable Hold Button
                document.getElementById("acsstatus").innerHTML = "Talking";
                // disable / hide Not Avaiable / Avaiable / Dial button
                $("#callend").show();
                 $("#callhold").show();
                $("#callunhold").hide();
            }
            else if (data.message === "preview")
            {
                // Agent entered in preview mode
                document.getElementById("acsstatus").innerHTML = "Preview";
            }
            else if (data.message === "calltransfer")
            {
                // Agent entered in calltransfer mode
                document.getElementById("acsstatus").innerHTML = "calltransfer";
            }
            else if (data.message === "EndCall")
            {
                // End call successful
                // Enable MakeCall button
                $("#callend").hide();
                $("#callhold").hide();
                $("#callunhold").hide();
                $("#dispoLable").show();
                $("#masterid").show();
                $("#resonId").show();
                $("#idSavebtn").show();
            }
            else if (data.message === "EndCallFailed")
            {
                // End call failed               
            }
            else if (data.message === "WrapUp" || data.message === "wrapup")
            {
                // Agent staus changed to Wrapup / AUX
                // Show Disposition List
                document.getElementById("acsstatus").innerHTML = "Wrapup";
            }
        }
        else if (data.command === "holdsuccess")
        {
            // disable hold button & enable unhold button
        }
        else if (data.command === "holdfailed")
        {
            // disable hold button & enable unhold button
        }
        else if (data.command === "unholdsuccess")
        {
            // enble hold button & disable unhold button
        }
        else if (data.command === "unholdfailed")
        {
            // enble hold button & disable unhold button
        }
        else if (data.command === "docpush")
        {
            // received request to show document
            // To be added in future release
        }
        else if (data.command === "video")
        {
            // received request to show video
            // To be added in future release
        }
        else if (data.command === "callsavesuccess")
        {
            $("#dispoLable").hide();
            $("#masterid").hide();
            $("#resonId").hide();
            $("#idSavebtn").hide();
            alert("Data Saved Successfully");
        }
        else if (data.command === "callsavefailed")
        {
            alert("Failed to save data");
        }
        else if (data.command === "ivrinputs")
        {
            // IVR Inputs
            // Show in List
            // To be added in future release
        }
        else if (data.command === "screenpop")
        {
            a = JSON.parse(message);
            var currenttryno = a.currenttryno;
            var sessionid_calllist = a.sessionid_calllist;
            var customercode = a.customercode;
            var systemuniquecallid = a.systemuniquecallid;
            var screenpopfile = a.screenpopfile;
            var timezone = a.timezone;
            var acssessionid = a.acssessionid;
            var command = a.command;
            var languageid = a.languageid;
            var end = a.end;
            var dnis = a.dnis;
            var crmuniqueid = a.crmuniqueid;
            var hold = a.hold;
            var screenpoptype = a.screenpoptype;
            var requestdatetime = a.prrequestdatetimeocessid;
            var calluniqueid = a.calluniqueid;
            var usertransfer = a.usertransfer;
            var autoflag = a.autoflag;
            var screenconnector = a.screenconnector;
            var calltypedescription = a.calltypedescription;
            var crmsave = a.crmsave;
            var mediatype = a.mediatype;
            var processid = a.processid;
            var phone_no = a.telephoneno;
            var calltype = a.calltypeid;
            document.getElementById('phoneNo').value = phone_no;
        }
    }
    catch (e) {
    }
}
///// Set event callback handler
onJodoEventReceived (callURL);
				
			

Events