Genesys CTI User Forum
Genesys CTI User Forum => Genesys-related Development => Topic started by: cavagnaro on July 31, 2013, 01:00:55 PM
-
Hi guys,
Testing the PSDK for a project and getting stuck on capturing ConnID... :/
Here I open a connection to the TServer and declare a function to capture the Events.
[Code]
private void btnConnect_Click(object sender, EventArgs e)
{
TServerEndPoint = new Endpoint("TServer", txtServer.Text, int.Parse(txtPort.Text));
tServerProtocol = new TServerProtocol(TServerEndPoint);
tServerProtocol.Received += OnTServerMessageReceived;
try
{
tServerProtocol.Open();
}
catch (Exception ex)
{
writeToLogArea(ex.Message);
}
}
[/Code]
On the Function I do a simple switch:
[CODe]
private void OnTServerMessageReceived(object sender, EventArgs e)
{
MessageEventArgs args = (MessageEventArgs)e;
System.Diagnostics.Debug.WriteLine( args.Message);
writeToLogArea(args.Message.ToString()); //This works by writing output to a log file
switch (args.Message.Id)
{
case EventDialing.MessageId:
ConnectionId vConnID = ((EventDialing)sender).ConnID;
break;
[/CODE]
But here it says it can't convert the TServerProtocol to a EventDialing object...so how can I capture the ConnID or do the proper cast?
Thanks!
-
Use IInteractionVoice interface or low-level Enterprise interaction, which provides data such as queue, etc.
-
Just found the answer hehe, I think that not sleeping and being tire make stuff more difficult ;)
[code]
case EventDialing.MessageId:
IMessage message1 = ((MessageEventArgs)e).Message;
var myDN = ((EventRegistered)message1).ThisDN;
break;
[/code]
-
[quote author=Kubig link=topic=7925.msg34708#msg34708 date=1375276488]
Use IInteractionVoice interface or low-level Enterprise interaction, which provides data such as queue, etc.
[/quote]
In english? ;)
-
I am sorry, I forgot that you are not using IWS :-)
So, you can get connectionID from each Event from T-Server, map the response from T-Server to IMessage type and afterward convert to specific Event. It is same scenario as for others requests within GenesysPSDK