예제 #1
0
 public void OnConnectionLost()
 {
     LastQueryStamp     = 0; // we never queried this value
     ForwardType        = CallForwardingTypes.CallForwardNone;
     VoiceMailForward   = 0;
     DestinationForward = 0;
     PacketStatus       = ServerPacketStatus.PacketNotSent;
 }
예제 #2
0
        public void PhoneNumberUpdateForwarding(string Extension, CallForwardingTypes Type, long VoiceMail, long Destination)
        {
            //find the store for this extension
            ForwardStatusStore fw = GetStatusStore(Extension);

            //update it
            fw.ForwardType        = Type;
            fw.VoiceMailForward   = VoiceMail;
            fw.DestinationForward = Destination;
            fw.PacketStatus       = ServerPacketStatus.PacketReceived;

            Globals.Logger.LogString(LogManager.LogLevels.LogFlagCallForwarding, "Server : Set forwarding for extension " + Extension + " to Type " + Type + " to destination " + Destination);
            Globals.ExtensionManager.OnForwardingStatusUpdate(fw);
        }
예제 #3
0
        /// <summary>
        /// set call forwarding for an extension( phone number ). This is a non blocking call. Result is not guaranteed. Callback function will set the state of extansions
        /// </summary>
        /// <param name="Extension"></param>
        /// <param name="Type"></param>
        /// <param name="VoiceMail"></param>
        /// <param name="Destination"></param>
        public void CallForwardingSet(string Extension, CallForwardingTypes Type, long VoiceMail, long Destination)
        {
            ForwardStatusStore fw = GetStatusStore(Extension);
            short Enable          = 0;

            if (Type != CallForwardingTypes.CallForwardNone)
            {
                Enable = 1;
            }
            Globals.Logger.LogString(LogManager.LogLevels.LogFlagCallForwarding, "Client : Set forwarding for extension " + Extension + " to Type " + Type + " to destination " + Destination);
            if (Globals.ConnectionManager != null)
            {
                NetworkClient nc = Globals.ConnectionManager.GetCLient(fw.ServerIPAndPort);
                nc.PacketBuilder.SetFeatureForwarding(Extension.ToString(), Destination.ToString(), 0, Enable);
            }
        }
        private void Button_Click_OK(object sender, RoutedEventArgs e)
        {
            //get the selected extension
            string SelectedExtension = (string)Extensions.SelectedValue;
            CallForwardingTypes ft   = CallForwardingTypes.CallForwardNone;

            if (ForwardTypes.SelectedIndex == 1)
            {
                ft = CallForwardingTypes.CallForwardNone;
            }
            else if (rb_VoiceMail.IsChecked == true)
            {
                ft = CallForwardingTypes.CallForwardVoiceMail;
            }
            else if (rb_Destination.IsChecked == true)
            {
                ft = CallForwardingTypes.CallForwardDestination;
            }
            Globals.ForwardManager.CallForwardingSet(SelectedExtension, ft, PhoneNumberManager.Int32Parse(Voicemail.Text, 0), PhoneNumberManager.Int32Parse(DestinationExtension.Text, 0));
            this.Close();
        }