public PocService() { account = new Account(); authReturnInfo = new AuthorizationReturnInfo(); groupInfo = new MobilePocGroupInfo(); userInfo = new MobilePocUserInfo(); groupUser = new MobilePocGroupUser(); account.seqno = "123"; authReturnInfo.seqno = "123"; }
public void mobileAdd(string oneLine, string operatorName, string localRoomId, string serverRoomId) { Account tmpAccount; int RetStr = 0; //string groupNum = TextFollowing(oneLine, "GROUPNUM:", ";"); //增加成员到组中 tmpAccount.seqno = MobileSeqno; tmpAccount.uri = MobileUserName; tmpAccount.password = MobilePassword; tmpAccount.ip = MobileUrlIp; tmpAccount.port = Convert.ToInt32(MobileUrlPort); mobileManager.account = tmpAccount; MobilePocGroupInfo tmpGroupInfo = new MobilePocGroupInfo(); tmpGroupInfo.groupType = "4"; tmpGroupInfo.groupLevel = "3"; tmpGroupInfo.groupUri = MobileGroupNum; mobileManager.groupInfo = tmpGroupInfo; MobilePocUserInfo userInfo = new MobilePocUserInfo(); userInfo.priority = "2"; int index = oneLine.LastIndexOf(';'); string[] phones = oneLine.Substring(0, index).Split(';'); int i; for (i = 0; i < phones.Length; i++) { //stQchatGroupMember.number_mem = tempUserInfo[i]; userInfo.userName = phones[i]; userInfo.userUri = phones[i] + "@4gpoc.com"; mobileManager.userInfo = userInfo; RetStr = mobileManager.AddGroupMember(); if (RetStr == 0) { //SaveLogInfo.WriteLog("Mobile ADDMEMBERS user " + tempUserInfo[i] + " to groupNum " + sGroupNum + " is success."); //SetText("POC Server:" + "移动添加成员" + tempUserInfo[i] + "成功" + "\r\n"); string msg = string.Empty; msg += "OPERATION:ADDMEMBERACK" + "\r\n" + "OPERATORNAME:" + operatorName + "\r\n" + "SERVERROOMID:" + serverRoomId + "\r\n" + "LOCALCONFROOMID:" + localRoomId + "\r\n" + "TYPE:MOBILE" + "\r\n" + "STATUS:OK" + "\r\n" + "NUMBER:" + phones[i] + "\r\n"; myGlobals.msgBus.sendMessage(msg); } else { //SaveLogInfo.WriteLog("Mobile ADDMEMBERS user " + tempUserInfo[i] + " to groupNum " + sGroupNum + " is fail."); //SetText("POC Server:" + "移动添加成员" + tempUserInfo[i] + "失败" + "\r\n"); string msg = string.Empty; msg += "OPERATION:ADDMEMBERACK" + "\r\n" + "OPERATORNAME:" + operatorName + "\r\n" + "SERVERROOMID:" + serverRoomId + "\r\n" + "LOCALCONFROOMID:" + localRoomId + "\r\n" + "TYPE:MOBILE" + "\r\n" + "STATUS:FAILED" + "\r\n" + "NUMBER:" + phones[i] + "\r\n"; myGlobals.msgBus.sendMessage(msg); } } //SetText("\r\n"); }
//--------------------------------------------------------------------------------- /// 运营商删除成员 ///--------------------------------------------------------------------------------- public void mobileDelete(string oneLine, string operatorName, string localRoomId, string serverRoomId) { Account tmpAccount; int RetStr = 0; string groupNum = MobileGroupNum; int index = oneLine.LastIndexOf(';'); string[] phones = oneLine.Substring(0, index).Split(';'); tmpAccount.seqno = MobileSeqno; tmpAccount.uri = MobileUserName; tmpAccount.password = MobilePassword; tmpAccount.ip = MobileUrlIp; tmpAccount.port = Convert.ToInt32(MobileUrlPort); mobileManager.account = tmpAccount; MobilePocGroupInfo tmpGroupInfo = new MobilePocGroupInfo(); tmpGroupInfo.groupType = "4"; tmpGroupInfo.groupLevel = "3"; tmpGroupInfo.groupUri = groupNum; mobileManager.groupInfo = tmpGroupInfo; MobilePocUserInfo userInfo = new MobilePocUserInfo(); userInfo.priority = "2"; int i; for (i = 0; i < phones.Length; i++) { userInfo.userUri = phones[i] + "@4gpoc.com"; mobileManager.userInfo = userInfo; mobileManager.DelGroupMember(); if (RetStr == 0) { string msg = string.Empty; msg += "OPERATION:DELETEMEMBERACK" + "\r\n" + "OPERATORNAME:" + operatorName + "\r\n" + "SERVERROOMID:" + serverRoomId + "\r\n" + "LOCALCONFROOMID:" + localRoomId + "\r\n" + "TYPE:MOBILE" + "\r\n" + "STATUS:OK" + "\r\n" + "NUMBER:" + phones[i] + "\r\n"; myGlobals.msgBus.sendMessage(msg); } else { string msg = string.Empty; msg += "OPERATION:DELETEMEMBERACK" + "\r\n" + "OPERATORNAME:" + operatorName + "\r\n" + "SERVERROOMID:" + serverRoomId + "\r\n" + "LOCALCONFROOMID:" + localRoomId + "\r\n" + "TYPE:MOBILE" + "\r\n" + "STATUS:FAILED" + "\r\n" + "NUMBER:" + phones[i] + "\r\n"; myGlobals.msgBus.sendMessage(msg); } } }