/// <summary> /// Internal : check if we should make the query, issue a query to the server /// </summary> /// <param name="Extension"></param> private void PhoneNumberQueryForwarding(string Extension) { ForwardStatusStore fw = GetStatusStore(Extension); if (fw.ShouldQueryForwardStatus() == true) { fw.LastQueryStamp = Environment.TickCount; // if there is no reply comming for this extension, we should retry a bit later fw.PacketStatus = ServerPacketStatus.PacketSent; if (Globals.ConnectionManager != null) { NetworkClient nc = Globals.ConnectionManager.GetCLient(fw.ServerIPAndPort); nc.PacketBuilder.QueryDeviceForwarding(Extension.ToString()); } } }
/// <summary> /// When a new UI extension is created, this function gets called. If we already know the forward status than we will initiate a callback to update forward status for this extension /// </summary> /// <param name="NewNumber"></param> public void OnExtensionCreate(PhoneNumber NewNumber) { //if we are still in the loading process, delay this query for now. We will auto query the state as soon as we are done loading if (Globals.ConnectionManager.HasAnyActiveConnection() == false || Globals.IndexCardsLoaded == false) { return; } // skip dummy placeholder extensions if (NewNumber.GetExtension().Length == 0) { return; } //if we already have a status queried for this extension than we can return the status directly. Else we will isue an async callback when server replies if (NewNumber.IsSubscriberRange() == false) { ForwardStatusStore fw = GetStatusStore(NewNumber.GetExtension()); if (fw.ShouldQueryForwardStatus() == false) { NewNumber.OnForwardingChange(fw); } } }