Created
June 20, 2024 13:04
-
-
Save taf2/d1e2e8ff8356f4bce0fb6e2d561e6ade to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Home Page</title> | |
<script src="https://<%= ctm_host %>/ctm-phone-embed-1.0.js"></script> | |
</head> | |
<body> | |
<h1>Your Application</h1> | |
<p>Embedding the CTM Phone</p> | |
<ctm-phone-embed access="/api/ctm_access" popout="/device"></ctm-phone-embed> | |
<script> | |
document.addEventListener('DOMContentLoaded', function() { | |
const ctmPhone = document.querySelector('ctm-phone-embed'); | |
// you can do this or rely on the access attribute | |
// ctmPhone.accessToken = '<%= ctm_access %>'; | |
ctmPhone.addEventListener('ctm:ready', function(e) { | |
console.log('CTM Phone is ready', e); | |
// TODO: get screenpop information from the custom fields | |
// | |
// for auto answer make sure we have an event for call start/connected | |
}); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment