Amazon Connect softphone library
npm install @crisiscleanup/connect-rtc
git clone https://github.com/aws/connect-rtc-js.gitcd connect-rtc-jsnpm installgruntnpm testgrunt demoHowever the following steps could further customize softphone experience.
1. Load connect-rtc-js along with amazon-connect-streams on parent page
2. Following amazon-connect-streams instructions to initialize CCP
3. Replace the softphone parameter (within the second parameter of connect.core.initCCP()) with
allowFramedSoftphone: false
This would stop embedded CCP from handling softphone call
4. Add this line after initCCP
connect.core.initSoftphoneManager({allowFramedSoftphone: true});
This would allow your page to handle softphone call with the connect-rtc-js loaded by your page. allowFramedSoftphone is necessary if your page also lives in a frame, otherwise you can remove that parameter.
5. Add this HTML element to your web page
amazon-connect-streams library will look for this element and inject it into connect-rtc-js so that connect-rtc-js can play downstream audio through this element.
6. Customize it (some ideas below)
* Customize audio device for remote-audio element
* Look at all the documented APIs in RtcSession class, modify softphone.js as you need
* Revert step 4, add your own glue layer between amazon-connect-streams and connect-rtc-js (use softphone.js as a template)