Пример #1
0
        private void Hangup(HttpContext context)
        {
            JObject hangupObj     = new JObject();
            JObject hangupRespObj = new JObject();

            context.Request.InputStream.Position = 0;
            try
            {
                StreamReader hangupStream = new StreamReader(context.Request.InputStream);
                hangupObj = JObject.Parse(hangupStream.ReadToEnd().ToString());
            }
            catch (Exception ex)
            {
                Logger.ExceptionLog("exception at parsing Input Stream In Hangup Method : " + ex.ToString());
                hangupRespObj = new JObject(new JProperty("Success", false),
                                            new JProperty("Message", "Invalid Data"));
            }
            GroupCall_V120 groupCallObj = new GroupCall_V120();

            hangupRespObj = groupCallObj.ValidateHangUpAction(MyConf.MyConnectionString, hangupObj, userId);
            context.Response.Write(hangupRespObj);
            //Logger.TraceLog("Hangup response  " + hangupRespObj);
            HttpContext.Current.Items.Add("OutBytes", System.Text.Encoding.UTF8.GetByteCount(hangupRespObj.ToString()));
            //RMQClient.enQueueApiStat();
        }
Пример #2
0
        private void Dial(HttpContext context)
        {
            JObject dialObj      = new JObject();
            JObject dialResponse = new JObject();

            context.Request.InputStream.Position = 0;
            StreamReader dialStream         = new StreamReader(context.Request.InputStream);
            string       dialLoad           = dialStream.ReadToEnd();
            string       grpCallCallBackUrl = System.Configuration.ConfigurationManager.AppSettings["grpCallCallBackUrl"].ToString();

            try
            {
                dialObj = JObject.Parse(dialLoad);
            }
            catch (Exception ex)
            {
                Logger.ExceptionLog("exception at parsing Input Stream In Dial Method : " + ex.ToString());
                dialResponse = new JObject(new JProperty("Success", false),
                                           new JProperty("Message", "Invalid Data"));
                context.Response.Write(dialResponse);
                return;
            }
            GroupCall_V120 groupCallObj = new GroupCall_V120();

            dialResponse = groupCallObj.ValidateGrpCallDial(MyConf.MyConnectionString, dialObj, userId, grpCallCallBackUrl);
            context.Response.Write(dialResponse);
            Logger.TraceLog("Dial response  " + dialObj);
            HttpContext.Current.Items.Add("OutBytes", System.Text.Encoding.UTF8.GetByteCount(dialResponse.ToString()));
            //RMQClient.enQueueApiStat();
        }