Example #1
0
        public DataSet DownloadCallAbandonedHistory(String connection, int accountId, string Date, int CallDirection, int CallType, int CallEndStatus, int agentId, int skillGroupId, string fromDate, string toDate, int PageSize, int PageNumber, int StudioId, int sessionAgentId, int roleId, int excelDownload)
        {
            DataSet ds = new DataSet();

            try
            {
                Press3.DataAccessLayer.Calls callsObject = new Press3.DataAccessLayer.Calls(connection);
                ds = callsObject.GetAbandonedcalldetails(accountId, Date, CallDirection, CallType, CallEndStatus, agentId, skillGroupId, fromDate, toDate, PageSize, PageNumber, StudioId, sessionAgentId, roleId, excelDownload);
            }
            catch (Exception ex)
            {
                helper.CreateProperty("RetMessage", ex.ToString());
                Logger.Error("Exception In AgentLogout " + ex.ToString());
            }
            return(ds);
        }
Example #2
0
        public DataSet DownloadOutBoundCallHistory(String connection, UDC.CallHistoryDetails callHistoryDetails)
        {
            DataSet ds = new DataSet();

            try
            {
                Press3.DataAccessLayer.Calls callsObject = new Press3.DataAccessLayer.Calls(connection);
                ds = callsObject.GetOutBoundCallHistory(callHistoryDetails);
            }
            catch (Exception ex)
            {
                helper.CreateProperty("RetMessage", ex.ToString());
                Logger.Error("Exception In AgentLogout " + ex.ToString());
            }
            return(ds);
        }
Example #3
0
        public DataSet DownloadCallBackRequests(string connection, UDC.CallbackRequest cbrObj)
        {
            DataSet ds = new DataSet();

            try
            {
                Press3.DataAccessLayer.Calls callsObj = new Press3.DataAccessLayer.Calls(connection);
                ds = callsObj.CallBackRequestManagement(cbrObj);
            }
            catch (Exception ex)
            {
                helper.CreateProperty("RetMessage", ex.ToString());
                Logger.Error("Exception In AgentLogout " + ex.ToString());
            }

            return(ds);
        }
Example #4
0
        public JObject ChangeCallActions(String connection, int status, int callId, string action, string filePath, string conferenceRoom, bool isOutbound)
        {
            try
            {
                string confRoom = ""; int memberId = 0; string httpURL = "";
                Press3.DataAccessLayer.Calls callsObject = new Press3.DataAccessLayer.Calls(connection);
                DataSet ds = callsObject.ChangeCallActions(status, callId, action, conferenceRoom, isOutbound, out confRoom, out memberId, out httpURL);

                if (ds == null)
                {
                    helper.CreateProperty(UDC.Label.MESSAGE, "No data returned from database");
                    helper.CreateProperty(UDC.Label.SUCCESS, false);
                }
                else
                {
                    if (action == "Hold")
                    {
                        if (ds.Tables.Count > 0)
                        {
                            Press3.BusinessRulesLayer.Gateways gatewayObj = new Press3.BusinessRulesLayer.Gateways();
                            string postData = "";
                            if (memberId > 0 && confRoom != "" && httpURL != "")
                            {
                                if (status == 1)
                                {
                                    postData += "ConferenceName=" + confRoom + "&FilePath=" + filePath + "HoldClip.mp3&MemberID=" + memberId + "";
                                    gatewayObj.RestApiRequest(postData, httpURL + "ConferencePlay/", "POST");
                                }
                                else if (status == 0)
                                {
                                    postData += "ConferenceName=" + confRoom + "&MemberID=" + memberId + "";
                                    gatewayObj.RestApiRequest(postData, httpURL + "ConferenceStopPlay/", "POST");
                                }
                            }
                        }
                    }
                    helper.ParseDataSet(ds);
                }
            }
            catch (Exception ex)
            {
                Logger.Error("Exception In AgentLogout " + ex.ToString());
            }
            return(helper.GetResponse());
        }
Example #5
0
 public JObject GetIvrStudioSelectionDetails(string connection, int accountId, int callId)
 {
     try
     {
         Press3.DataAccessLayer.Calls callsObject = new Press3.DataAccessLayer.Calls(connection);
         DataSet ds = callsObject.GetIvrStudioSelectionDetails(accountId, callId);
         if (ds == null)
         {
             helper.CreateProperty(UDC.Label.MESSAGE, "No data returned from database");
             helper.CreateProperty(UDC.Label.SUCCESS, false);
         }
         else
         {
             helper.ParseDataSet(ds);
         }
     }
     catch (Exception ex)
     {
         Logger.Error("Exception In GetIvrStudioSelectionDetails " + ex.ToString());
     }
     return(helper.GetResponse());
 }
