GithubHelp home page GithubHelp logo

Comments (11)

supelee avatar supelee commented on June 14, 2024 1

Hi sromoki@,

Amazon Connect streams uses a SharedWorker behind the scenes to coordinate leader election for various different sets of activities, such as which frame/tab is responsible for ringtones and softphone connection management. Normally, a CCP embedded in an iframe (via initCCP( )) is not eligible to participate in this leader election for softphone connection management. With "allowFramedSoftphone", the CCP in the iframe is allowed to participate in leader election in this way.

The reason that this limitation exists is to prevent navigation on the parent page from dropping the softphone call, since it must be attached to an open tab/frame. Some situations where using "allowedFrameSoftphone" makes sense include:

  • Single page apps that the user will keep open for their entire usage session.
  • CRM systems with PJAX style navigation that can support reloading page content without reloading the CCP iframe.

To address the signin issues above: The signin page is not allowed to be hosted in an iframe, this is why the CCP will launch a popup window with the login page if calling initCCP( ) yields an empty iframe. Make sure you allow popups from your Amazon Connect instance domain to keep this popup from being suppressed.

Thanks!

Lain

from amazon-connect-streams.

pbal avatar pbal commented on June 14, 2024 1

Observing same thing - after closing popup window - call is not answered in the iframe.

from amazon-connect-streams.

sromocki avatar sromocki commented on June 14, 2024 1

@HandyG52 Yea, that was it. I whitelisted my URL and everything works as expected now. Thanks!

from amazon-connect-streams.

pbal avatar pbal commented on June 14, 2024

Per my experience -
set softphone.allowFramedSoftphone: true during init.
also make sure there is no exception logged in console

from amazon-connect-streams.

sromocki avatar sromocki commented on June 14, 2024

I'm confused by what allowFramedSoftphone is supposed to allow.

allowFramedSoftphone: Normally, the softphone microphone and speaker components are not allowed to be hosted in an iframe. This is because the softphone must be hosted in a single window or tab. The window hosting the softphone session must not be closed during the course of a softphone call or the call will be disconnected. If allowFramedSoftphone is true, the softphone components will be allowed to be hosted in this window or tab.

I'm trying to load the CCP inside an iFrame in my application, so essentially it's an iFrame in an iFrame. I'm not able to login or access my microphone if I use this approach. If I open the application in a separate tab everything works fine.

from amazon-connect-streams.

sromocki avatar sromocki commented on June 14, 2024

@supelee OK thanks, I will use the login popup for now. The original issue I described remains though. I'm not able to accept a call unless I have "https://lily.us-east-1.amazonaws.com/connect/ccp#/" open in a separate tab.

from amazon-connect-streams.

sromocki avatar sromocki commented on June 14, 2024

I configure the ccpApp using:

global.connect.core.initCCP(e, {
   ccpUrl:        "https://lily.us-east-1.amazonaws.com/connect/ccp#/",        /*REQUIRED*/
   loginPopup:    true,          /*optional, default TRUE*/
   softphone:     {              /*optional*/
      allowFramedSoftphone: true,
      disableRingtone:  true    /*optional*/
   }
});

I downloaded the log for when the call is repeatedly not able to connect.

agent-log-cannot-connect.txt

from amazon-connect-streams.

supelee avatar supelee commented on June 14, 2024

sromocki@:

From the logs you attached, I think this is your culprit:

{
            "component": "softphone",
            "level": "ERROR",
            "text": " Softphone error occurred :  microphone_not_shared Your microphone is not enabled in your browser. ",
            "time": "2017-08-03T20:25:54.608Z",
            "exception": null,
            "objects": [],
            "line": 2
        }

This error indicates that the getUserMedia( ) call failed as there is no microphone available to the browser. This will prevent softphone from initializing and you won't be able to make or receive calls using softphone until this is remedied.

from amazon-connect-streams.

sromocki avatar sromocki commented on June 14, 2024

Hmm, I've added https://lily.us-east-1.amazonaws.com:443 to be allowed for microphone access in Chrome. It only prompts me for access to the microphone outside of the iframe. I allow it, but the app inside the iframe still does not have access. I don't believe Chrome supports adding specific domain names to an exception list for microphone access so I'm a bit stuck. @pukhrajbal Do you see the microphone access notification for the app inside the iframe?

screen shot 2017-08-04 at 6 22 34 pm

from amazon-connect-streams.

sromocki avatar sromocki commented on June 14, 2024

@supelee I found out why my microphone was being blocked. It's because I'm using HTTP and a domain name other than just localhost for testing locally and getUserMedia only works with HTTPS. I'm able to gives Chrome some command line args to workaround it:

/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --user-data-dir=/tmp/chrome-tmp --unsafely-treat-insecure-origin-as-secure="http://myhost-localhost:3000"

However, now I'm seeing a different error related to running the app in an iframe:
Refused to display 'https://lily.us-east-1.amazonaws.com/connect/ccp#/' in a frame because it set 'X-Frame-Options' to 'sameorigin'.

Currently researching how to get around this.

from amazon-connect-streams.

HandyG52 avatar HandyG52 commented on June 14, 2024

from amazon-connect-streams.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.