Feedback

  • Contents
 

Consult Transfer with Disposition

The JavaScript function below demonstrates how to consult transfer the customer to a third party while dispositioning the call before the transfer and letting the agent be ready for another call.  The key in this function is to disposition before transfer to avoid the scripter warning that a call was removed from the user's queue without being completed.

/**
This method takes care of performing a consult transfer and dispositioning the call before transfer
* @param p_Number - the number to dial for the 3rd party
* @param p_WrapupCode – the wrap-up code to use when dispositioning the call
*/
function ConsultTransferWithDisposition(p_Number, p_WrapupCode) {
    var p_mCallObj = scripter.createCallObject();
    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);
        
        //set up the consult transfer              IS_Action_Transfer.consult = true;
        //set up the recipient call object              IS_Action_Transfer.recipient = p_mCallObj.id;                  var iRes2 = confirm("Press OK when you are ready to transfer the call");         // Transfer call to third party                     if (iRes2) {               // since it is ok to transfer the call, disposition it before the transfer                                              IS_Action_CallComplete.wrapupcode = p_WrapupCode;                 IS_Action_CallComplete.click();                 scripter.callObject.id = IS_ATTR_Callid.value;
                // pick up the call, it is probably on hold                     scripter.callObject.pickup();
                // now execute the consult transfer that has been set up                         IS_Action_Transfer.click();             }             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();             }         }     } }