Hello,
I'm new on Cisco CTI development. I write a desktop application on WPF(C# and .NET).
I stacked on agent connection. I can connect with the session on CTIObject, but i can not connect with the agent. Connection data works if i use CTI Toolkit Agent Desktop.
I followed this manual:
https://developer.cisco.com/fileMedia/download/29140430-f8b9-4c6b-8133-e4117bb55c17
In the page 80-81 you can see an example, i followed it but it can not connect .
Until this point /*4. Connect to server.*/ everything looks fine, i can work with the session, it works.
In the /*5. Set agent for the session. */ returnCode = rSession.SetAgent(agent); I got a fail (Cisco.CtiOs.Cil.CilError.CIL_FAIL) code.
In the step 6 statusConnect is Cisco.CtiOs.Cil.CilError.E_CTIOS_INVALID_SESSION .
I copy here a small code snippet how i worked
/*5. Set agent for the session. */
m_Agent = new Agent();
m_Agent.SetValue(Enum_CtiOs.CTIOS_AGENTID, "9012");
m_Agent.SetValue(Enum_CtiOs.CTIOS_PERIPHERALID, "5000");
statusConnect = m_ctiSession.SetAgent(m_Agent);
var b = m_ctiSession.GetCurrentAgent(); // b is null cause i got a CIL_FAIL
/* 6. Log in the agent.*/
Arguments rArgs = new Arguments();
rArgs.SetValue(Enum_CtiOs.CTIOS_AGENTID, "1012");
rArgs.SetValue(Enum_CtiOs.CTIOS_PERIPHERALID, "5000");
rArgs.SetValue(Enum_CtiOs.CTIOS_AGENTINSTRUMENT, "8209001");
rArgs.SetValue(Enum_CtiOs.CTIOS_AGENTPASSWORD, "password");
statusConnect = m_Agent.Login(rArgs);
/* 7. Enable Agent statistics. */
if (statusConnect == CilError.CIL_OK)
{
m_Agent.EnableAgentStatistics(new Arguments());
}
Thanks for help.
Bests