Example #6
0
 public JObject AssignCallBackRequest(string connection, int accountId, int agentId, int toAgentId, int requestId)
 {
     try
     {
         Press3.DataAccessLayer.Calls callsObject = new Press3.DataAccessLayer.Calls(connection);
         DataSet ds = callsObject.AssignCallBackRequest(accountId, agentId, toAgentId, requestId);
         if (ds == null)
         {
             helper.CreateProperty(UDC.Label.MESSAGE, "No data returned from database");
             helper.CreateProperty(UDC.Label.SUCCESS, false);
         }
         else
         {
             helper.ParseDataSet(ds);
         }
     }
     catch (Exception ex)
     {
         Logger.Error("Exception In AgentLogout " + ex.ToString());
     }
     return(helper.GetResponse());
 }
Example #7
0
 public JObject CallBackRequestManagement(string connection, UserDefinedClasses.CallbackRequest cbrObj)
 {
     try
     {
         Press3.DataAccessLayer.Calls callsObject = new Press3.DataAccessLayer.Calls(connection);
         DataSet ds = callsObject.CallBackRequestManagement(cbrObj);
         if (ds == null)
         {
             helper.CreateProperty(UDC.Label.MESSAGE, "No data returned from database");
             helper.CreateProperty(UDC.Label.SUCCESS, false);
         }
         else
         {
             helper.ParseDataSet(ds);
         }
     }
     catch (Exception ex)
     {
         Logger.Error("Exception In AgentLogout " + ex.ToString());
     }
     return(helper.GetResponse());
 }
Example #8
0
 public JObject SubmitACW(String connection, int agentId, int callId, bool isTransfer)
 {
     try
     {
         Press3.DataAccessLayer.Calls callsObject = new Press3.DataAccessLayer.Calls(connection);
         DataSet ds = callsObject.SubmitACW(agentId, callId, isTransfer);
         if (ds == null)
         {
             helper.CreateProperty(UDC.Label.MESSAGE, "No data returned from database");
             helper.CreateProperty(UDC.Label.SUCCESS, false);
         }
         else
         {
             helper.ParseDataSet(ds);
         }
     }
     catch (Exception ex)
     {
         Logger.Error("Exception In AgentLogout " + ex.ToString());
     }
     return(helper.GetResponse());
 }
Example #9
0
 public JObject ChangeCallStatus(String connection, string status, Int32 agentId, string callId, int accountId, string action, bool isOutbound)
 {
     try
     {
         Press3.DataAccessLayer.Calls callsObject = new Press3.DataAccessLayer.Calls(connection);
         DataSet ds = callsObject.ChangeCallStatus(status, agentId, callId, accountId, action, isOutbound);
         if (ds == null)
         {
             helper.CreateProperty(UDC.Label.MESSAGE, "No data returned from database");
             helper.CreateProperty(UDC.Label.SUCCESS, false);
         }
         else
         {
             helper.ParseDataSet(ds);
         }
     }
     catch (Exception ex)
     {
         Logger.Error("Exception In AgentLogout " + ex.ToString());
     }
     return(helper.GetResponse());
 }
Example #10
0
 public JObject GetCallHistory(String connection, UDC.CallHistoryDetails callHistoryDetails)
 {
     try
     {
         Press3.DataAccessLayer.Calls callsObject = new Press3.DataAccessLayer.Calls(connection);
         DataSet ds = callsObject.GetCallHistory(callHistoryDetails);
         if (ds == null)
         {
             helper.CreateProperty(UDC.Label.MESSAGE, "No data returned from database");
             helper.CreateProperty(UDC.Label.SUCCESS, false);
         }
         else
         {
             helper.ParseDataSet(ds);
         }
     }
     catch (Exception ex)
     {
         helper.CreateProperty("RetMessage", ex.ToString());
         Logger.Error("Exception In AgentLogout " + ex.ToString());
     }
     return(helper.GetResponse());
 }
Example #11
0
 public JObject GetNewCBR(string connection, int CbrId, int agentId, int accountId)
 {
     try
     {
         Press3.DataAccessLayer.Calls callsObject = new Press3.DataAccessLayer.Calls(connection);
         DataSet ds = callsObject.GetNewCBR(CbrId, agentId, accountId);
         if (ds == null)
         {
             helper.CreateProperty(UDC.Label.MESSAGE, "No data returned from database");
             helper.CreateProperty(UDC.Label.SUCCESS, false);
         }
         else
         {
             helper.ParseDataSet(ds);
         }
     }
     catch (Exception ex)
     {
         helper.CreateProperty("RetMessage", ex.ToString());
         Logger.Error("Exception In GetNewCBR " + ex.ToString());
     }
     return(helper.GetResponse());
 }
