rushfee/WebContent/www/huaweiScripts/demo/agentapp/ui/voice.ui.js

33 lines
1.7 KiB
JavaScript

//notice
/*
* voiceui must implement following interface
* UpdateVoicePhoneState
*/
//VoiceUIClass constructor
function VoiceUIClass() {
}
//VoiceUIClass methods define
VoiceUIClass.prototype = {
UpdateVoicePhoneState: function () {
if (VoicePhoneState.GetVoiceTalkingState() === VOICE_PHONE_TALKING_STATE.VOICE_PHONE_TALKING) {
// document.getElementById("AgentAppDemo.PhoneStatus").innerHTML = "<font color='green'>" + VoicePhoneState.GetRegisteredPhoneNumber() + ":" + "Talking-" + VoicePhoneState.GetCallingPhoneNumber() + "</font>";
}
else if (VoicePhoneState.GetVoiceTalkingState() === VOICE_PHONE_TALKING_STATE.VOICE_PHONE_ALERTING) {
// document.getElementById("AgentAppDemo.PhoneStatus").innerHTML = "<font color='alerting'>" + VoicePhoneState.GetRegisteredPhoneNumber() + ":" + "Alerting-" + VoicePhoneState.GetCallingPhoneNumber() + "</font>";
// if (document.getElementById("AgentAppDemo.Voice.AutoPickup").checked){
// document.getElementById("AgentAppDemo.Voice.Answer").click();
// }
AgentAppDemoExcute('AnswerPhone');
}
else if (VoicePhoneState.GetVoiceTalkingState() === VOICE_PHONE_TALKING_STATE.VOICE_PHONE_RELEASED) {
if (VoicePhoneState.GetVoiceRegisterState() === VOICE_PHONE_REGISTER_STATE.VOICE_PHONE_UNREGISTERED) {
// document.getElementById("AgentAppDemo.PhoneStatus").innerHTML = "<font color='black'>" + 'unregistered' + "</font>";
}
else{
// document.getElementById("AgentAppDemo.PhoneStatus").innerHTML = "<font color='blue'>" + VoicePhoneState.GetRegisteredPhoneNumber() +":" + "registered" + "</font>";
}
}
}
}