Git Product home page Git Product logo

amazon-connect-streams's Introduction

About

Build Status

The Amazon Connect Streams API (Streams) gives you the power to integrate your existing web applications with Amazon Connect. Streams lets you embed the Contact Control Panel (CCP) and Customer Profiles app UI into your page. It also enables you to handle agent and contact state events directly through an object oriented event driven interface. You can use the built in interface or build your own from scratch: Streams gives you the choice.

This library must be used in conjunction with amazon-connect-chatjs or amazon-connect-taskjs in order to utilize Amazon Connect's Chat or Task functionality.

Learn More

To learn more about Amazon Connect and its capabilities, please check out the Amazon Connect User Guide.

Usage

amazon-connect-streams is available from npmjs.com. If you'd like to download it here, you can use either of the files like release/connect-streams*.

Run npm run release to generate new release files. Full instructions for building locally with npm can be found below.

In version 1.x, we also support make for legacy builds. This option was removed in version 2.x.

Important Announcements

  1. March 2024 - In response to a Google Chrome feature launched on 7/13/2023 called Storage Partitioning, we made a short term fix on 2/10/2024 to adjust our mute functionality and synchronize the mute state across all CCPs. However, due to current limitations, this change required us to disable muting while being on hold. As a workaround, agents should mute themselves on the call before going on hold. We are planning to address this issue by August 2024 and revert back to original mute behavior.
    • At the moment, the following APIs will fail when the contact is on hold:
      • voiceConnection.muteParticipant()
      • voiceConnection.unmuteParticipant()
      • agent.mute()
      • agent.unmute()
    • As a workaround, you can mute the call prior to placing the call on hold.
  2. December 2022 - In addition to the CCP, customers can now embed an application that provides guided experiences to your agents using the connect.agentApp. See the updated documentation for details on usage.
    • Guided experiences for agents

      • With Amazon Connect you can now create guided step-by-step experiences that walk agents through tailored views that focus on what must be seen or done by the agent at a given moment during an interaction. You can design workflows for various types of customer interactions and present agents with different step-by-step guides based on context, such as call queue, customer information, and interactive voice response (IVR). This feature is available in the Connect agent workspace as well as an embeddable application that can be embedded into another website via the Streams API. For more information, visit the AWS website: https://aws.amazon.com/connect/agent-workspace/
  3. December 2022 - 2.4.2
    • This patch fixes an issue in Streams’ Voice ID APIs that may have led to incorrect values being set against the generatedSpeakerID field in the VoiceIdResult segment of Connect Contact Trace Records (CTRs). This occurred in some scenarios where you call either enrollSpeakerInVoiceId(), evaluateSpeakerWithVoiceId(), or updateVoiceIdSpeakerId() in your custom CCP integration code. If you are using Voice ID and consuming Voice ID CTRs, or updating speaker ID in your agent workflow, please upgrade to this version.
  4. December 2022 - 2.4.1
    • This version brings in updates that will provide enhanced monitoring experience to agents and supervisors, allowing to silently monitor multiparty calls, and if needed to barge in the call and take over control, mute agents, or drop them from the call. New APIs introduced with this feature are isSilentMonitor, isBarge, isSilentMonitorEnabled, isBargeEnabled, isUnderSupervision, updateMonitorParticipantState, getMonitorCapabilities, getMonitorStatus, isForcedMute.
  5. August 2022 - 2.3.0
    • [Update on 12/13/2022] Please see 2.4.2 for final resolution of the Voice ID CTR fix.
  6. Jan 2022 - 2.0.0
    • Multiple calls to initCCP will no longer append multiple embedded CCPs to the window, and only the first call to initCCP will succeed. Please note that the use-case of initializing multiple CCPs with initCCP has never been supported by Streams, and this change has been added to prevent unpredictable behavior arising from such cases.
    • agent.onContactPending has been removed. Please use contact.onPending instead. connect.onError now triggers. Previously, this api did not work at all. Please be aware that, if you have application logic within this function, its behavior has changed. See its entry in documentation.md for more details.
  7. September 2021 - 1.7.0 comes with changes needed to use Amazon Connect Voice ID, which launched on 9/27/2021. For customers who want to use Voice ID, please upgrade Streams to version 1.7.0 or later in the next 1 month, otherwise the Voice ID APIs will stop working by the end of October 2021. For more details on the Voice ID APIs, please look at the Voice ID APIs section.
  8. July 2021 - We released a change to the CCP that lets agent set a next status such as Lunch or Offline while still on a contact, and indicate they don’t want to be routed new contacts while they finish up their remaining work. For more details on this feature, see the Amazon Connect agent training guide and the feature's release notes. If your agents interact directly with Connect’s out-of-the-box CCPV2 UX, they will be able to access this feature by default. Otherwise, if your streamsJS application calls agent.setState() to switch agent status, you will need to update your code to use this feature:
    • Agent.setState() has been updated so you can pass an optional flag enqueueNextState: true to trigger the Next Status behavior.
    • A new agent.onEnqueuedNextState() listener lets you subscribe to events for when agents have selected/successfully enqueued their next status.
    • A new agent.getNextState() API returns a state object if the agent has successfully selected a next state, and null otherwise.
    • If you want to use the Next Status feature via agent.setState(), please also ensure that your code is using contact.clear() and not contact.complete() when clearing After Contact Work off a contact.
  9. December 2020 — 1.6.0 brings with it the release of a new Agent App API. In addition to the CCP, customers can now embed additional applications using connect.agentApp, including Customer Profiles and Amazon Q Connect. See the updated documentation for details on usage. We are also introducing a preview release for Amazon Connect Voice ID.
    • About Amazon Connect Customer Profiles

      • Amazon Connect Customer Profiles provides pre-built integrations so you can quickly combine customer information from multiple external applications, with contact history from Amazon Connect. This allows you to create a customer profile that has all the information agents need during customer interactions in a single place.
    • About Amazon Q in Connect

      • With Amazon Q Connect, agents can search and find content across multiple repositories, such as frequently asked questions (FAQs), wikis, articles, and step-by-step instructions for handling different customer issues. They can type questions or phrases in a search box (such as, "how long after purchase can handbags be exchanged?") without having to guess which keywords will work.
    • About Amazon Connect Voice ID (The feature is in preview release for Amazon Connect and is subject to change)

      • Amazon Connect Voice ID provides real-time caller authentication which makes voice interactions in contact centers more secure and efficient. Voice ID uses machine learning to verify the identity of genuine customers by analyzing a caller’s unique voice characteristics. This allows contact centers to use an additional security layer that doesn’t rely on the caller answering multiple security questions, and makes it easy to enroll and verify customers without changing the natural flow of their conversation.
  10. July 2020 -- We recently changed the new, omnichannel, CCP's behavior when it encounters three voice-only agent states: FailedConnectAgent, FailedConnectCustomer, and AfterCallWork.
    • FailedConnectAgent -- Previously, we required the agent to click the "Clear Contact" button to clear this state. When the agent clicked the "Clear Contact" button, the previous behavior took the agent back to the Available state without fail. Now the FailedConnectAgent state will be "auto-cleared", much like FailedConnectCustomer always has been.
    • FailedConnectAgent and FailedConnectCustomer -- We are now using the contact.clear() API to auto-clear these states. As a result, the agent will be returned to their previous visible agent state (e.g. Available). Previously, the agent had always been set to Available as a result of this "auto-clearing" behavior. Note that even custom CCPs will behave differently with this update for FailedConnectAgent and FailedConnectCustomer.
    • AfterCallWork -- As part of the new contact.clear() behavior, clicking "Clear Contact" while in AfterCallWork will return the agent to their previous visible agent state (e.g. Available, etc.). Note that custom CCPs that implement their own After Call Work behavior will not be affected by this change.
      • We are putting contact.complete() on a deprecation path. Therefore, you should start using contact.clear() in its place. If you want to emulate CCP's After Call Work behavior in your customer CCP, then make sure you use contact.clear() when clearing voice contacts.

