Amazon Connect Streams API (Streams) allows developers to create custom agent experiences for Amazon Connect. The code for Streams is hosted in GitHub and open for community contributions in the form of pull requests. This is the fourth installment of my running series covering changes to the Streams API. Prior installments can be found here:
Newly Approved Pull Requests
Since last time, there has been 1 approved pull request (PR) to Streams.
Re-initializing the CCP in Streams Apps (PR #78)
PR #78 is a code change to the core.js file that adds clean-up logic to the terminate function called when tearing down the CCP. This clean-up logic unsubscribes all existing event handlers from the Streams internal event bus, then re-initializes the bus and resets some other internal state variables as shown in the code snippet below:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/**————————————————————————- | |
* Uninitialize Connect. | |
*/ | |
connect.core.terminate = function() { | |
connect.core.client = new connect.NullClient(); | |
connect.core.masterClient = new connect.NullClient(); | |
var bus = connect.core.getEventBus(); | |
if(bus) bus.unsubscribeAll(); | |
connect.core.bus = new connect.EventBus(); | |
connect.core.agentDataProvider = null; | |
connect.core.upstream = null; | |
connect.core.keepaliveManager = null; | |
connect.agent.initialized = false; | |
connect.core.initialized = false; | |
}; |
Prior to this PR, if you tore down the CCP and then tried to start it up again in a Streams app by calling initCCP, the new CCP would behave oddly. You’d get multiple event notifications in your Streams code making it difficult to manage calls. You could see this scenario if the agent signed out of Amazon Connect and then tried to log in again through your app without refreshing the browser.
Curiously, the PR also mentions that this code change fixes the video stream attaching itself to the video element. Perhaps a hint of future plans?
This PR was submitted by GitHub user dnovicki. dnovicki just joined GitHub last week. Welcome and awesome job on a PR.
New & Open Pull Requests
There is one new PR since last time and 2 open PRs at this point:
- PR #79: Typos in gulpfile
- This PR from GitHub user odemeulder fixes a typo in the Streams build to produce a file called “connect-streams.js” not “connect-steams.js”. It also adds a note to the documentation calling out that the tool gulp is required. I expect this PR to be approved quickly.
- PR #64: Exposing rtc session for callstats integration
- I covered this PR last installment; as I said this is an interesting PR that opens up possibilities for real-time monitoring but cracks open the internals of Amazon Connect in a way that could make this PR fragile to later Streams changes
Closed Pull Requests
- PR #21: Corrects the name of two contact methods, adds text re: friendly name
- My old PR, which I closed as it has been superseded by other PR’s
Active Issues
Issues in Github are used to track problems, ask for help or suggest new features. An issue sometimes will end up spawning a PR for a code fix. Looking through the issues list on Github I saw a few recently updated issues I wanted to highlight:
- Issue #19: Login/Logout callbacks?
- davidjosephhayes added a suggestion to this long open issue that provides a way to wire up logic to agent login’s and logout’s by subscribing to events off the internal event bus
- Issue #75: agent.mute silently fails after softphone is refreshed on voice interaction
- If an agent refreshes the browser while on a call in a Streams app, things can go haywire. The audio can be lost or mute control stops working. Related to Issue #33
- (Closed) Issue #76: Dequeue Call
- asheehanbhtp was trying to manually dequeue and route calls using Streams API. This was closed as not possible
- (Closed) Issue #77: Outbound Call!
Thanks for reading. Any questions, comments or corrections are greatly appreciated. To learn more about what we can do with Amazon Connect, check out Helping You Get the Most Out of Amazon Connect