public bool execute(ReconCOM rc, String[] argv) { try { int iRet; String user = argv.Length > 1 ? argv[1] : "System"; //String username = argv.Length > 2 ? argv[2] : "carols"; iRet = rc.T_AgentLogOn(user, user, user, 0); if (iRet == (int)enErrorCode.E_SUCCESS) { System.Console.WriteLine("MyComponentID:" + rc.CM_GetMyComponentID()); BasicHttpBinding binding = new BasicHttpBinding(BasicHttpSecurityMode.None); VCLogServiceClient client = new VCLogServiceClient(binding, new EndpointAddress(new Uri(System.Configuration.ConfigurationSettings.AppSettings["VCLogServiceURL"].ToString(), false))); Console.WriteLine("录音接口登录返回值:" + client.AgentLogin(user, user)); client.Close(); return(true); } System.Console.WriteLine(); System.Console.WriteLine((enErrorCode)iRet); return(false); } catch (Exception ex) { System.Console.WriteLine("Exception: ", ex + " - " + ex.Message); return(false); } }
private void recon_OnCTIEvent(CTIEvent e) { CallID = e.CallID; Trace("recon_OnCTIEvent: " + e.EventName + " event"); Trace(String.Format(" CallID: {0,8:X8} ({1})", e.CallID, e.CallID)); Trace(String.Format(" CallType:{0} Media:{1}", e.CallType, e.MediaType)); Trace(String.Format(" State:{0} Cause:{1}", e.State, e.EventCause)); Trace(String.Format(" dwParam1:0x{0,2:x2} dwParam2:0x{1,2:x2}", e.LongParam1, e.LongParam2)); Trace(String.Format(" sParam1:{0} sParam2:{1}", e.StringParam1, e.StringParam2)); Trace(String.Format(" PartyA DN:{0} {1}", e.PartyA_Number, e.PartyA_Descr)); Trace(String.Format(" PartyB DN:{0} {1}", e.PartyB_Number, e.PartyB_Descr)); //AgentEvent ae=new AgentEvent(); //int i = rc.T_AgentGetState("1040", 2, out ae); //Console.WriteLine((enAgentState)i); // Trace(String.Format(" AttachedData:{0}", e.GetAttachedDataList().ToString())); KeyValueList kvl = new KeyValueList(); int k = rc.T_GetAttachedDataList(e.CallID, out kvl);//获取通话随路数据 //其中UserChoice:Personal //sys_ANI:1000 呼入分机号码 //sys_DNIS:2448 呼入测试号码 //e.PartyB_Number 呼出号码 if (kvl.Size() > 0) { for (int i = 0; i < kvl.Size(); i++) { string skey = ""; kvl.GetPair(i, out skey); Console.WriteLine("GetAttachedData:"); Trace(skey + ":" + kvl.GetValue(skey)); Console.WriteLine(); } } //else //{ // KeyValueList kvl2 = new KeyValueList(); // kvl2.AddPair("CurrentMacAddress", GetMacAddress()); // kvl2.AddPair("CurrentUserID", e.PartyA_Number); // rc.T_AttachDataList(e.CallID, kvl2); //} System.Console.WriteLine("MyComponentID:" + rc.CM_GetMyComponentID()); //Trace((enErrorCode)k + "| KeyValueListCount:" + kvl.Size()); }
public bool execute(ReconCOM rc, String[] argv) { try { int iRet; String username = argv.Length > 1 ? argv[1] : "System"; String password = argv.Length > 2 ? argv[2] : "carols"; iRet = rc.CS_Login(username, password); if (iRet == (int)enErrorCode.E_SUCCESS) { System.Console.WriteLine("MyComponentID:" + rc.CM_GetMyComponentID()); return(true); } System.Console.WriteLine(); System.Console.WriteLine((enErrorCode)iRet); return(false); } catch (Exception ex) { System.Console.WriteLine("Exception: ", ex + " - " + ex.Message); return(false); } }