Getting Started

Upgrading to the OmniChannel CCP (AKA CCPv2)?

If you are migrating to the new CCP, we encourage you to upgrade to the latest version of this repository. You should also upgrade to the latest version of RTC-JS as well, if you are using it. For a complete migration guide to the new CCP, and to fully understand the differences when using Streams with the new CCP, please see this post: https://docs.aws.amazon.com/connect/latest/adminguide/upgrade-to-latest-ccp.html

Allowlisting

The first step to using Streams is to allowlist the pages you wish to embed. For our customer's security, we require that all domains which embed the CCP for a particular instance are explicitly allowlisted. Each domain entry identifies the protocol scheme, host, and port. Any pages hosted behind the same protocol scheme, host, and port will be allowed to embed the CCP components which are required to use the Streams library.

To allowlist your pages:

  1. Login to your AWS Account, then navigate to the Amazon Connect console.
  2. Click the instance name of the instance for which you would like to allowlist pages to load the settings page for your instance.
  3. Click the "Application integration" link on the left.
  4. Click "+ Add Origin", then enter a domain URL, e.g. "https://example.com", or "https://example.com:9595" if your website is hosted on a non-standard port.

A few things to note:

  • Allowlisted domains must be HTTPS.
  • All of the pages that attempt to initialize the Streams library must be hosted on domains that are allowlisted as per the above steps.
  • All open tabs that contain an initialized Streams library or any other CCP tabs opened will be synchronized. This means that state changes made in one open window will be communicated to all open windows.
  • Using multiple browsers at the same time for the same connect instance is not supported, and causes issues with the rtc communication.

Downloading Streams with npm

npm install amazon-connect-streams

Importing Streams with npm and ES6

import "amazon-connect-streams"; This will make the connect variable available in the current context.

Usage with TypeScript

amazon-connect-streams is compatible with TypeScript. You'll need to use version 3.0.1 or higher:

import "amazon-connect-streams";

connect.core.initCCP({ /* ... */ });

Downloading Streams from Github

The next step to embedding Connect into your application is to download the Streams library from GitHub. You can do that by cloning our public repository here:

$ git clone https://github.com/aws/amazon-connect-streams

Once you download streams, change into the directory and build it:

$ cd amazon-connect-streams
$ make

