Example #1
0
        public async Task <ActionResult> PostCall(MakeCall call)
        {
            try
            {
                if (string.IsNullOrEmpty(call.From))
                {
                    throw new ArgumentException("Field From is missing");
                }
                if (string.IsNullOrEmpty(call.To))
                {
                    throw new ArgumentException("Field To is missing");
                }
                var c = await Call.Create(Client, new Dictionary <string, object>
                {
                    { "from", PhoneNumberForCallbacks },
                    { "to", call.From },
                    { "callbackUrl", BaseUrl + Url.Action("CatapultFromCallback") },
                    { "tag", call.To }
                });

                Debug.WriteLine("Call Id to {0} is {1}", call.From, c.Id);
                return(Json(new object()));
            }
            catch (Exception ex)
            {
                return(Json(new { error = ex.Message }));
            }
        }
        public AddEventResponse AddEventToVenue(AddEventRequest request)
        {
            string           base_uri    = URLConstants.AddEventToVenueURL;
            string           result      = string.Empty;
            string           resXML      = "";
            XmlSerializer    serializer  = null;
            AddEventResponse resultEvent = new AddEventResponse();

            try
            {
                base_uri = makeAddEventURI(base_uri, request);
                result   = new MakeCall().GetResponseFromWeb(base_uri);

                XmlRootAttribute xRoot = new XmlRootAttribute();
                xRoot.ElementName = "response";
                xRoot.IsNullable  = true;
                serializer        = new XmlSerializer(typeof(AddEventResponse), xRoot);
                if (result != null && result.Length > 0)
                {
                    var str = XElement.Parse(result);
                    using (TextReader reader = new StringReader(result.ToString()))
                    {
                        object obj = serializer.Deserialize(reader);
                        resultEvent = (AddEventResponse)obj;
                        reader.Close();
                    }
                }
            }
            catch (Exception Ex)
            {
                throw Ex;
            }
            return(resultEvent);
        }
Example #3
0
        private void getFriends_Click(object sender, EventArgs e)
        {
            GetFriendsReply friendsReply = MakeCall.GetFriends();

            friends = friendsReply.friends;
            groups  = friendsReply.FriendGroups;
            PopulateGroupsVsUsers();
            PopulateFriendsTable();
            btnUpdateFriends.Enabled = true;
        }
        public string getAllEvents(EventSearchRequest request)
        {
            string response;

            try
            {
                MakeCall makeCall = new MakeCall();
                response = makeCall.getAllEventsLoc(request, Globals.eventdetails.FromEvent);
            }
            catch (Exception Ex)
            {
                throw Ex;
            }
            return(response);
        }
        public string getEventDetails(GetEventRequest request)
        {
            string response;

            try
            {
                MakeCall makeCall = new MakeCall();
                response = makeCall.getEventDetails(request, Globals.eventdetails.FromEvent);
            }
            catch (Exception Ex)
            {
                throw Ex;
            }
            return(response);
        }
        public string getCategories()
        {
            string response;

            try
            {
                MakeCall makeCall = new MakeCall();
                response = makeCall.getEventCategories();
            }
            catch (Exception Ex)
            {
                throw Ex;
            }
            return(response);
        }
        public string getAllVenues(VenueSearchRequest request)
        {
            string response;

            try
            {
                MakeCall makeCall = new MakeCall();
                response = makeCall.getAllVenuesLoc(request);
            }
            catch (Exception Ex)
            {
                throw Ex;
            }
            return(response);
        }
Example #8
0
        private void btnUpdateFriends_Click(object sender, EventArgs e)
        {
            List <Friend> friendsToUpdate = new List <Friend>();

            foreach (DataRow row in tblgroupsVsUsers.Rows)
            {
                Friend friend = new Friend();
                friend.username  = row["User Name"];
                friend.groupmask = 1;
                foreach (FriendGroup group in groups.Values)
                {
                    if ((bool)row[group.name])
                    {
                        friend.groupmask += group.BitmapID;
                    }
                }
                friendsToUpdate.Add(friend);
            }
            MakeCall.EditFriends(friendsToUpdate.ToArray(), null);
        }
 public async Task TestAsync()
 {
     var makeCall = new MakeCall();
     await makeCall.MakeCallsAsync();
 }
Example #10
0
        /// <summary>
        /// Make call
        /// </summary>
        public int MakeCall(DeviceId callingDevice, DeviceId calledDirectoryNumber, object userData = null)
        {
            MakeCall request = protocol.NewMakeCall(callingDevice, calledDirectoryNumber);

            return(SetUserData(comms.SendRequest(request), userData));
        }
Example #11
0
 public void CallOut(MobileAccount callingTo)
 {
     Console.WriteLine(ActionOut(callingTo, "is calling to"));
     MakeCall?.Invoke(this, callingTo);
 }
Example #12
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            LoginReply reply = MakeCall.Login();

            MessageBox.Show(reply.fullname);
        }