public string GetPrefixName(DialPrefixType type) { if (!_display.ContainsKey(type)) return null; return _display[type]; }
public ChannelContextWindow(SpnvSubSystem system, Channel channel) { this.InitializeComponent(); App app = App.Current as App; if (app.AppBkBrush != null) { Background = app.AppBkBrush; } _sysytem = system; _channel = channel; if (channel.IsChannelBusy) { this.txtChannelName.Text = (channel.CallPartyDisplayName != null && channel.CallPartyDisplayName.Length != 0) ? channel.CallPartyDisplayName : channel.Name; this.txtChannelState.Text = channel.CallPartyDisplayNumber; } else { this.txtChannelName.Text = channel.Name; } DialPrefixType type = _sysytem.PrefixInfo.GetPrefixType(channel.CallDestNum); if (type != DialPrefixType.DialNoprefix) { btnRedirectToHandset.IsEnabled = false; } }
public string GetPrefix(DialPrefixType type) { if (!_prefix.ContainsKey(type)) return null; return _prefix[type]; }
public void AddPrefix(DialPrefixType type, string prefix, string display = null) { _prefix[type] = prefix; if (display != null) _display[type] = display; }
private void btnCall_Click(object sender, RoutedEventArgs e) { Log.Debug("Protocal Stack Log: (CallHistoryWindow)btnCall_Click, Start"); HistoryItem item = lbxCallHistory.SelectedItem as HistoryItem; if (item == null) { return; } if (string.IsNullOrEmpty(item.PartyNumber)) { return; } DialPrefixType type = _subsystem.PrefixInfo.GetPrefixType(item.PartyNumber); if (type != DialPrefixType.DialEavesdrop && type != DialPrefixType.DialIntercept && type != DialPrefixType.DialPickup && type != DialPrefixType.DialThreeway) { int callId = -1; _subsystem.Channels.MakeCall(_subsystem.AccountId, item.PartyNumber, ref callId); Log.Debug(String.Format("Protocal Stack Log: (CallHistoryWindow)btnCall_Click, Make Call:{0},{1},{2}", _subsystem.AccountId, item.PartyNumber, callId)); } Log.Debug("Protocal Stack Log: (CallHistoryWindow)btnCall_Click, No Make Call End"); }
public string StripDialPrefix(string num) { DialPrefixType type = GetPrefixType(num); if (type == DialPrefixType.DialNoprefix) return num; string prefix = GetPrefix(type); return num.Substring(prefix.Length); }
public DialPrefixGroup GetGroupPrefixType(string num) { DialPrefixType type = GetPrefixType(num); if (type == DialPrefixType.DialNoprefix) return DialPrefixGroup.DialGroupNone; if (!IsGroupCallPrefix(type)) return DialPrefixGroup.DialGroupNone; string groupnum = StripDialPrefix(num); return (from prefix in _groupprefix where string.Compare(prefix.Value, 0, groupnum, 0, prefix.Value.Length) == 0 select prefix.Key).FirstOrDefault(); }
public Channel GetChannel(DialPrefixType type) { foreach (Channel channel in _channels) { if (!channel.IsChannelBusy) { continue; } string remote = channel.CallDestNum; DialPrefixType tmp = _system.PrefixInfo.GetPrefixType(remote); if (tmp == type) { return(channel); } } return(null); }
public bool IsGroupCallPrefix(string dialNum) { DialPrefixType type = GetPrefixType(dialNum); return IsGroupCallPrefix(type); }
public bool IsGroupCallPrefix(DialPrefixType type) { return (type == DialPrefixType.DialConference || type == DialPrefixType.DialPaging || type == DialPrefixType.DialFindcall); }