This will generate a file called connect-streams-${VERSION}.js, this is the full Connect Streams API which you will want to include in your page. You can serve connect-streams-${VERSION}.js with your web application.

Build your own with NPM

Install latest LTS version of NodeJS

Instructions for Streams version 2.x:

$ git clone https://github.com/aws/amazon-connect-streams
$ cd amazon-connect-streams
$ npm install
$ npm run release

Find build artifacts in release directory - This will generate a file called connect-streams.js and the minified version of the same connect-streams-min.js - this is the full Connect Streams API which you will want to include in your page.

To run unit tests:

$ npm run test-mocha

Note: these tests run on the release files generated above

Instructions for Streams version 1.x:

You will also need to have gulp installed. You can install gulp globally.

$ npm install -g gulp
$ git clone https://github.com/aws/amazon-connect-streams
$ cd amazon-connect-streams
$ npm install
$ npm run release

Find build artifacts in release directory - This will generate a file called connect-streams.js and the minified version of the same connect-streams-min.js - this is the full Connect Streams API which you will want to include in your page.

To run unit tests:

$ npm run gulp-test

Note: these tests run on the release files generated above

Using the AWS SDK and Streams

Streams has a "baked-in" version of the AWS-SDK in the ./src/aws-client.js file. Make sure that you import Streams before the AWS SDK so that the AWS object bound to the Window is the object from your manually included SDK, and not from Streams.

Initialization

Initializing the Streams API is the first step to verify that you have everything setup correctly and that you will be able to listen for events.

connect.core.initCCP()

<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <script type="text/javascript" src="connect-streams-min.js"></script>
  </head>
  <!-- Add the call to init() as an onload so it will only run once the page is loaded -->
  <body onload="init()">
    <div id="container-div" style="width: 400px; height: 800px;"></div>
    <script type="text/javascript">
      var containerDiv = document.getElementById("container-div");
      var instanceURL = "https://my-instance-domain.my.connect.aws/ccp-v2/";
      // initialize the streams api
      function init() {
        // initialize the ccp
        connect.core.initCCP(containerDiv, {
          ccpUrl: instanceURL,            // REQUIRED
          loginPopup: true,               // optional, defaults to `true`
          loginPopupAutoClose: true,      // optional, defaults to `false`
          loginOptions: {                 // optional, if provided opens login in new window
            autoClose: true,              // optional, defaults to `false`
            height: 600,                  // optional, defaults to 578
            width: 400,                   // optional, defaults to 433
            top: 0,                       // optional, defaults to 0
            left: 0                       // optional, defaults to 0
          },
          region: "eu-central-1",         // REQUIRED for `CHAT`, optional otherwise
          softphone: {                    // optional, defaults below apply if not provided
            allowFramedSoftphone: true,   // optional, defaults to false
            disableRingtone: false,       // optional, defaults to false
            ringtoneUrl: "[your-ringtone-filepath].mp3" // optional, defaults to CCP’s default ringtone if a falsy value is set
            allowFramedVideoCall: true,    // optional, default to false
            allowEarlyGum: true    //optional, default to true
          },
          task: {
            disableRingtone: false, // optional, defaults to false
            ringtoneUrl: "[your-ringtone-filepath].mp3", // optional, defaults to CCP's default ringtone if a falsy value is set
          },
          pageOptions: { //optional
            enableAudioDeviceSettings: false, //optional, defaults to 'false'
            enableVideoDeviceSettings: false, //optional, defaults to 'false'
            enablePhoneTypeSettings: true //optional, defaults to 'true' 
          },
          shouldAddNamespaceToLogs: false, //optional, defaults to 'false'
          ccpAckTimeout: 5000, //optional, defaults to 3000 (ms)
          ccpSynTimeout: 3000, //optional, defaults to 1000 (ms)
          ccpLoadTimeout: 10000 //optional, defaults to 5000 (ms)
         });
      }
    </script>
  </body>
</html>

