private void RainbowTelephony_VoiceMessagesNumberUpdated(object sender, VoiceMessagesNumberEventArgs e) { UpdateVMNbMessages(e.Nb); // Check if PBX uses is an OXO system or not // Some Voice Message features are available only on OXO PbxAgentInfo pbxAgentInfo = rainbowTelephony.GetPBXAgentInformation(); Boolean isOXO = pbxAgentInfo.IsOXO; voiceMessagesList = null; if (isOXO) { rainbowTelephony.GetVoiceMessagesList(callback => { if (callback.Result.Success) { voiceMessagesList = callback.Data; } else { String output = String.Format("Impossible to get Voice Messages - error:[{0}]", Util.SerializeSdkError(callback.Result)); AddStateLine(output); log.LogError(output); } }); } UpdateVMMessages(); }
private void UpdateVMMessages() { // We can update this compoent only if we are in the from thread if (tbVoiceMessagePhoneNumber.InvokeRequired) { VoidDelegate d = new VoidDelegate(UpdateVMMessages); this.Invoke(d, null); } else { // Check if PBX uses is an OXO system or not // Some Voice Message features are available only on OXO PbxAgentInfo pbxAgentInfo = rainbowTelephony.GetPBXAgentInformation(); Boolean isOXO = pbxAgentInfo.IsOXO; lblVMInfo.Visible = (!isOXO); int nb = 0; if (voiceMessagesList != null) { nb = voiceMessagesList.Count(); } btVMDownload.Enabled = btVMDelete.Enabled = cbVoiceMessages.Enabled = (nb > 0); } }
private void RainbowTelephony_TelephonyStatusUpdated(object sender, Rainbow.Events.TelephonyStatusEventArgs e) { Boolean telephonyServiceEnabled = e.Enabled; String pbxVersion = ""; String vmPhoneNumber = ""; if (telephonyServiceEnabled) { // Get PBX Version PbxAgentInfo pbxAgentInfo = rainbowTelephony.GetPBXAgentInformation(); if (pbxAgentInfo != null) { pbxVersion = pbxAgentInfo.Version; } // Voice mail vmPhoneNumber = rainbowTelephony.GetVoiceMailPhoneNumber(); } // Update Form UpdateTelephonyService(telephonyServiceEnabled); UpdatePBXAgentVersion(pbxVersion); UpdateVoiceMailService(vmPhoneNumber); }