예제 #1
0
        public string GetPrefixName(DialPrefixType type)
        {
            if (!_display.ContainsKey(type))
                return null;

            return _display[type];
        }
예제 #2
0
        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;
            }
        }
예제 #3
0
        public string GetPrefix(DialPrefixType type)
        {
            if (!_prefix.ContainsKey(type))
                return null;

            return _prefix[type];
        }
예제 #4
0
        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");
        }
예제 #6
0
        public string StripDialPrefix(string num)
        {
            DialPrefixType type = GetPrefixType(num);
            if (type == DialPrefixType.DialNoprefix)
                return num;

            string prefix = GetPrefix(type);

            return num.Substring(prefix.Length);
        }
예제 #7
0
        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();
        }
예제 #8
0
        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);
        }
예제 #9
0
 public bool IsGroupCallPrefix(string dialNum)
 {
     DialPrefixType type = GetPrefixType(dialNum);
     return IsGroupCallPrefix(type);
 }
예제 #10
0
 public bool IsGroupCallPrefix(DialPrefixType type)
 {
     return (type == DialPrefixType.DialConference || 
         type == DialPrefixType.DialPaging || 
         type == DialPrefixType.DialFindcall);
 }