Integrates with Connect by loading the pre-built CCP located at ccpUrl into an iframe and placing it into the containerDiv provided. API requests are funneled through this CCP and agent and contact updates are published through it and made available to your JS client code.

  • ccpUrl: The URL of the CCP. This is the page you would normally navigate to in order to use the CCP in a standalone page, it is different for each instance.
  • region: Amazon connect instance region. ex: us-west-2. only required for chat channel.
  • loginPopup: Optional, defaults to true. Set to false to disable the login popup
    which is shown when the user's authentication expires.
  • loginOptions: Optional, only valid when loginPopup is set to true. Provide an object with the following properties to open loginpopup in a new window instead of a new tab.
    • autoClose: Optional, defaults to false. Set to true to automatically close the login popup after the user logs in.
    • height: This allows you to define the height of the login pop-up window.
    • width: This allows you to define the width of the login pop-up window.
    • top: This allows you to define the top of the login pop-up window.
    • left: This allows you to define the left of the login pop-up window.
  • loginPopupAutoClose: Optional, defaults to false. Set to true in conjunction with the loginPopup parameter to automatically close the login Popup window once the authentication step has completed. If the login page opened in a new tab, this parameter will also auto-close that tab. This can also be set in loginOptions if those options are used.
  • loginUrl: Optional. Allows custom URL to be used to initiate the ccp, as in the case of SAML authentication.
  • softphone: This object is optional and allows you to specify some settings surrounding the softphone feature of Connect.
    • 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.
    • disableRingtone: This option allows you to completely disable the built-in ringtone audio that is played when a call is incoming.
    • ringtoneUrl: If the ringtone is not disabled, this allows for overriding the ringtone with any browser-supported audio file accessible by the user. To use the default ringtone comment out this line.
  • pageOptions: This object is optional and allows you to configure which configuration sections are displayed in the settings tab.
    • enableAudioDeviceSettings: If true, the settings tab will display a section for configuring audio input and output devices for the agent's local machine. If false, or if pageOptions is not provided, the agent will not be able to change audio device settings from the settings tab. will not be displayed.
    • enableVideoDeviceSettings: If true, the settings tab will display a section for configuring video input devices for the agent's local machine. If false, or if pageOptions is not provided, the agent will not be able to change video device settings from the settings tab. will not be displayed.
    • enablePhoneTypeSettings: If true, or if pageOptions is not provided, the settings tab will display a section for configuring the agent's phone type and deskphone number. If false, the agent will not be able to change the phone type or deskphone number from the settings tab.
  • shouldAddNamespaceToLogs: prepends [CCP] to all logs logged by the CCP. Important note: there are a few logs made by the CCP before the namespace is prepended.
  • ccpAckTimeout: A timeout in ms that indicates how long streams will wait for the iframed CCP to respond to its SYNCHRONIZE event emissions. These happen continuously from the first time initCCP is called. They should only appear when there is a problem that requires a refresh or a re-login.
  • ccpSynTimeout: A timeout in ms that indicates how long streams will wait to send a new SYNCHRONIZE event to the iframed CCP. These happens continuously from the first time initCCP is called.
  • ccpLoadTimeout: A timeout in ms that indicates how long streams will wait for the initial ACKNOWLEDGE event from the shared worker while the CCP is still standing itself up.

A few things to note:

  • You have the option to show or hide the pre-built UI by showing or hiding the containerDiv into which you place the iframe, or applying a CSS rule like this:
#container-div iframe {
  display: none;
}
  • The CCP UI is rendered in an iframe under the container element provided. The iframe fills its container element with width: 100%; height: 100%. To customize the size of the CCP, set the width and height for the container element.
  • The CCP is designed to be responsive (used in various sizes). The smallest size we design for is 320px x 460px. For a good user experience, we recommend that you do not go smaller than this size.
  • CSS styles you add to your site will NOT be applied to the CCP because it is rendered in an iframe.
  • If you are trying to use chat specific functionalities, please also include ChatJS in your code. We omit ChatJS from the Makefile so that streams can be used without ChatJS. Streams only needs ChatJS when it is being used for chat. Note that when including ChatJS, it must be imported after StreamsJS, or there will be AWS SDK issues (ChatJS relies on the ConnectParticipant Service, which is not in the Streams AWS SDK).
  • If you are building your own video functionalities, please also include Amazon Chime SDK JS in your code. You can also include Amazon Chime SDK Component Library React to leverage ready-to-use UI and state managements components in React.
  • If you are using task functionalities you must include TaskJS. TaskJS should be imported after Streams.
  • If you'd like access to the WebRTC session to further customize the softphone experience you can use connect-rtc-js. Please refer to the connect-rtc-js readme for detailed instructions on integrating connect-rtc-js with Streams.

Where to go from here

Check out the full documentation here to read more about subscribing to events and enacting state changes programmatically.

amazon-connect-streams's People

Contributors

aguecida avatar andyhopp avatar andywang219 avatar baskruegamzn avatar bretticus-mc avatar ctwomblyamzn avatar danbee-park avatar h3adache avatar hfahlbusch avatar hngan avatar jagadeeshaby avatar kbk-amzn avatar labelson avatar limamazon avatar marcogrcr avatar maronov-amzn avatar martin-greenberg avatar minsookamzn avatar mschersten avatar randalld-aws avatar samschiff avatar scoland avatar seiyako avatar shishkev avatar supelee avatar tannera926 avatar vpogudina avatar vs-amzn avatar yaminli-aws avatar zesheng-amazon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

amazon-connect-streams's Issues

CCP inconsistently fails to load

I'm not including any of my code, because this is a problem even on the demo site (connectdemo.com).

When I load a page embedding the CCP, it doesn't work on some of my computers. Sometimes it will cause the login popup, but even then not load the softphone, and sometimes it won't even load the popup. This comes along with the usual "Refused to display.../ccp#/ in a frame because it set 'X-Frame-Options' to 'sameorigin'. That error comes from the actual page (callAttributes.html in this case, on the demo site).

