public string InBoundCallBack(string sConnString, string conferenceUUID, int conferenceSize, string callUUID, string fromNumber, string toNumber, string eventName, string callStatus, string requestUUID, int grpCallMemberId, string action, string digits, Int64 startTime, Int64 endTime, string endReason)
        {
            Logger.TraceLog("end reason bll " + endReason);
            Logger.TraceLog(conferenceUUID + "-conferenceUUID " + callUUID + "fromNumber" + fromNumber + "toNumber" + toNumber + "event" + eventName + "callStatus" + callStatus + "digits" + digits + "requestUUID" + requestUUID + "grpCallMemberId" + grpCallMemberId);
            DataSet responseDataSet = new DataSet();
            GrpInboundCallEntity GrpInboundCallEntityObj = new GrpInboundCallEntity(sConnString);

            responseDataSet = GrpInboundCallEntityObj.InBoundCallBack(conferenceUUID, conferenceSize, callUUID, fromNumber, toNumber, eventName, callStatus, requestUUID, grpCallMemberId, action, digits, startTime, endTime, endReason);
            PublishMessageToWebSocket(responseDataSet, fromNumber, toNumber, callStatus, action);
            if (responseDataSet.Tables.Count > 1)
            {
                JObject privateResponse = new JObject();
                if (responseDataSet.Tables[1].Rows.Count > 0)
                {
                    Logger.TraceLog("Private Membs" + responseDataSet.Tables[1].Rows.Count);
                    V_1_4.GroupCall_V140 grpCallObj = new V_1_4.GroupCall_V140();
                    for (int row = 0; row < responseDataSet.Tables[1].Rows.Count; row++)
                    {
                        Logger.TraceLog("Inbound Private Mems Count" + responseDataSet.Tables[1].Rows.Count);
                        privateResponse = grpCallObj.PrivatePublicApi(Convert.ToString(responseDataSet.Tables[1].Rows[row]["Conferenceroom"]), Convert.ToString(responseDataSet.Tables[1].Rows[row]["member_id"]), false, Convert.ToString(responseDataSet.Tables[1].Rows[row]["HttpUrl"]), Convert.ToBoolean(responseDataSet.Tables[1].Rows[row]["Mute"]));
                    }
                }
            }
            return("");
        }
        public string UpdateCallBacks(string sConnString, string methodType, string callBackIpAddr, JObject callBackReqObj, string pusherAppId, string pusherAppKey, string pusherAppsecret, string HangupCauses, HttpContext respContext, string callBackUrl)
        {
            //Parsing The Data
            ParseResponse(methodType, callBackReqObj, respContext);

            string pusherCallStatus = callBackPropObj.CallStatus;
            string eventName        = "call_status";

            string[] hangupCasuesForRetry = null;
            int      hangUpCount          = 0;
            int      callDrop             = 0;

            hangupCasuesForRetry = HangupCauses.Split(",".ToCharArray());
            try
            {
                //Updating GroupCall Status Method calling
                globalDs = UpdateCallBacksCallDb(sConnString, callBackPropObj, callBackIpAddr);
                Pusher pusherObj = new Pusher(pusherAppId, pusherAppKey, pusherAppsecret);

                JObject retryResponse = new JObject();
                if (hangupCasuesForRetry.Contains(callBackPropObj.EndReason))
                {
                    if (callBackPropObj.StartTime > 0 && (callBackPropObj.EndTime - callBackPropObj.StartTime) > 0)
                    {
                        callDrop = 1;
                    }
                    BusinessLogicLayer.V_1_5.GroupCall groupcallObj = new BusinessLogicLayer.V_1_5.GroupCall();
                    retryResponse = groupcallObj.GrpCallRetryBLL(sConnString, callBackPropObj.CallUUID, callBackPropObj.RequestUUID, callBackUrl, callDrop);
                    callBackResponse.Append("Retry Response : " + retryResponse.ToString());
                    if (string.IsNullOrEmpty(retryResponse.SelectToken("Success").ToString()) == false)
                    {
                        if (Convert.ToBoolean(retryResponse.SelectToken("Success").ToString()) == true)
                        {
                            pusherCallStatus = "redial";
                        }
                    }
                }
                if (globalDs.Tables.Count > 0 && globalDs.Tables[0].Rows.Count > 0)
                {
                    var _with1 = globalDs.Tables[0];

                    Logger.TraceLog("Pusher REsponse for outbound Main");
                    if (Convert.ToInt32(globalDs.Tables[0].Rows[0]["IsInterConnect"]) == 0)
                    {
                        if (pusherCallStatus == "redial")
                        {
                            hangUpCount = Convert.ToInt32(globalDs.Tables[0].Rows[0]["HangUpCount"]) - 1;
                        }
                        else
                        {
                            hangUpCount = Convert.ToInt32(globalDs.Tables[0].Rows[0]["HangUpCount"]);
                        }


                        Logger.TraceLog("Pusher REsponse for outbound");
                        ITriggerResult PusherResponse = null;
                        PusherResponse = pusherObj.Trigger(globalDs.Tables[0].Rows[0]["ConferenceName"].ToString(), eventName, new
                        {
                            direction              = "outbound",
                            plivo_event            = callBackPropObj.Event,
                            plivo_conferene_action = callBackPropObj.GrpCallAction,
                            to_num          = globalDs.Tables[0].Rows[0]["MobileNumber"],
                            conf_room       = grpCallName,
                            call_status     = pusherCallStatus,
                            mute            = globalDs.Tables[0].Rows[0]["Mute"],
                            deaf            = globalDs.Tables[0].Rows[0]["Deaf"],
                            isprivate       = globalDs.Tables[0].Rows[0]["IsPrivate"],
                            member          = globalDs.Tables[0].Rows[0]["Member"],
                            MemberJoinTime  = Convert.ToString(globalDs.Tables[0].Rows[0]["MemberJoinTime"]),
                            conf_type       = globalDs.Tables[0].Rows[0]["ConferenceType"],
                            conf_digits     = callBackPropObj.Digits,
                            IsMember        = globalDs.Tables[0].Rows[0]["IsMember"],
                            conf_id         = globalDs.Tables[0].Rows[0]["ConferenceId"],
                            record_status   = globalDs.Tables[0].Rows[0]["RecordStatus"],
                            record_count    = globalDs.Tables[0].Rows[0]["RecordCount"],
                            dig_prs_count   = globalDs.Tables[0].Rows[0]["DigitPressCount"],
                            inpro_count     = globalDs.Tables[0].Rows[0]["InprogressCount"],
                            unmute_count    = globalDs.Tables[0].Rows[0]["UnmuteCount"],
                            mute_count      = globalDs.Tables[0].Rows[0]["MuteCount"],
                            end_reason      = globalDs.Tables[0].Rows[0]["end_reason"],
                            isinprogress    = isInProgress,
                            AllMembersCount = globalDs.Tables[0].Rows[0]["AllMembersCount"],
                            OnCallCount     = globalDs.Tables[0].Rows[0]["OnCallCount"],
                            HangUpCount     = hangUpCount,
                            MuteCount       = globalDs.Tables[0].Rows[0]["MuteMemCount"],
                            HandRaiseCount  = globalDs.Tables[0].Rows[0]["HandRaiseCount"],
                            MembersCount    = globalDs.Tables[0].Rows[0]["AllMembersCount"],
                            PrivateCount    = globalDs.Tables[0].Rows[0]["PrivateCount"]
                        });
                    }
                    callBackResponse.Append("CurrentMemberDetails ==> ");
                    foreach (DataRow _Row in globalDs.Tables[0].Rows)
                    {
                        foreach (DataColumn _Column in _Row.Table.Columns)
                        {
                            if (_Row[_Column.ColumnName] == DBNull.Value)
                            {
                                callBackResponse.Append(_Column.ColumnName + " : NULL");
                            }
                            else
                            {
                                callBackResponse.Append(_Column.ColumnName + " : " + _Row[_Column.ColumnName]);
                            }
                            callBackResponse.Append(" | ");
                        }
                        callBackResponse.Append(" @@@ ");
                    }
                }

                else
                {
                    callBackResponse.Append("No Member Data Returned From Database");
                }
                if (globalDs.Tables.Count > 1 && globalDs.Tables[1].Rows.Count > 0)
                {
                    if (Convert.ToInt32(globalDs.Tables[0].Rows[0]["PrivateCount"]) == 0)
                    {
                        callBackResponse.Append("AloneMemberDetails ==> ");
                        foreach (DataRow _Row in globalDs.Tables[1].Rows)
                        {
                            foreach (DataColumn _Column in _Row.Table.Columns)
                            {
                                if (_Row[_Column.ColumnName] == DBNull.Value)
                                {
                                    callBackResponse.Append(_Column.ColumnName + " : NULL");
                                }
                                else
                                {
                                    callBackResponse.Append(_Column.ColumnName + " : " + _Row[_Column.ColumnName]);
                                }
                                callBackResponse.Append(" | ");
                            }
                            callBackResponse.Append(" @@@ ");
                        }
                        JObject aloneHangupResponse = new JObject();
                        JObject alonePlayResponse   = new JObject();
                        var     _with2 = globalDs.Tables[1];
                        BusinessLogicLayer.V_1_4.GroupCall_V140 GrpcallObj = new BusinessLogicLayer.V_1_4.GroupCall_V140();
                        alonePlayResponse = GrpcallObj.PlayToAConferenceCall(globalDs.Tables[1].Rows[0]["ConferenceRoom"].ToString(), Convert.ToString(globalDs.Tables[1].Rows[0]["MemberId"]), globalDs.Tables[1].Rows[0]["HttpUrl"].ToString(), "https://new.grpTalk.com/DefaultClips/thank_you.mp3");
                        System.Threading.Thread.Sleep(6000);
                        //ConferenceObject.ConferenceRecording(globalDs.Tables(0).Rows.Item(0)("ConferenceId"), 2)
                        grpcall callObj = new grpcall();
                        callObj.ConferenceId         = Convert.ToInt32(globalDs.Tables[1].Rows[0]["ConferenceId"]);
                        callObj.ConferenceRoom       = globalDs.Tables[1].Rows[0]["ConferenceRoom"].ToString();
                        callObj.CallUUID             = globalDs.Tables[1].Rows[0]["CallUUID"].ToString();
                        callObj.ConferenceAction     = "HANGUP_ALL";
                        callObj.IsAll                = true;
                        callObj.HttpConferenceApiUrl = globalDs.Tables[1].Rows[0]["HttpUrl"].ToString();
                        aloneHangupResponse          = GrpcallObj.GrpCallHanUp(sConnString, callObj);
                        //Send Notification to App
                        PusherNotifier mobileNotifierObj = new PusherNotifier();
                        mobileNotifierObj.IsStarted = 0;
                        mobileNotifierObj.GrpCallID = Convert.ToInt32(globalDs.Tables[1].Rows[0]["ConferenceId"]);
                        GrpcallObj.MobileNotifier(sConnString, mobileNotifierObj);
                        callBackResponse.Append("Alone Play Response Is : " + alonePlayResponse.ToString());
                        callBackResponse.Append("Alone Hangup Response Is : " + aloneHangupResponse.ToString());
                    }
                }
                else
                {
                    callBackResponse.Append("No Alone Member");
                }
                if (globalDs.Tables.Count > 2)
                {
                    JObject privateResponse = new JObject();
                    if (globalDs.Tables[2].Rows.Count > 0)
                    {
                        Logger.TraceLog("Private Membs" + globalDs.Tables[2].Rows.Count);
                        V_1_4.GroupCall_V140 grpCallObj = new V_1_4.GroupCall_V140();
                        for (int row = 0; row < globalDs.Tables[2].Rows.Count; row++)
                        {
                            privateResponse = grpCallObj.PrivatePublicApi(Convert.ToString(globalDs.Tables[2].Rows[row]["Conferenceroom"]), Convert.ToString(globalDs.Tables[2].Rows[row]["member_id"]), false, Convert.ToString(globalDs.Tables[2].Rows[row]["HttpUrl"]), Convert.ToBoolean(globalDs.Tables[2].Rows[row]["Mute"]));
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.ExceptionLog("exception at callBackresponseBLL : " + ex.ToString());
                callBackResponse.Append("Exception : " + ex.ToString());
            }
            return(callBackResponse.ToString());
        }