matt22 | 2021-05-20 13:24:09 UTC | #1
Hey the community !
I'm sharing what we have done on our side. I had a lot of request in customer care to have a Ringing Alert on Wallboard when calls waiting. For some queues where not always people at there desk it is really helpful.
Genesys Cloud wallboard do not get that, so we used tampermonkey and javascript.
Here an example.
Blockquote
// ==UserScript== // @name Play sound when word appears on a page // @include https://apps.apne2.pure.cloud/* // @include https://apps.mypurecloud.de/* // @exclude embedded // @require https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js // @require https://gist.github.com/raw/2625891/waitForKeyElements.js // @grant GMaddStyle // @grant GM.getValue // @version 1.1 // ==/UserScript== /* eslint-disable no-multi-spaces / //- The @grant directives are needed to restore the proper sandbox. / global $, waitForKeyElements / //-- Set the watched terms using the awesome power of regex. var watchRegx = /\b[1-9]+\b/i; var watchRegx2 = /\b[0]+\b/i; //Setting of the ifram and indicator to look for (here it is one number on the grid var frameName = ".main-iframe iframe"; var widgetName = ".widget-container.grid-row-1.grid-column-1"; var timer = 5000; // The audio in base 64 to play var alrtSound = new Audio ("data:audio/wav;base64,UklGRkwVAABXQVZFZm10IBAAAAABAAEAQB8AAEAfAAABAAgAZGF0YScVAAB/fn1+g4B5eYKMfnB5j5F2a4Gej2ppk6d/XYCngmqVll14xI02edeMNIfEa065sC5a66gVYu+UIYXbZzW8xjFJ6LUUXvSZGoXlaC620DpG4LMeY/GVF4XqbSev1ENC1bYjYOmUF4Lqbh+p1kY3zbciXOSQEYHrZxWm3kAqyLwkUN+RD33pZA+k4D8ixcQfReCYDHHsawme5EEZxcwfNuGqC2HsegeT6EoTv9UlLty0EFbriAyJ5lcYuNUvMdm4GFXsjhCD7GMWst46Lta+HlTslRKB8GoXrOFCMc7DJVXnlxh+7Wsbq95EMNC/IljmkxaF6GYdsNY+NtG1IV7jiheJ5FwftM84O9GuIGHgghuM3Fknsck2QM+nImbbfR6P1FcsscE3RsugJGrYeR+T1FMst780SdCfI2zbeyCU1lIxvcAzS9mdJnLcdyib1l8pqdVhOZK/g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gYB/foCBgH9/gIB/f3+AgH9/gICAf3+AgH9/f4CAf39/gIB/f4CAf39/gIB/f3+AgH9/gICAf3+AgH9/f4CAf3+AgIB/f4CAf39/gIB/f4CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAA"); //Variables var cntnrNode = null; var timerId = 0; //CODE console.log("DEBUG START"); waitForKeyElements (frameName, function(){ document.querySelector(frameName).addEventListener('load',function(){ console.log("DEBUG iframe Loaded"); waitForKeyElements (widgetName, function(elements){ //console.log("DEBUG widget 1 Loaded"); //console.log(elements); elements.each(function(){ var wordObsrv = new MutationObserver (alertOnWord); console.log("DEBUG listener on : "+ this); wordObsrv.observe (this, {childList: true, subtree: true, attributes: true} ); }); },true,frameName); }); }); //Alert function function alertOnWord (mutationRecords) { //console.log('Mutations', mutationRecords) //console.log("DEBUG alertOnWord"); mutationRecords.forEach (muttn => { //console.log("[PLAYER] object type '" + muttn.type + "' a été modifié."); //console.log(muttn.target); if (muttn.type === "childList" && typeof muttn.addedNodes === "object") { muttn.addedNodes.forEach (newNode => { /-- Restrict the kinds of nodes watched for better performance and/or to avoid false positives. */ //console.log("New NODE : "+newNode.nodeName); //console.log(newNode); //if (!(newNode instanceof HTMLElement)) return; if (newNode.nodeName === "#text") { console.log("#text NODE : "+newNode.textContent); if (watchRegx.test (newNode.textContent) ) { if(timerId == 0) { console.log ("SET TIMER RINGING"); timerId = setTimeout(() => playRinging(),timer); } else { console.log ("TIMER Already ON"); } } else if (watchRegx2.test (newNode.textContent) ) { console.log ("CANCEL RINGING"); clearTimeout(timerId); timerId = 0; } } } ); }; } ); } //Ringing with time function playRinging(){ alrtSound.play(); timerId = 0; }
Have fun !
John_Carnell | 2021-05-20 19:21:25 UTC | #2
Hi Matt,
Thanks for sharing your solution. We always value your posts and questions so please don't stop. Here are a few things I want to add:
- Tampermonkey directly manipulates the Javascript DOM on the page that is loaded. We obviously can not stop an extension like this from being used and your use case fits the needs of your specific business customers.
- Since this work is being done outside of the software Genesys provides we will not be able to support it or answer questions through our support teams if problems arise from it. We also can not guarantee the security of information being manipulated by Tampermonkey. Also, we can not make a guarantee that our UI or APIs will be backward compatible if we make changes. In the end, it is implementer beware. You have to decide what is right for your business users and assess your ability to support this solution.
- If for some reason this solution were to cause problems within our platform our service, we would reserve the right to intervene and rate limit or shut down the offending org. My intent here is not to threaten or imply this solution won't work, but to highlight that at the end of the day, overall platform stability and scalability are always a key concern for us.
When we saw your post there were some questions internally on whether we should allow this post to stay up on the forum. My stance is we are an open community and developers should be able to share solutions and this post should stay up.
I would encourage you to submit an idea on our idea portal and have the community vote on it because I feel your frustration that you had to seek other ideas because we did not implement this feature. I also pulled our product manager @Becky_Powell into this conversation so she can act as an advocate within the product management team.
Thanks again for posting and sharing and hope to see more from you in the future.
Sincerely, John Carnell Manager, Developer Engagement
matt22 | 2021-05-21 06:24:24 UTC | #3
Hi John,
In fact when I post my script I had the idea that perhaps you will block it …
I understand the Genesys point of view and the limit of tampermonkey.
But I think the impact can be only local because it is not API and only screen manipulation (on that case, I know we can do more).
But your right, I have already ask for a solution and post an idea on the site.
Idea are a good way. But not fast enough. When we have deployed Genesys on some countries, some had before a solution to ring on customer waiting. And the change of color is not enough for them.
So I really would like those options, but it will be a long wait, due to vote waiting and development.
To be honest I’m working on another to push fullscreen automatically for the wallboard. Because it seems a non sense that there is no option to do it. When we are using a raspberry pi to connect to the TV, it open the page automatically at the morning, but we have to click manually !!!
So I understand that you prefer to have control on what is done on the platform like with API’s. But sometime, customer need an immediate solution to some basic features, and genesys is not able to answer.
I just give you a last example. Today there is nothing around monitoring on genesys. Only the live metrics view. I imagine that on premise customer with Edges have all the same question and request. But there is nothing given by Genesys, even a basic template to get that.
Thank you for your concern. Keep in touch. Matt
John_Carnell | 2021-05-21 12:45:29 UTC | #4
matt22, post:3, topic:10980
So I understand that you prefer to have control on what is done on the platform like with API’s. But sometime, customer need an immediate solution to some basic features, and genesys is not able to answer.
I just give you a last example. Today there is nothing around monitoring on genesys. Only the live metrics view. I imagine that on premise customer with Edges have all the same question and request. But there is nothing given by Genesys, even a basic template to get that.
Thank you for your concern.
Hi Matt,
No worries. I totally understand your reasons and the actions you took. I would do the same in your position :). I just had to document our position and provide guidance on it. I am going to continue to work on this on my end.
Thanks again for contributing and I always welcome your feedback, Matt. If you ever want to chat directly please do not hesitate to DM me.
Thanks, John Carnell Manager, Developer Engagement
system | 2021-06-21 12:45:29 UTC | #5
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 10980