Example #12
0
 public JObject GetAbandonedcalldetails(String connection, int accountId, string Date, int CallDirection, int CallType, int CallEndStatus, int agentId, int skillGroupId, string fromDate, string toDate, int PageSize, int PageNumber, int StudioId, int sessionAgentId, int roleId)
 {
     try
     {
         Press3.DataAccessLayer.Calls callsObject = new Press3.DataAccessLayer.Calls(connection);
         DataSet ds = callsObject.GetAbandonedcalldetails(accountId, Date, CallDirection, CallType, CallEndStatus, agentId, skillGroupId, fromDate, toDate, PageSize, PageNumber, StudioId, sessionAgentId, roleId, 0);
         if (ds == null)
         {
             helper.CreateProperty(UDC.Label.MESSAGE, "No data returned from database");
             helper.CreateProperty(UDC.Label.SUCCESS, false);
         }
         else
         {
             helper.ParseDataSet(ds);
         }
     }
     catch (Exception ex)
     {
         helper.CreateProperty("RetMessage", ex.ToString());
         Logger.Error("Exception In AgentLogout " + ex.ToString());
     }
     return(helper.GetResponse());
 }
Example #13
0
 public JObject GetCallHistorySearchData(String connection, int accountId, int agentId, int roleId, int skillGroupId, string searchfor)
 {
     try
     {
         Press3.DataAccessLayer.Calls callsObject = new Press3.DataAccessLayer.Calls(connection);
         DataSet ds = callsObject.GetCallHistorySearchData(accountId, agentId, roleId, skillGroupId, searchfor);
         if (ds == null)
         {
             helper.CreateProperty(UDC.Label.MESSAGE, "No data returned from database");
             helper.CreateProperty(UDC.Label.SUCCESS, false);
         }
         else
         {
             helper.ParseDataSet(ds);
         }
     }
     catch (Exception ex)
     {
         helper.CreateProperty("RetMessage", ex.ToString());
         Logger.Error("Exception In AgentLogout " + ex.ToString());
     }
     return(helper.GetResponse());
 }