But I've noticed something new here: I'm also receiving an error from connectCCP.js (or amazon-connect....js, if you're using your own build). It comes first from line 20398, and then from 20472 after the login is popped.

GET https://DOMAIN.awsapps.com/connect/ccp net::ERR_BLOCKED_BY_RESPONSE

Note that there is no '#/' at the end of that. Whatever the '#/' is for, is it something that some of my computers are able to overlook, and others are not?

Here's the code from Streams that triggers the error before the login popup:

      // Create the CCP iframe and append it to the container div.
      var iframe = document.createElement('iframe');
      iframe.src = params.ccpUrl;
      iframe.style = "width: 100%; height: 100%";
      iframe.allow = "microphone";
      containerDiv.appendChild(iframe); // This is line 20398

And here is after the login:

         if (connect.core.iframeRefreshInterval == null) {
            connect.core.iframeRefreshInterval = window.setInterval(function() {
               iframe.src = params.ccpUrl; // This is line 20472
            }, CCP_IFRAME_REFRESH_INTERVAL);

            conduit.onUpstream(connect.EventType.ACKNOWLEDGE, function() {
               this.unsubscribe();
               global.clearInterval(connect.core.iframeRefreshInterval);
               connect.core.iframeRefreshInterval = null;
               connect.core.getPopupManager().clear(connect.MasterTopics.LOGIN_POPUP);
            });
         }

And here is where that params.ccpUrl is set:

      var params = {};
      if (typeof(paramsIn) === 'string') {
         params.ccpUrl = paramsIn;
      } else {
         params = paramsIn;
      }

I'm not sure where paramsIn is being set, but that might be the issue.

Streams API creates AWS object without all constructors?

If I load the following page from an S3 bucket:

<html>
<script type="text/javascript" src="https://sdk.amazonaws.com/js/aws-sdk-2.204.0.min.js"></script>
</html>

<script type="text/javascript" >
	AWS.config.update({
		region: "us-east-1"
		});
	console.log(AWS);
	var dynamodb = new AWS.DynamoDB();
	console.log(dynamodb);
</script>

Everything works fine. However, if I include the streams API, as

<script src="amazon-connect-v1.2.0-2-g5fc44af.js"></script>

I receive the error

Uncaught TypeError: AWS.DynamoDB is not a constructor

If I load it locally, where Connect is not whitelisted, I receive no error. If I look at the AWS object in the console, with Streams loaded it starts with CognitoIdentity, while without Streams I have ACM, APIGateway, etc, as well as DynamoDB, that are all missing with Streams.

I've been developing all in one file, so hopefully breaking my DynamoDB work out into another file will solve this. Does anyone have any other ideas?

Agent.getEndpoints function missing in Docs

from lily prod js file

getAgent().getEndpoints(skillIds, {
    success: function(data) {
        var addresses = data.addresses;
        if (isOutbound) {
            addresses = addresses.filter(function(addr) {
                return addr.type === lily.AddressType.PHONE_NUMBER;
            });
        }
        if (callbacks && callbacks.success) {
            callbacks.success(addresses);
        }
    },
    failure: function(err, data) {
        if (callbacks && callbacks.failure) {
            callbacks.failure(err, data);
        }
    }
});

However, Agent.getEndpoints is not on the docs

Makefile not working on Windows (not compatible with nmake)

The supplied makefile does not work on windows with visual studio. This is what happens if I run it in a Visual Studio command shell using "nmake":

Microsoft (R) Program Maintenance Utility Version 14.13.26131.1
Copyright (C) Microsoft Corporation.  All rights reserved.

makefile(6) : fatal error U1000: syntax error : ')' missing in macro invocation
Stop.

AMAZON CONNECT ISSUE

REFUSED TO DISPLAY ..... IN A FRAME BECAUSE IT SET X-FRAME-OPTIONS TO SAMEORIGIN

ACK_TIMEOUT OCCURRED, ATTEMPTING TO POP THE LOGIN PAGE IF NOT ALREADY OPEN

OUR CONFIGURATION 👍

<title>Amazone Connect</title>
<script type="text/javascript" src="{{ asset('js/amazon-connect-v1.2.0.js') }}"></script> <script type="text/javascript"> connect.core.initCCP(containerDiv, { ccpUrl: 'https://INSTANCENAME.awsapps.com/connect/ccp#', loginPopup: true, softphone: { allowFramedSoftphone: true } }); </script>

initialConnection.isConnected() not available

dialNumber.zip
Hi,

I've created a button to call a particular number.
This number can be directly called or it can also be called as a third party.
The first time I initialises the app, if I use this button it is working fine.
If I use this button to add a third party is working also fine, but if next I try to use this button to call directly without having another active connection, it is no longer working.
I get his error:

amazon-connect-v1.0.2.js:20450 Uncaught connect.StateError {}

I've checked that it is because for some reasons the function initialConnection.isConnected(); is not available, Although I can access the initialConnection object, I can't get any information from it.

I've attached my code

Thanks

Notification.requestPermission from iframe deprecated

The embedded ccp iframe attempts to call Notification.requestPermission directly and as a result we receive the following warning in Chrome console:

Using the Notification API from an iframe is deprecated and will be removed in M61, around September 2017. You should consider requesting permission from the top-level frame or opening a new window instead. See [https://www.chromestatus.com/feature/6451284559265792] for more details.
connect.NotificationManager.requestPermission @ lily_ccp_Prod_899828371c0911102feac318ba0a72696081e3ce.gz.js:sourcemap:23126

Is there a way to force CCP to perform the notification permission request in a separate window, instead of from within the iframe?

Accepted Calls Stalling at "Connecting..."

Hello, @supelee and community.

Is there an issue with the following API code for accepting an incoming voice contact? It appears to work some times and not others, and is proving to be a huge frustration. When the accept attempt does not work, the subscribed "success" function for acceptCall is still fired, yet the CCP can still stall out while displaying "Connecting...". It then rolls over into the missed call state without ever reaching "Connected".

// Agent initializes, and persists into activeAgent.
var activeAgent;
connect.agent(function(agent) {
    console.log("Agent detected (init function fired)");
    activeAgent = agent;
});

connect.contact(function (contact) {
    contact.onConnecting(function (liveContact) {
        console.log("Contact detected");
        acceptCall();
    });
});

function getVoiceContact() {
    return activeAgent.getContacts()[0];
}

function acceptCall() {
    getVoiceContact().accept({
        success: function () {
            console.log("API reports call accepted successfully (this message is part of the 'success' function firing).");
        },
        failure: function (data) {
            console.log("Failed to accept the call. Troubleshooting data: " + data);
        }
    });
}

Amazon Connect

Hi,

I have created a html page which is embedded with Amazon Connect Contact Control Panel. But i am unable to receive the incoming calls

Please help me out

How can I access the data of other connected agents?

Hi,

How can I get the data of other agents connected to the CCP?
I would like to transfer call between agents, but I can't find how to see if there are other agents connected or not.
I tried to use agent.getContacts(), but it returns an empty array.
Thanks

Update Contact Attributes

Is there any API method to update the contact attributes? If not, any instructions on how to update the contact attributes

Iframe in the same window

Hello there!

I've embedded ACS into React and I have question how can I insert this url (https://{alias}.awsapps.com/connect/ccp) as an Iframe in the same window?

Because when I do it, I have tons of errors in the console.

screen shot 2017-09-05 at 6 21 19 pm

Embedded CCP works on Linux but not on Windows

I have a new issue, similar to others, but with a new twist.

The following page works perfectly when accessed from my Linux box: simple_sample.html.zip. I had to whitelist my domain to make it work, of course, and it operates as expected, opening the login in a new window and reverting back to the CCP, and loading the CCP embedded in my page.

But on Windows, while it will open the login the first time I use it (or after I clear my cache) and revert back to the CCP in that new window, the CCP never loads embedded in my page. I get the common "Refused to display '' in a frame because it set 'X-Frame-Options' to 'sameorigin'" error that others have seen due to either a whitelisting problem or due to the wrong CCP URL (/login instead of /ccp#).

I do receive one warning in the console on Linux, "[Deprecation] Permission for the Notification API may no longer be requested from a cross-origin iframe. You should consider requesting permission from a top-level frame or opening a new window instead. See https://www.chromestatus.com/feature/6451284559265792 for more details." This may not be related, but so far it's the only other lead that seems like it could be relevant.

Streams not working in chrome 64 and higher version.

I picked this change, still when i am opening embedded softphone, i am getting following error on chome 64 and higher version:
[FATAL] CSM initialization failed! Please make sure the sharedWorkerUrl is reachable.

While digging further, i figured out that its coming from https://d1f0uslncy85vb.cloudfront.net/js/lily_ccp_Prod_5e1b1a77acd07587cf93bca7cc55abfc3a831504.gz.js, when shared worker is not able to receive messages.

Steps to reproduce:

  1. open amazon connect softphone in one tab of chrome.
  2. use streams to open customized softphone in next tab of chrome.

Did anyone else experienced the similar behavior? any resolution around this?

get contact information from lambda

Hi,
I'm trying to get contact information such as ID or Phone Number from lambda. I've placed one lambda in my contactFlow after the start block. I have some issues now:
My lambda doesn't invoke when I receive the call!
Do I need to enable Kinesis in my Amazon connect instance to use stream Api?
How do I use stream api from lambda?I can't find how to use connect-streams's functions inside my code! for example when you want to use "fs", you use the module by using "const fs = require'fs' ".how about for connect-stream?!
please help!

Get Contact Number from an Incoming Call

Is there any way to get the contact number from an inbound call using the Contact API provided in the connect streams API doc? I am not sure if we can get the contact number from the given API event functions.

Contact event not getting triggered

When a phone call is received subscription events for contact.onIncoming (also onMissed) are not getting triggered. As a result caller number cannot be accessed while the phone is ringing.
ContactData is available once the call completes on onEnded event.

Unable to terminate CCP without maintaining previous context

I am using the amazon-connect-streams JavaScript library to create a web portal for an agent, for a audio teleconference solution for the application, and am looking for assistance on how to terminate the connect session correctly to support a 'logout' function of my app. My issue is related to an existing Github issue [1].

I’ve been able to reproduce a bug consistently where I see a multiple ccp windows open error message in the console despite only one tab being open. I strongly suspect the issue I'm running into is related to my web application not terminating the CCP client correctly – since an initial load of CCP (using connect.core.initCCP) in the application in an incognito window never surfaces the error described.

I only see the issue if an Agent logs out and then logs back in the same tab, even if it is an incognito window / tab. When an Agent relogs back into the app, I re-initialize the CCP by using the connect.core.initCCP method and see the multiple ccp windows open error message when the Agent has accepted an inbound call. I am currently using the function “connect.core.terminate" in core.js of the amazon-connect-streams js library [2] on logout to terminate CCP.

Can you please provide some guidance about how to terminate the app correctly? I'd like to be able to detach the iframe and to clear any state in the web worker / local storage stored by the Connect SDK.

[1] #13
[2] https://github.com/aws/amazon-connect-streams/blob/5fc44af68939a2016cc1c6fd...

Subscribe methods do not return subscription object

The documentation at https://github.com/aws/amazon-connect-streams/blob/master/Documentation.md#event-subscription and at https://github.com/aws/amazon-connect-streams/blob/master/Documentation.md#note states that the event bus and event bus helper methods (.on*) for subscribing to events return a subscription object. Which later on you can call .unsubscribe() on to unsubscribe from future notifications.

This does not match the behavior or source code. In the event.js file, if you look at the EventBus subscribe's method and track it through, you can see the problem:

`
/**
* Subscribe to the named event. Returns a new Subscription object
* which can be used to unsubscribe.
*/
EventBus.prototype.subscribe = function(eventName, f) {
connect.assertNotNull(eventName, 'eventName');
connect.assertNotNull(f, 'f');
connect.assertTrue(connect.isFunction(f), 'f must be a function');
return this.subMap.subscribe(eventName, f);
};

/**
* Add a subscription for the named event. Creates a new Subscription
* object and returns it. This object can be used to unsubscribe.
*/
SubscriptionMap.prototype.subscribe = function(eventName, f) {
var sub = new Subscription(this, eventName, f);
this.subIdMap[sub.id] = sub;
var subList = this.subEventNameMap[eventName] || [];
subList.push(sub);
this.subEventNameMap[eventName] = subList;
};`

So the SubscriptionMap subscribe function is not returning anything (undefined). Looks like it needs a return statement at the end to return the 'sub' object.

The .on* methods like agent.onRefresh use the event bus subscribe under the covers.

I would like this functionality to work to add better tear down code when someone logs out of the CCP and in general be able to better manage event subscriptions in my code.

How can I login or logout using the streams API?

Hello,

I was wondering if it's possible to log an agent in and out using the Streams API. Since I will be eventually hiding the Amazon CCP application I need to be able to do this functionality. Also, is SSO a possibility?

Thanks,
Sean

How to use Connection API ?

How to invoke connection API ?

I tried connect.connection.getContactId() but the method seems unavailable. It wasn't clear from the docs how to use these methods. connect.contact and connect.agent seems to be working great. Is there anything I'm doing wrong ?

Any thoughts are much welcome. Thanks.

Queues

Hi,

Is that possible to find a contact from agent queues/connections with a phone number?

Get AgentId

I'm unable to get the ID of the agent that login. I noticed the ID is stored in cookies on the pop-up.
Can we add the AgentId on aget snapshot and contact snapshot.

Also if possible how to get the ID with current available functions

X-Frame-Options sameorigin

Hasn't been answered on the AWS forum, hoping I can get an answer here. Setting up a test for Connect with a bare page. Single DIV, amazon-connect.js, and the connect.core.initCCP call. Regardless of whether I set ccpUrl to "https://domain.awsapps.com/connect/home", "https://domain.awsapps.com/connect/login", or "https://domain.awsapps.com/connect/ccp" as provided in the administration console, I receive:

Refused to display 'https://domain.awsapps.com/connect/home' in a frame because it set 'X-Frame-Options' to 'sameorigin'.
amazon-connect.js:20361 GET https:///domain.awsapps.com/connect/home net::ERR_BLOCKED_BY_RESPONSE

Removing the path tries to redirect the entire page and fails with "Access Error
This application has not been enabled for your directory. Please contact your Administrator for more details." Trying "https://domain.awsapps.com/connect" populates the iframe with an AccessDenied XML response, despite whitelisting the domain hosting the test.

What am I missing?

For reference:
connect.core.initCCP(awsConnect, {
ccpUrl: "https://domain.awsapps.com/connect/ccp",
loginPopup: true,
softphone: {
disableRingtone: false
}
});

Recording Control from CCP

Hi,

Is there a way to start/stop the recording of amazon connect agent conversation with customer from CCP embedded html?

Thanks

Cannot connect to an incoming call using only CRM initialized CCP app

Steps to reproduce:

1.) Initialize CCP app inside my application.
2.) Place a call to connect call queue.
3.) I can see the prompt to accept the incoming call, I press accept.
4.) Stays on "Connecting" for sometime and then eventually says "Missed Call".

