Exemplo n.º 1
0
        private void AddHighriseCallNote(string url, string authToken, SIPFromHeader caller, Person person)
        {
            try
            {
                NoteRequest request = new NoteRequest(url, authToken);
                string result = request.CreateNoteForPerson(person.ID, HttpUtility.HtmlEncode("Incoming SIP call as " + caller.FromUserField.ToParameterlessString() + " at " + DateTime.UtcNow.ToString("dd MMM yyyy HH:mm:ss") + " UTC."));
                string personName = person.FirstName + " " + person.LastName;

                if(result != null)
                {
                    LogToMonitor(new SIPMonitorConsoleEvent(SIPMonitorServerTypesEnum.AppServer, SIPMonitorEventTypesEnum.DialPlan, "Highrise call received note added for " + personName + ".", m_context.Owner));
                }
                else
                {
                    LogToMonitor(new SIPMonitorConsoleEvent(SIPMonitorServerTypesEnum.AppServer, SIPMonitorEventTypesEnum.DialPlan, "Failed to add Highrise call received note for " + personName + ".", m_context.Owner));
                }
            }
            catch (Exception excp)
            {
                LogToMonitor(new SIPMonitorConsoleEvent(SIPMonitorServerTypesEnum.AppServer, SIPMonitorEventTypesEnum.DialPlan, "Exception attempting to add Highrise call received note. " + excp.Message, m_context.Owner));
            }
        }
        public void SetAvatarURLTest()
        {
            string url = "https://somebiz.highrisehq.com";
            Person person = new Person() { ID = 12345678 };
            person.SetAvatarURL(url);

            Assert.AreEqual(String.Format(Person.AVATAR_URL_FORMAT, url, 1234, 5678), person.AvatarURL, "The person's avatar URL was not set correctly.");
        }
        private void AddHighriseCallNote(string url, string authToken, Person person)
        {
            try
            {
                NoteRequest request = new NoteRequest(url, authToken);
                string result = request.CreateNoteForPerson(person.ID, "Called at " + DateTime.UtcNow.ToString("dd MMM yyyy HH:mm:ss") + " UTC.");
                string personName = person.FirstName + " " + person.LastName;

                if(result != null)
                {
                    LogToMonitor(new SIPMonitorConsoleEvent(SIPMonitorServerTypesEnum.AppServer, SIPMonitorEventTypesEnum.DialPlan, "Highrise call received note added for " + personName + ".", m_context.Owner));
                }
                else
                {
                    LogToMonitor(new SIPMonitorConsoleEvent(SIPMonitorServerTypesEnum.AppServer, SIPMonitorEventTypesEnum.DialPlan, "Failed to add Highrise call received note for " + personName + ".", m_context.Owner));
                }
            }
            catch (Exception excp)
            {
                LogToMonitor(new SIPMonitorConsoleEvent(SIPMonitorServerTypesEnum.AppServer, SIPMonitorEventTypesEnum.DialPlan, "Exception attempting to add Highrise call received note.", m_context.Owner));
            }
        }