Example #14
0
        public JObject MakeOutboundCall(string connection, int accountId, int agentId, int customerId, string callUUID, string customerCallUUID, bool isCustomer, string outboundCallBackUrl, int cbrId)
        {
            Press3.DataAccessLayer.Calls callsObject = new Press3.DataAccessLayer.Calls(connection);
            Gateways gatewayObj = new Gateways();
            JObject  resObj     = new JObject();

            try
            {
                DataSet ds = callsObject.MakeOutboundCall(accountId, agentId, customerId, callUUID, customerCallUUID, isCustomer, cbrId);
                if (ds == null)
                {
                    helper.CreateProperty(UDC.Label.MESSAGE, "No data returned from database");
                    helper.CreateProperty(UDC.Label.SUCCESS, false);
                }
                else
                {
                    if (ds.Tables.Count > 0)
                    {
                        if (ds.Tables[0].TableName == "Calls")
                        {
                            if (isCustomer)
                            {
                                string postData = ""; string originationUrl = "";
                                postData       += "From=" + ds.Tables[0].Rows[0]["FromNumber"] + "&To=" + ds.Tables[0].Rows[0]["ToNumber"] + "";
                                postData       += "&SequenceNumber=" + ds.Tables[0].Rows[0]["CallId"] + "&OriginationUUID=" + ds.Tables[0].Rows[0]["CustomerCallUUID"] + "";
                                postData       += "&Gateways=" + ds.Tables[0].Rows[0]["Gateway"] + "&AnswerUrl=" + outboundCallBackUrl + "?IsCustomer=true" + HttpUtility.UrlEncode("&") + "AgentId=" + agentId + "";
                                postData       += "&HangupUrl=" + outboundCallBackUrl + "?IsCustomer=true" + HttpUtility.UrlEncode("&") + "AgentId=" + agentId + "";
                                originationUrl += ds.Tables[0].Rows[0]["GatewayURL"];
                                resObj          = gatewayObj.RestApiRequest(postData, originationUrl + "Call/", "POST");
                            }
                            else
                            {
                                string postData = ""; string originationUrl = "";
                                postData       += "From=" + ds.Tables[0].Rows[0]["FromNumber"] + "&To=" + ds.Tables[0].Rows[0]["ToNumber"] + "";
                                postData       += "&SequenceNumber=" + ds.Tables[0].Rows[0]["CallId"] + "&OriginationUUID=" + ds.Tables[0].Rows[0]["CallUUID"] + "";
                                postData       += "&Gateways=" + ds.Tables[0].Rows[0]["Gateway"] + "&AnswerUrl=" + outboundCallBackUrl + "?IsCustomer=false" + HttpUtility.UrlEncode("&") + "AgentId=" + agentId + "";
                                postData       += "&HangupUrl=" + outboundCallBackUrl + "?IsCustomer=false" + HttpUtility.UrlEncode("&") + "AgentId=" + agentId + "";;
                                originationUrl += ds.Tables[0].Rows[0]["GatewayURL"];
                                resObj          = gatewayObj.RestApiRequest(postData, originationUrl + "Call/", "POST");
                            }
                            resObj.Add("CallId", ds.Tables[0].Rows[0]["CallId"].ToString());
                        }
                        else
                        {
                            resObj = new JObject(new JProperty("Success", "False"), new JProperty("Message", ds.Tables[0].Rows[0]["Message"]));
                            Logger.Error("Exception In MakeOutboundCall:" + ds.Tables[0].Rows[0]["Message"]);
                        }
                    }
                    else
                    {
                        resObj = new JObject(new JProperty("Success", "False"), new JProperty("Message", "No data returned from database"));
                        Logger.Error("Exception In MakeOutboundCall: No data returned from database");
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.Error("Exception In MakeOutboundCall " + ex.ToString());
            }
            return(resObj);
        }
Example #15
0
 public JObject TransferCall(String connection, int agentId, int accountId, int callId, int toAgentId, Boolean isWarmTransfer)
 {
     try
     {
         Press3.DataAccessLayer.Calls callsObject = new Press3.DataAccessLayer.Calls(connection);
         DataSet ds = callsObject.TransferCall(agentId, accountId, callId, toAgentId, isWarmTransfer);
         if (ds == null)
         {
             helper.CreateProperty(UDC.Label.MESSAGE, "No data returned from database");
             helper.CreateProperty(UDC.Label.SUCCESS, false);
         }
         else
         {
             JObject hangupResponse = new JObject();
             JObject dialResponse   = new JObject();
             if (ds.Tables[0].Rows.Count > 0)
             {
                 if (ds.Tables["OutputParameters"].Rows[0]["Success"].ToString() == "True")
                 {
                     dialResponse = Dial(ds, connection, isWarmTransfer, toAgentId);
                     if (Convert.ToBoolean(dialResponse.SelectToken("Success").ToString()))
                     {
                         //if (ds.Tables[0].Rows[0]["OriginationUrl"].ToString() == "user/")
                         if ((ds.Tables[0].Rows[0]["OriginationUrl"].ToString() != null) && (!ds.Tables[0].Rows[0]["OriginationUrl"].ToString().Contains("verto")))
                         {
                             string callType = "";
                             if (!isWarmTransfer)
                             {
                                 callType = "2";
                             }
                             else
                             {
                                 callType = "3";
                             }
                             Logger.Info("AgentWarmTransferId:" + toAgentId.ToString());
                             StringBuilder publishData = new StringBuilder();
                             JObject       messageJobj = new JObject(new JProperty("Channel_Name", "Agent_" + toAgentId.ToString()),
                                                                     new JProperty("CallId", callId),
                                                                     new JProperty("ConferenceRoom", ds.Tables[0].Rows[0]["ConferenceRoom"].ToString()),
                                                                     new JProperty("FromNumber", ds.Tables[0].Rows[0]["Source"].ToString()),
                                                                     new JProperty("IsAgent", false),
                                                                     new JProperty("CallType", callType),
                                                                     new JProperty("RequestUUID", ""),
                                                                     new JProperty("Event", "enter"));
                             Press3.DataAccessLayer.WebSocketController WSCObj = new Press3.DataAccessLayer.WebSocketController(connection);
                             WSCObj.InsertWsNofificationQueue(messageJobj.ToString());
                             ds.Trace(messageJobj);
                         }
                     }
                 }
             }
             helper.ParseDataSet(ds);
             helper.CreateProperty("ToAgentRequestUUID", dialResponse.SelectToken("RequestUUID").ToString());
         }
     }
     catch (Exception ex)
     {
         helper.CreateProperty("RetMessage", ex.ToString());
         Logger.Error("Exception In AgentLogout " + ex.ToString());
     }
     return(helper.GetResponse());
 }