Feedback

  • Contents
 

Conference with Third Party

The JavaScript function below demonstrates how an agent can call a third party, consult with that third.  Then bring the third party in with the customer and the agent.  Then once the verification process is complete, disconnect the third party, and continue with the call with the customer and the agent.

function ConferenceWithThirdParty(p_Number) {

    // create a callobject     var p_mCallObj = scripter.createCallObject();
    // create a conference object     var p_ConferenceObject = scripter.createConferenceObject();     var iRes1 = confirm("Would you like to call the 3rd party?");
    // user selected OK, so let's call the 3rd party     if (iRes1) {         p_mCallObj.dial(p_Number, false);         var iRes2 = confirm("Press OK when you are ready to conference in the 3rd party");
        // conference in the third party         if (iRes2) {             scripter.callObject.id = IS_ATTR_Callid.value;
            // create the conference object             // add 3rd party
            p_ConferenceObject.Create(p_mCallObj);
            // pick up the call, it is probably on hold             scripter.callObject.pickup();
            // add scripter call             p_ConferenceObject.add(scripter.callObject);
            // pickup 3rd party just in case             p_mCallObj.pickup();
 
            var iRes3 = confirm("Press OK when you are ready to disconnect the  third party call");             if (iRes3) {                 DisconnectCallInConference(p_ConferenceObject.id, p_Number);             }         } else {             // they did not want to transfer, so lets disconnect the 3rd party call and             // pick up the original call             // disconnect 3rd party call             p_mCallObj.disconnect();
            // pick up original call             scripter.callObject.id = IS_ATTR_Callid.value;             scripter.callObject.pickup();         }     } } /** * This method is a utility function that will be used to disconnect a specific leg of the *conference call where the RemoteTn(Number Dialed) * is equal to the number passed in. * @param pConferenceID - id of the conference to search * @param pDialedNumber - number dialed that needs to be disconnected * @Author Customer Care */ function DisconnectCallInConference(pConferenceID, pDialedNumber) {
    // create conference object     var ConfObj = scripter.createConferenceObject();
    // set id of the conference object to the one created when the conference was created     ConfObj.id = pConferenceID;
    // get handle to enumerator for collection     var _enum = ConfObj.startMemberIdsEnum;
    // enumerate conference object collection     while (_enum.hasMoreElements()) {
        // grab id of call object         var callObjId = _enum.nextElement();
        // create call object         var callObj = scripter.createCallObject();
        // assign id to call object         callObj.id = callObjId;
        // check the remoteTn value of the call, if equal then that is the call to disconnect         if (callObj.getAttribute('Eic_RemoteTn') == pDialedNumber) {             ConfObj.disconnectParty(callObj.id);         }     } }