Only way to accept the call that I found was to:
1.) Initialize CCP app inside my application.
2.) Open the CCP app inside Amazon Connect console.
3.) Place a call to connect call queue.
4.) I can see the prompt to accept the incoming call, I press accept.
5.) I'm able to connect to the call.

If the CCP app, that has the same ccpUrl that I initialize the ccp app with, is not open in another tab then I will not be able to accept the incoming call.

contact.getState() and contact.getStateDuration() Methods not available

The methods contact.getState() and contact.getStateDuration() are not available Instead contact.getStatus() and contact.getStatusDuration() are available. I just wanted to bring this to your attention.

EDIT: Also, connection.getState() and connection.getStateDuration() are not available too, Instead connection.getStatus() and connection.getStatusDuration() are available.

But In Agent API agent.getState(), agent.getStatus(), agent.getStateDuration, agent.getStatusDuration all this FOUR methods are available.

If Possible please update the documentation properly.

Thanks.

Devan

Closing login page

One of the issues people have had with the login process is that the login page remains open after logging in, and converts to a CCP that needs to be closed manually so the agent can use the custom CCP.

Would it be possible to get the handle of the login popup to use window.close() to close it?

First, we load the CCP or login with connect.core.initCCP(). I can find that in the Streams API source at (in my build) line 20373, with the login popup at line 20465:

