Esempio n. 1
0
        public AVCallHistory(bool video, string remoteParty, long id) : base(video ? MediaType.AudioVideo : MediaType.Audio, remoteParty)
        {
            this.startTime   = this.date;
            this.date        = base.Date;
            this.isConnected = this.seen;
            if (this.status == HistoryItem.StatusType.Incoming || this.status == HistoryItem.StatusType.Outgoing)
            {
                this.isConnected = true;
            }
            else
            {
                this.isConnected = false;
            }
            if (this.status == HistoryItem.StatusType.Outgoing || this.status == HistoryItem.StatusType.Failed)
            {
                this.isOutgoing = true;
            }
            else
            {
                this.isOutgoing = false;
            }
            int t = this.endTime.CompareTo(this.startTime);

            this.sipSessionId = id;
            if (t < 0)
            {
                this.connectedTime = System.TimeSpan.Zero;
            }
            else
            {
                this.connectedTime = this.endTime.Subtract(this.startTime);
            }
            this.remoteNumber = UriUtils.GetUserName(remoteParty);
        }
Esempio n. 2
0
        public bool AddPerson2Group(Group group, System.Collections.Generic.List <Person> persons)
        {
            bool result;

            if (group == null || null == persons)
            {
                result = false;
            }
            else
            {
                string strDPSUser = UriUtils.GetUserName(this.serviceManager.ConfigurationService.IdentityCfg.Impi);
                foreach (Person person in persons)
                {
                    string strPersonName = UriUtils.GetUserName(person.Uri);
                    if (!strDPSUser.Equals(person.UDN, System.StringComparison.InvariantCultureIgnoreCase) && !strDPSUser.Equals(strPersonName, System.StringComparison.InvariantCultureIgnoreCase))
                    {
                        group.Children.Add(person);
                        person.Parent = group;
                    }
                }
                ContactEventArgs eargs = new ContactEventArgs(ContactEventTypes.CONTACT_ADDED);
                eargs.AddExtra("parent", group);
                eargs.AddExtra("contact", persons);
                EventHandlerTrigger.TriggerEvent <ContactEventArgs>(this.onContactEvent, this, eargs);
                result = true;
            }
            return(result);
        }
Esempio n. 3
0
 public ShortMessageHistory(string remoteParty) : base(MediaType.ShortMessage, remoteParty)
 {
     this.startTime    = this.date;
     this.date         = base.Date;
     this.remoteNumber = UriUtils.GetUserName(remoteParty);
     this.sipSessionId = base.SipSessionId;
 }
Esempio n. 4
0
 public ShortMessageHistory(string remoteParty, long id, bool isOut) : base(MediaType.ShortMessage, remoteParty)
 {
     this.startTime    = this.date;
     this.date         = base.Date;
     this.remoteNumber = UriUtils.GetUserName(remoteParty);
     this.sipSessionId = base.SipSessionId;
     this.sipSessionId = id;
     this.isOutgoing   = isOut;
 }
        private void ctxMenu_AddToContacts_Click(object sender, RoutedEventArgs e)
        {
            Contact contact = new Contact();

            contact.UriString   = [email protected];
            contact.DisplayName = UriUtils.GetUserName(contact.UriString);
            ScreenContactEdit screenEditContact = new ScreenContactEdit(contact, null);

            screenEditContact.EditMode = false;
            screenEditContact.Tag      = this.@event;
            Win32ServiceManager.SharedManager.Win32ScreenService.Show(screenEditContact);
        }
Esempio n. 6
0
        public AVCallHistory(bool video, string remoteParty, long id, bool isOutGoing, bool isConnect) : base(video ? MediaType.AudioVideo : MediaType.Audio, remoteParty)
        {
            this.startTime   = this.date;
            this.date        = base.Date;
            this.isOutgoing  = isOutGoing;
            this.isConnected = isConnect;
            int t = this.endTime.CompareTo(this.startTime);

            this.sipSessionId = id;
            if (t < 0)
            {
                this.connectedTime = System.TimeSpan.Zero;
            }
            else
            {
                this.connectedTime = this.endTime.Subtract(this.startTime);
            }
            this.remoteNumber = UriUtils.GetUserName(remoteParty);
        }
Esempio n. 7
0
 private void buttonMessaging_Click(object sender, RoutedEventArgs e)
 {
     if (!String.IsNullOrEmpty(this.textBoxFreeContact.Text))
     {
         String remoteUri = UriUtils.GetValidSipUri(this.textBoxFreeContact.Text);
         if (!String.IsNullOrEmpty(remoteUri))
         {
             MediaActionHanler.StartChat(remoteUri);
             this.textBoxFreeContact.Text = String.Empty;
         }
     }
     else
     {
         HistoryEvent @event = this.historyService.Events.FirstOrDefault((x) => { return((x.MediaType & MediaType.Messaging) != MediaType.None); });
         if (@event != null && !String.IsNullOrEmpty(@event.RemoteParty))
         {
             this.textBoxFreeContact.Text = UriUtils.GetUserName(@event.RemoteParty);
         }
     }
 }
Esempio n. 8
0
 protected HistoryItem(MediaType mediaType, string remoteParty, long id) : this()
 {
     this.mediaType    = mediaType;
     this.remoteParty  = UriUtils.GetUserName(remoteParty);
     this.sipSessionId = id;
 }
Esempio n. 9
0
 protected HistoryItem(MediaType mediaType, string remoteParty) : this()
 {
     this.mediaType   = mediaType;
     this.remoteParty = UriUtils.GetUserName(remoteParty);
 }
Esempio n. 10
0
 public ContactItem FindItem(string key, ContactType contactType)
 {
     key = UriUtils.GetUserName(key);
     return(this.FindItem(key, contactType, this.addressBook));
 }