<div id="CallState"></div>
<SCRIPT TYPE="text/javascript">
window.external.InitScriptInterface();
SitePhone = SiteKiosk.Plugins("SitePhone");
SitePhone.OnCallStateChanged = OnCallStateChanged;
CS_UNPLACED = 0;
CS_ROUTING = 1;
CS_EARLY_MEDIA = 2;
CS_FAILED = 3;
CS_RINGING = 4;
CS_IN_PROGRESS = 5;
CS_ON_HOLD = 6;
CS_FINISHED = 7;
CS_MISSED = 8;
CS_REFUSED = 9;
CS_BUSY = 10;
CS_CANCELLED = 11;
CS_LOCAL_HOLD = 12;
CS_REMOTE_HOLD = 13;
CS_VOICEMAIL_BUFFERING_GREETING = 14;
CS_VOICEMAIL_PLAYING_GREETING = 15;
CS_VOICEMAIL_RECORDING = 16;
CS_VOICEMAIL_UPLOADING = 17;
CS_VOICEMAIL_SENT = 18;
CS_VOICEMAIL_CANCELLED = 19;
CS_VOICEMAIL_FAILED = 20;
CS_TRANSFERRING = 21;
CS_TRANSFERRED = 22;
CS_INCOMING = 24;
function OnCallStateChanged()
{
switch (SitePhone.CallStatus)
{
case CS_ON_HOLD:
case CS_LOCAL_HOLD:
case CS_REMOTE_HOLD:
CallState.innerHTML = "Call on hold";
break;
case CS_ROUTING:
CallState.innerHTML = "Connecting...";
break;
case CS_RINGING:
CallState.innerHTML = "Ringing...";
break;
case CS_IN_PROGRESS:
CallState.innerHTML = "Call in progress";
case CS_FINISHED:
CallState.innerHTML = "Call finished";
break;
case CS_FAILED:
case CS_REFUSED:
case CS_MISSED:
CallState.innerHTML = "Connection problem";
break;
//...
}
}
</SCRIPT>
|