connect.core.getPopupManager().open(loginUrl, connect.MasterTopics.LOGIN_POPUP);

Then starting on line 17883, I find this:

connect.PopupManager.prototype.open = function(url, name) {
  var then = this._getLastOpenedTimestamp(name);
  var now = new Date().getTime();

  if (now - then > ONE_DAY_MILLIS) {
     var win = window.open('', name);
     if (win.location !== url) {
        window.open(url, name);
     }
     this._setLastOpenedTimestamp(name, now);
  }
}

So can we find someway to get a hold of that "win" var, to then do win.close() after the agent is logged in? We would probably not want to return that from connect.core.initCCP(), but can we do something like this?

var loginPopup = connect.core.getLoginPopup()
loginPopup.close()

This was a late-night thought, and I haven't tried anything from this yet. Any input is appreciated.

Chrome: Remove Usage of Notifications from iFrames - Chrome Platform Status

According to https://www.chromestatus.com/feature/6451284559265792, the following code in streams library is suspect. Please advise.
`connect.NotificationManager.prototype.requestPermission = function() {
var self = this;
if (!("Notification" in global)) {
connect.getLog().warn("This browser doesn't support notifications.");
this.permission = NotificationPermission.DENIED;

  } else if (global.Notification.permission === NotificationPermission.DENIED) {
     connect.getLog().warn("The user has requested to not receive notifications.");
     this.permission = NotificationPermission.DENIED;

  } else if (this.permission !== NotificationPermission.GRANTED) {
     global.Notification.requestPermission(function(permission) {
        self.permission = permission;
        if (permission === NotificationPermission.GRANTED) {
           self._showQueued();

        } else {
           self.queue = [];
        }
     });
  }

};`

