cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
591
Views
0
Helpful
1
Replies

New window on incoming call based on Screen Pop Sample

Sandeep Luther
Beginner
Beginner

I am trying to make a gadget where a new window/tab will show up with every incoming call. The new window is our CRM application and it is being prepopulated based on a call id from the Call Variables.

I had installed the Screen Pop sample on our 9.1.1 Finesse and was unable to get the iframe to show up. It simply says "Screen Pop goes here", meaning the render function was called, but the numdialog counter never incremented.

I made some modifications and I notice that I can reliably detect the end of a call.  But detecting the start of the call has been unsuccessful.

Anything obvious I am missing? Has the Dialog object significantly changed between versions?

render = function () {
        var currentState = user.getState();
        var html = '';
        html += '<div>';
  if (numDialogs==1) {

// Replaced with URL and Query String to our CRM

window.open(www.bing.com);

  gadgets.window.adjustHeight();

  }
      else {

clientLogs.log("No call detected");

  gadgets.window.adjustHeight();

     }
        
       
    },

  _processCall = function (dialog) {
      // if here then callvar1 didnt show up on initial dialog
   // get the latest callvariables
   callvars = dialog.getMediaProperties();
   clientLogs.log("_processCall:cv1="+callvars["callVariable1"]);
   render();

},
   
    /**
     *  Handler for additions to the Dialogs collection object.  This will occur when a new
     *  Dialog is created on the Finesse server for this user.
     */
     handleNewDialog = function(dialog) {
            // increment the number of dialogs
   numDialogs++;
           
            // get the call variable data from the dialog
   // dialog.getMediaProperties() returns an array of properties
            callvars = dialog.getMediaProperties();
  
   clientLogs.log("handleNewDialog:cv1="+callvars["callVariable1"]);
   // if callVariable1 is null then add a handler for subsequent dialog events
   //  where the call data will have been updated
   if (callvars["callVariable1"] == null )
   {
       dialog.addHandler('change', _processCall);
   }
   else
   {
   // render the html in the gadget
      clientLogs.log("rendering dialog");
      render();
   }

    },

1 Accepted Solution

Accepted Solutions

ewindgat
Contributor
Contributor

If you could try this first. Sometimes the prefix HTTP, or HTTPS, simply needs to be changed to //

So, //myCRM.com

Also, some websites don't allow themselves to be loaded into an IFRAME. And, that's what's happening here with the screen pop. If you could test a simple HTML page, outside of Finesse, and see if you could load your CRM into an IFRAME. For example Google.com will not work with a screenpop, as Google does not allow its site to be loaded into an IFRAME.

If these two ideas don't help, then let's get into the code.

Thanks!

View solution in original post

1 Reply 1

ewindgat
Contributor
Contributor

If you could try this first. Sometimes the prefix HTTP, or HTTPS, simply needs to be changed to //

So, //myCRM.com

Also, some websites don't allow themselves to be loaded into an IFRAME. And, that's what's happening here with the screen pop. If you could test a simple HTML page, outside of Finesse, and see if you could load your CRM into an IFRAME. For example Google.com will not work with a screenpop, as Google does not allow its site to be loaded into an IFRAME.

If these two ideas don't help, then let's get into the code.

Thanks!

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Recognize Your Peers