//删除呼叫源规则 private static bool DeleteCallSourceRule(DB_Talk.Model.m_CalinglSourceRule model) { bool b = false; MBoxSDK.ConfigSDK.tagCallSourceRule CallSourceRule = new MBoxSDK.ConfigSDK.tagCallSourceRule(); CallSourceRule.callSourceIndex = model.CallingOrigID; CallSourceRule.seviceType = model.i_ServerType; //默认1不限 CallSourceRule.minReceiveNumLength = model.i_MinReLength; //0; b = MBoxSDK.ConfigSDK.MBOX_DeleteCallSourceRule(Global.Params.BoxHandle, CallSourceRule); return b; }
//创建呼叫源规则 private static bool CreateCallSourceRule(DB_Talk.Model.m_CalinglSourceRule model) { bool b = false; List<DB_Talk.Model.m_CalinglSourceRule> lst = new List<DB_Talk.Model.m_CalinglSourceRule>(); QueryCallSourceRule(out lst); if (lst != null && lst.Count > 0) { if (lst.Contains(model)) { List<DB_Talk.Model.m_CalinglSourceRule> listCallingSource = new DB_Talk.BLL.m_CalinglSourceRule().GetModelList( string.Format(" i_Flag=0 and CallingOrigID='{0}' and CalledRuleID='{1}' and i_ServerType='{2}' and OriRouteID='{3}' and BoxID='{4}'", model.CallingOrigID, model.CalledRuleID, model.i_ServerType, model.OriRouteID, model.BoxID)); if (listCallingSource.Count==0) new DB_Talk.BLL.m_CalinglSourceRule().Add(model); return true; //存在的不再添加 } } MBoxSDK.ConfigSDK.tagCallSourceRule CallSourceRule = new MBoxSDK.ConfigSDK.tagCallSourceRule(); CallSourceRule.callSourceIndex = model.CallingOrigID; CallSourceRule.seviceType = model.i_ServerType; //默认1不限 CallSourceRule.minReceiveNumLength = model.i_MinReLength; //0; b = MBoxSDK.ConfigSDK.MBOX_CreateCallSourceRule(Global.Params.BoxHandle, CallSourceRule); if (b) new DB_Talk.BLL.m_CalinglSourceRule().Add(model); return b; }