can amazon-connect-streams support logout function?

I have supported Single Logon by SAML with AWS Connect,But when I want to Single Logout,I found no way to support this feature, if the streams javascript API support logout current login agent ,that would be great job! thanks!

Outbound call success return the new connectionId

Hello, it would be helpful for me to have the new connectionId returned in the outbound call success callback so that I can take appropriate action. Right now, I'm only handling outbound call success when a new connection arrives and is in the "connected" state.

global.connect.agent((agent: any) => {
              const endpoint = global.connect.Endpoint.byPhoneNumber(phoneNumber);
              console.log('Making outbound call to: ' + phoneNumber);
              agent.connect(endpoint, {
                success: () => { // connectionId available here as an argument
                  console.log('Make call success!');
                },
                failure: () => {
                  console.log('Make call fail!');
                }
              });
});

'destroyContact' API request failed

Hi,

I am running the following scenario:

  1. Call to the IVR.
  2. Call routed to the agent CCP
  3. Call automatically accepted using contact.accept()
  4. After 10 seconds I am trying to disconnect call using contact.destroy() and getting the following error:

[2017-07-27T20:49:11.939Z] [ERROR]: 'destroyContact' API request failed: Error
ERROR @ lily_ccp_Prod_8998283….gz.js:22343
Logger.addLogEntry @ lily_ccp_Prod_8998283….gz.js:22570
(anonymous) @ lily_ccp_Prod_8998283….gz.js:25513
(anonymous) @ lily_ccp_Prod_8998283….gz.js:23446
EventBus.trigger @ lily_ccp_Prod_8998283….gz.js:23444
Conduit._dispatchEvent @ lily_ccp_Prod_8998283….gz.js:23759
(anonymous) @ lily_ccp_Prod_8998283….gz.js:22770
16:49:12.733

Any ideas?

Thank you.
Yan

Api for selecting Microphone and speakers

I miss in the API a callback which can filter Speaker and Mic devices which the CCP uses for:

  • Phone calls
  • Ring tones

It can be very simple call back which just returns CONSTRAINTS for navigator.mediaDevices.getUserMedia(). Something like:

function contactConstraints() {
    return {
        deviceId: {
            exact: [inAudioDevSelected, outAudioDevSelected]
        }
    };
}

function ringConstraints() {
    return {
        deviceId: {
            exact: outRingDevSelected
        }
    };
}

connect.core.initCCP(iframeContainer, {
    ccpUrl: url,
    loginPopup: false,
    softphone: {
        allowFramedSoftphone: true,
        disableRingtone: false
    },
    contactAudioConstraints: contactConstraints,
    ringTonesAudioConstraints: ringConstraints
});

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.