| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- using System.Data;
- using YTSoft.Common;
- namespace YTSoft.BaseCallCenter.MVCWeb.Controllers
- {
- public class OCXOptController : BaseController
- {
- //
- // GET: /OCXOpt/
- public ActionResult OCXOptAjax()
- {
- return View();
- }
- /// <summary>
- /// 通话处理
- /// </summary>
- /// <param name="OCXOptCallAjax"></param>
- /// <returns></returns>
- [ActionName("OCXOptCallAjax")]
- [HttpGet]
- public string OCXOptCallAjax(string optaction,string timeno,string callid,string userid,string usercode,string username,string extnumber,string callernum,string path)
- {
- //&timeno=" + timeno+"&callid=" + callID + "&userid=" + userid + "&usercode=" + usercode
- //+ "&username=" + username + "&extnumber" + extnumber + "&callernum=" + callerNum
- AddAction("T_Call_CallRecords", callid, "通话处理",string.Format("事件:{0},callid={1},userid={5},usercode={2},extnumber={3},callernum={4}", optaction, callid, usercode, extnumber, callernum, userid),"关键信息");
- string res = "error";
- try
- {
- switch (optaction)
- {
- case "gethflist":
- //res=LoadHFList(context)
- break;
- case "getlist":
- //res=LoadList(context));
- break;
- case "getcallinlist":
- //来电弹屏通话记录
- //res=LoadCallInList(context));
- break;
- case "getgdlist":
- //
- //res=LoadGDList(context));
- break;
- case "deletelist":
- //res=Delete(context));
- break;
- case "clear":
- break;
- case "insertCallLogs":
- res = InsertCallLogs();
- break;
- case "getCallIdByPhone":
- //根据来电号码获取
- res = getCallIdByPhone(callernum);
- break;
- case "zhenlingEvent":
- //振铃事件
- res=zhenlingEvent(callid, userid, usercode, username, extnumber, callernum);
- break;
- case "zhaijiEvent":
- //摘机事件
- res=zhaijiEvent(callid);
- break;
- case "guajiEvent":
- //挂机事件
- res=guajiEvent(callid);
- break;
- case "luyinEvent":
- //录音开始事件
- res=luyinEvent(callid,path);
- break;
- case "callout":
- //外呼
- res = callout(callernum, userid, usercode, username, extnumber, callid);
- break;
- case "callouthf":
- //外呼回访
- res=callouthf(callernum, userid, usercode, username, extnumber, callid);
- break;
- }
- }
- catch
- { }
- return res;
- }
- #region 外呼回访
- public string callouthf(string phone, string userid, string usercode, string username, string extnumber, string hfid)
- {
- string res = "1||" + DateTime.Now.ToString("yyyyMMddHHmmssms");
- try
- {
- //处理判断本地或外地 zhgjie
- try
- {
- if (phone.Trim() != "")
- {
- //判断号码前是否存在0
- if (phone.Trim().Substring(0, 1) != "0")
- {
- //判断是否手机
- if (phone.Trim().Length > 10)
- {
- BLL.T_Sys_MobileData mobile_Bll = new BLL.T_Sys_MobileData();
- Model.T_Sys_MobileData mobileModel = mobile_Bll.GetModel(phone.Substring(0, 7));
- if (mobileModel != null)
- {
- if (mobileModel.F_ZipCode != "0371")
- {
- phone = "0" + phone;
- }
- }
- }
- }
- }
- }
- catch
- { }
- Model.T_Call_CallRecords model = new Model.T_Call_CallRecords();
- model.CallId = DateTime.Now.ToString("yyyyMMddHHmmssms");
- model.CallNumber = phone;
- model.CallType = 1;
- if (!string.IsNullOrEmpty(userid))
- {
- model.UserId = Convert.ToInt32(userid);
- }
- if (!string.IsNullOrEmpty(usercode))
- {
- model.UserCode = usercode.Trim();
- }
- if (!string.IsNullOrEmpty(username))
- {
- model.UserName = HttpUtility.UrlDecode(username.Trim());
- //model.UserName=context.Request.Form["txtAgentName"]
- }
- if (!string.IsNullOrEmpty(extnumber))
- {
- model.ExtNumber = extnumber.Trim();
- //model.UserName=context.Request.Form["txtAgentName"]
- }
- model.CallState = 0;
- model.DealType = 7;
- model.IsDeal = 1;
- model.OperateType = 7;//回访
- model.OperateObject = "";
- model.OperateTime = DateTime.Now;
- try
- {
- if (hfid != "")
- {
- model.OperateObject = hfid;
- }
- }
- catch
- {
- }
- string cid = model.CallId;
- new BLL.T_Call_CallRecords().Add(model);
- try
- {
- //更新回访状态
- new BLL.T_Call_TaskTelNum().UpdateHC(Convert.ToInt32(hfid), 1);
- new BLL.T_Call_TaskTelNum().UpdateYJ(Convert.ToInt32(hfid), 0);
- //string workorderid = CommonRequest.GetQueryString("workorderid");
- //if (workorderid != "")
- //{
- // Model.T_Call_WorkOrder modelorder = new Model.T_Call_WorkOrder();
- // modelorder.CallId = model.CallId;
- // modelorder.F_WORKORDERID = Convert.ToInt32(workorderid);
- // modelorder.F_WORKORDERSTATEID = 6;
- // new BLL.T_Call_WorkOrder().Add(modelorder);
- //}
- }
- catch { }
- if (phone.Length > 5)
- {
- res = "2|" + phone + "|" + cid;
- }
- else
- {
- res = "1|" + phone + "|" + cid;
- }
- }
- catch { }
- return res;
- }
- #endregion
- #region 话机外呼
- public string callout(string phone,string userid,string usercode,string username,string extnumber,string workorderid)
- {
- string res = "1||" + DateTime.Now.ToString("yyyyMMddHHmmssms");
- try
- {
- //处理判断本地或外地 zhgjie
- try
- {
- if (phone.Trim() != "")
- {
- //判断号码前是否存在0
- if (phone.Trim().Substring(0, 1) != "0")
- {
- //判断是否手机
- if (phone.Trim().Length > 10)
- {
- BLL.T_Sys_MobileData mobile_Bll = new BLL.T_Sys_MobileData();
- Model.T_Sys_MobileData mobileModel = mobile_Bll.GetModel(phone.Substring(0, 7));
- if (mobileModel != null)
- {
- if (mobileModel.F_ZipCode != "0371")
- {
- phone = "0" + phone;
- }
- }
- }
- }
- }
- }
- catch
- { }
- Model.T_Call_CallRecords model = new Model.T_Call_CallRecords();
- model.CallId = DateTime.Now.ToString("yyyyMMddHHmmssms");
- model.CallNumber = phone;
- model.CallType = 1;
- if (!string.IsNullOrEmpty(userid))
- {
- model.CallId = DateTime.Now.ToString("yyyyMMddHHmmssms") + userid;
- model.UserId = Convert.ToInt32(userid);
- }
- if (!string.IsNullOrEmpty(usercode))
- {
- model.UserCode = usercode.Trim();
- }
- if (!string.IsNullOrEmpty(username))
- {
- model.UserName = HttpUtility.UrlDecode(username.Trim());
- }
- if (!string.IsNullOrEmpty(extnumber))
- {
- model.ExtNumber = extnumber.Trim();
- //model.UserName=context.Request.Form["txtAgentName"]
- }
- model.CallState = 0;
- model.DealType = 6;
- model.IsDeal = 1;
- string cid = model.CallId;
- new BLL.T_Call_CallRecords().Add(model);
- try
- {
- if (workorderid != null)
- {
- if (workorderid != "")
- {
- Model.T_Call_WorkOrder modelorder = new Model.T_Call_WorkOrder();
- modelorder.CallId = model.CallId;
- modelorder.F_WORKORDERID = Convert.ToInt32(workorderid);
- modelorder.F_WORKORDERSTATEID = 6;
- new BLL.T_Call_WorkOrder().Add(modelorder);
- }
- }
- }
- catch { }
- if (phone.Length > 5)
- {
- res = "2|" + phone + "|" + cid;
- }
- else
- {
- res = "1|" + phone + "|" + cid;
- }
- }
- catch { }
- return res;
- }
- #endregion
- #region 电话操作日志
- public string InsertCallLogs()
- {
- string res = "error";
- return res;
- }
- #endregion
- #region 根据来电号码获取callid
- public string getCallIdByPhone(string telphone)
- {
- string res = "";
- try
- {
- Model.T_Call_CallRecords model = new BLL.T_Call_CallRecords().GetModelByTelphone(telphone);
- if (model != null)
- {
- res = model.CallId.Trim();
- }
- }
- catch (Exception ex)
- {
- res = "";
- }
- return res;
- }
- #endregion
- #region 来电归属地查询
- public string GetPhoneLocation(string phoneNumber, bool isPhone)
- {
- string location = "未知";
- try
- {
- //如果是手机号码
- if (isPhone)
- {
- BLL.T_Sys_MobileData mobile_Bll = new BLL.T_Sys_MobileData();
- Model.T_Sys_MobileData mobileModel = mobile_Bll.GetModel(phoneNumber.Substring(0, 7));
- return mobileModel != null ? (mobileModel.F_CityDes + mobileModel.F_CardDes) : location;
- }
- else//如果是电话号码
- {
- BLL.T_Sys_TelTitleData numbBll = new BLL.T_Sys_TelTitleData();
- List<Model.T_Sys_TelTitleData> mobileModel = numbBll.GetModelList(" 1=1 and F_KeyPhoneNum='" + phoneNumber.Substring(0, 4) + "'");
- if (mobileModel == null || mobileModel.Count <= 0)
- mobileModel = numbBll.GetModelList(" 1=1 and F_KeyPhoneNum='" + phoneNumber.Substring(0, 3) + "'");
- return mobileModel.Count > 0 ? mobileModel[0].F_TitleName : location;
- }
- }
- catch (System.Exception ex)
- {
- return location;
- }
- }
- #endregion
- #region 自动添加工单
- public bool SubmitOSubmit(string phone,string recordid,string callid,string locationaddress,string userid,string username,string usercode, out int workorderid)
- {
- bool bl = false;
- workorderid = 0;
- try
- {
- Model.T_Wo_WorkOrderBase model = new Model.T_Wo_WorkOrderBase();
- List<Model.T_Wo_WorkOrderBase> modellist = new BLL.T_Wo_WorkOrderBase().GetModelList(" F_RANGEID="+ recordid);
- if (modellist != null && modellist.Count > 0)
- {
- model = modellist[0];
- #region 工单信息
- if (string.IsNullOrEmpty(model.F_LINKMAN))
- {
- //model.F_WORKORDERTYPEID = Convert.ToInt32(typeid);//类型ID
- model.F_WORKORDERSTATEID = 0;//状态ID
- model.F_REPAIRREQUEST = "未处理";
- model.F_CODE = "";//工单编号
- model.F_WORKORDERNAME = "";//工单名称
- model.F_NUMBER = model.F_CODE;
- //model.F_CUSTOMERNAME = txtCustomerName.Text.Trim();//客户姓名
- model.F_CUSTOMERTELEPHONE = phone.Trim();//客户电话
- model.F_USERID = Convert.ToInt32(userid);//坐席id
- model.F_LINKMAN = usercode.Trim();//坐席工号
- model.F_REPAIRMANNAME = username.Trim();//坐席名称
- model.F_LINKMANTELEPHONE = phone.Trim();//联系人电话
- //model.F_ADSLACCOUNT = hfCallId.Value.Trim();
- model.F_BANDWIDTH = "";
- model.F_STANDARDADDRESS = locationaddress.Trim();
- //model.F_INSTALLADDRESS = F_INSTALLADDRESS;
- model.F_KSHADDRESSCODE = callid;
- model.F_RANGEID = Convert.ToInt32(recordid);
- model.F_PROVINCE = "";
- model.F_CITY = "";
- model.F_AREA = "";
- model.F_ROAD = "";
- model.F_HOUSING = "";
- model.F_REPAIRMANID = 1;
- model.F_WORKORDERFROM = "语音工单";
- //model.F_WORKORDERLEVELID = F_WORKORDERLEVELID;
- model.F_FILEFLAG = 0;
- model.F_CREATEBY = Convert.ToInt32(userid.Trim());
- model.F_CREATEDATE = DateTime.Now;
- model.F_RETURNVISITFLAG = 0;
- model.F_RETURNVISITSTATE = 0;
- model.F_RETURNVISITRESULT = 0;
- model.F_RETURNVISITCONTENT = "";
- model.F_DELETEFLAG = 0;
- model.F_ALLUSETIMES = 0;
- model.F_STARTTIME = DateTime.Now;
- model.F_OVERTIMES = 0;
- model.F_FORMID = 0;
- model.F_HASTENCOUNTS = 0;
- model.F_RANGEX = 0;
- model.F_RANGEY = 0;
- model.F_REPAIRCLOSEMANID = 0;
- model.F_REPAIRCLOSEMANNAME = "";
- model.F_REPAIRCLOSEREASONS = "";
- model.F_REPAIRCLOSEREPTID = 0;
- model.F_REPAIRCLOSEREPT = "";
- new BLL.T_Wo_WorkOrderBase().Update(model);
- }
- workorderid = model.F_WORKORDERID;
-
- #endregion
- }
- else {
- #region 工单信息
- //model.F_WORKORDERTYPEID = Convert.ToInt32(typeid);//类型ID
- model.F_WORKORDERSTATEID = 0;//状态ID
- model.F_REPAIRREQUEST = "未处理";
- model.F_CODE = "";//工单编号
- model.F_WORKORDERNAME = "";//工单名称
- model.F_NUMBER = model.F_CODE;
- //model.F_CUSTOMERNAME = txtCustomerName.Text.Trim();//客户姓名
- model.F_CUSTOMERTELEPHONE = phone.Trim();//客户电话
- model.F_USERID = Convert.ToInt32(userid);//坐席id
- model.F_LINKMAN = usercode.Trim();//坐席工号
- model.F_REPAIRMANNAME = username.Trim();//坐席名称
- model.F_LINKMANTELEPHONE = phone.Trim();//联系人电话
- //model.F_ADSLACCOUNT = hfCallId.Value.Trim();
- model.F_BANDWIDTH = "";
- model.F_STANDARDADDRESS = locationaddress.Trim();
- //model.F_INSTALLADDRESS = F_INSTALLADDRESS;
- model.F_KSHADDRESSCODE = callid;
- model.F_RANGEID = Convert.ToInt32(recordid);
- model.F_PROVINCE = "";
- model.F_CITY = "";
- model.F_AREA = "";
- model.F_ROAD = "";
- model.F_HOUSING = "";
- model.F_REPAIRMANID = 1;
- model.F_WORKORDERFROM = "语音工单";
- //model.F_WORKORDERLEVELID = F_WORKORDERLEVELID;
- model.F_FILEFLAG = 0;
- model.F_CREATEBY = Convert.ToInt32(userid.Trim());
- model.F_CREATEDATE = DateTime.Now;
- model.F_RETURNVISITFLAG = 0;
- model.F_RETURNVISITSTATE = 0;
- model.F_RETURNVISITRESULT = 0;
- model.F_RETURNVISITCONTENT = "";
- model.F_DELETEFLAG = 0;
- model.F_ALLUSETIMES = 0;
- model.F_STARTTIME = DateTime.Now;
- model.F_OVERTIMES = 0;
- model.F_FORMID = 0;
- model.F_HASTENCOUNTS = 0;
- model.F_RANGEX = 0;
- model.F_RANGEY = 0;
- model.F_REPAIRCLOSEMANID = 0;
- model.F_REPAIRCLOSEMANNAME = "";
- model.F_REPAIRCLOSEREASONS = "";
- model.F_REPAIRCLOSEREPTID = 0;
- model.F_REPAIRCLOSEREPT = "";
- #endregion
- workorderid = new BLL.T_Wo_WorkOrderBase().Add(model);//添加基本信息
- }
-
- if (workorderid > 0)
- {
- bl = true;
- }
- else
- {
- bl = false;
- }
- }
- catch (Exception ex)
- {
- }
- return bl;
- }
- #endregion
- #region 处理振铃事件
- public string zhenlingEvent(string callid, string userid, string usercode, string username, string extnumber, string callernum)
- {
- string res = "error";
- try
- {
- Model.T_Call_CallRecords vmodel = new BLL.T_Call_CallRecords().GetModelByCallId(callid);
- if (vmodel != null)
- {
- #region 存在通话记录
- AddAction("T_Call_CallRecords", callid, "步骤2", string.Format("存在通话记录 事件:{0},callid={1},usercode={2},extnumber={3},callernum={4}", "zhenlingEvent", callid, usercode, extnumber, callernum), "关键信息");
- Model.T_Call_CallRecords model = new Model.T_Call_CallRecords();
- model.CallId = callid;
- if (!string.IsNullOrEmpty(userid))
- {
- model.UserId = Convert.ToInt32(userid);
- }
- if (!string.IsNullOrEmpty(usercode))
- {
- model.UserCode = usercode.Trim();
- }
- if (!string.IsNullOrEmpty(username))
- {
- model.UserName = HttpUtility.UrlDecode(username.Trim());
- //model.UserName=context.Request.Form["txtAgentName"]
- }
- if (!string.IsNullOrEmpty(extnumber))
- {
- model.ExtNumber = extnumber.Trim();
- //model.UserName=context.Request.Form["txtAgentName"]
- }
- model.DealType = 5;
- bool bl = new BLL.T_Call_CallRecords().UpdateCallInRingTelRecord(model);
- if (bl)
- {
- AddAction("T_Call_CallRecords", callid, "步骤3", string.Format("更新成功 事件:{0},callid={1},usercode={2},extnumber={3},callernum={4},userid={5}", "zhenlingEvent", callid, usercode, extnumber, callernum, userid), "关键信息");
- string phone = callernum;
- #region 来电归属地查询
- string location = "";
- //来电归属地查询
- if (phone.Trim().Length == 11 && phone.Substring(0, 1) != "0")
- {
- location = GetPhoneLocation(phone, true);
- }
- else
- {
- location = GetPhoneLocation(phone, false);
- }
- #endregion
- #region 创建工单
- int workorderid = 0;
- bool wobl = SubmitOSubmit(phone, vmodel.CallRecordsId.ToString(), callid, location, userid, username, usercode, out workorderid);
- if (wobl)
- {
- try
- {
- Model.T_Call_WorkOrder modelorder = new Model.T_Call_WorkOrder();
- modelorder.CallId = callid;
- modelorder.F_WORKORDERID = workorderid;
- modelorder.F_WORKORDERSTATEID = 0;
- new BLL.T_Call_WorkOrder().Add(modelorder);
- }
- catch { }
- res = workorderid.ToString();
- }
- #endregion
- }
- else
- {
- AddAction("T_Call_CallRecords", callid, "步骤3", string.Format("更新失败 事件:{0},callid={1},usercode={2},extnumber={3},callernum={4},userid={5}", "zhenlingEvent", callid, usercode, extnumber, callernum, userid), "关键信息");
- }
- #endregion
- }
- else
- {
- AddAction("T_Call_CallRecords", callid, "步骤2", string.Format("不存在通话记录 事件:{0},callid={1},usercode={2},extnumber={3},callernum={4},userid={5}", "zhenlingEvent", callid, usercode, extnumber, callernum, userid), "关键信息");
- Model.T_Call_CallRecords model = new Model.T_Call_CallRecords();
- model.CallId = callid;
- model.CallNumber = callernum.Trim();
- model.CallType = 0;
- if (!string.IsNullOrEmpty(userid))
- {
- //model.CallId = DateTime.Now.ToString("yyyyMMddHHmmssms") + CommonRequest.GetQueryString("userid");
- model.UserId = Convert.ToInt32(userid);
- }
- if (!string.IsNullOrEmpty(usercode))
- {
- model.UserCode = usercode.Trim();
- }
- if (!string.IsNullOrEmpty(username))
- {
- model.UserName = HttpUtility.UrlDecode(username.Trim());
- //model.UserName=context.Request.Form["txtAgentName"]
- }
- if (!string.IsNullOrEmpty(extnumber))
- {
- model.ExtNumber = extnumber.Trim();
- //model.UserName=context.Request.Form["txtAgentName"]
- }
- model.CallState = 0;
- model.DealType = 6;
- model.IsDeal = 1;
- string cid = model.CallId;
- int b = new BLL.T_Call_CallRecords().Add(model);
- if (b > 0)
- {
- AddAction("T_Call_CallRecords", callid, "步骤3", string.Format("添加成功 事件:{0},callid={1},usercode={2},extnumber={3},callernum={4},userid={5}", "zhenlingEvent", callid, usercode, extnumber, callernum, userid), "关键信息");
- string phone = callernum;
- #region 来电归属地查询
- string location = "";
- //来电归属地查询
- if (phone.Trim().Length == 11 && phone.Substring(0, 1) != "0")
- {
- location = GetPhoneLocation(phone, true);
- }
- else
- {
- location = GetPhoneLocation(phone, false);
- }
- #endregion
- #region 创建工单
- int workorderid = 0;
- bool wobl = SubmitOSubmit(phone, b.ToString(), callid, location, userid, username, usercode, out workorderid);
- if (wobl)
- {
- try
- {
- Model.T_Call_WorkOrder modelorder = new Model.T_Call_WorkOrder();
- modelorder.CallId = callid;
- modelorder.F_WORKORDERID = workorderid;
- modelorder.F_WORKORDERSTATEID = 0;
- new BLL.T_Call_WorkOrder().Add(modelorder);
- }
- catch { }
- res = workorderid.ToString();
- }
- #endregion
- }
- else
- {
- AddAction("T_Call_CallRecords", callid, "步骤3", string.Format("添加失败 事件:{0},callid={1},usercode={2},extnumber={3},callernum={4},userid={5}", "zhenlingEvent", callid, usercode, extnumber, callernum, userid), "关键信息");
- }
- }
- }
- catch (Exception ex)
- {
- LogHelper.Default.WriteError("振铃事件:", ex);
- }
- return res;
- }
- #endregion
- #region 处理摘机事件
- public string zhaijiEvent(string callid)
- {
- string res = "error";
- try
- {
- Model.T_Call_CallRecords model = new Model.T_Call_CallRecords();
- model.CallId = callid;
- model.CallState = 1;
- model.DealType = 6;
- bool bl = new BLL.T_Call_CallRecords().UpdateCallInAnswerTelRecord(model);
- if (bl)
- {
- res = "success";
- //更新回访状态
- #region
- /*
- try
- {
- Model.T_Call_CallRecords vmodel = new BLL.T_Call_CallRecords().GetModelByCallId(callid);
- string type = vmodel.OperateType.ToString();
- if (type == "7")
- {
- new BLL.T_Call_TaskTelNum().UpdateYJ(Convert.ToInt32(vmodel.OperateObject.ToString()), 1);
- }
- }
- catch
- {
- }
- */
- #endregion
- }
- }
- catch (Exception ex)
- {
- res = ex.ToString();
- }
- return res;
- }
- #endregion
- #region 处理挂机事件
- public string guajiEvent(string callid)
- {
- string res = "error";
- try
- {
- bool bl = new BLL.T_Call_CallRecords().UpdateCallInHookTelRecord(callid);
- if (bl)
- {
- res = "success";
- }
- }
- catch (Exception ex)
- {
- res = ex.ToString();
- }
- return res;
- }
- #endregion
- #region 处理录音开始事件
- public string luyinEvent(string callid,string path)
- {
- string res = "error";
- try
- {
- Model.T_Call_CallRecords model = new Model.T_Call_CallRecords();
- model.CallId = callid;
- model.CallState = 1;
- model.DealType = 6;
- model.FilePath = path;
- bool bl = new BLL.T_Call_CallRecords().UpdateCallInPathTelRecord(model);
- if (bl)
- {
- res = "success";
- //更新回访状态
- try
- {
- Model.T_Call_CallRecords vmodel = new BLL.T_Call_CallRecords().GetModelByCallId(callid);
- string type = vmodel.OperateType.ToString();
- if (type == "7")
- {
- new BLL.T_Call_TaskTelNum().UpdateYJ(Convert.ToInt32(vmodel.OperateObject.ToString()), 1);
- }
- }
- catch
- {
- }
- }
- }
- catch (Exception ex)
- {
- res = ex.ToString();
- }
- return res;
- }
- #endregion
- }
- }
|