Exemplo n.º 1
0
        public async Task Notity(Call call)
        {
            using (var httpClient = new HttpClient())
            {
                var json = Json.Encode(call);
                var content = new StringContent(json);

                content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
                await httpClient.PostAsync(string.Concat(GlobalSettings.Current.ObserverWebApiBaseUrl, "/call/notify"), content);
            }
        }
Exemplo n.º 2
0
        public void Notify(string callType)
        {
            var ip = Context.Request.Environment["server.RemoteIpAddress"].ToString();
            var call = new Call
            {
                CreatedOn = DateTime.Now,
                CallType = callType,
                MacAddress = NativeMethods.GetMacAddress(ip),
                IpAddress = ip
            };

            var callService = new CallService();
            Task.Run(async () => await callService.Notity(call));

            Clients.Caller.callRecieved(callType);
        }