Genesys CTI User Forum > Genesys-related Development
Having problem on receiving event from Outbound Server?
(1/1)
blanco:
Hi all,
I am not receiving any event from OB server and don't know why. Warnings says that EventBrokerService is deprecated and protocol.Received event is enough to catch the events. I do exactly what they say but couldn't receive any of them. Do u know why? I am using 8.5 PSDK on .NET
OutboundServerProtocol mOCSProtocol = new OutboundServerProtocol(new Endpoint(new Uri(mOCServerURI)));
mOCSProtocol.Received += mmm;
mOCSProtocol.UserName = mUserName;
mOCSProtocol.UserPassword = mUserPassword;
mOCSProtocol.Open(TimeSpan.FromSeconds(5));
private void mmm(object sender, EventArgs e)
{
var args = e as MessageEventArgs;
if ((args != null) && (args.Message != null))
{
//common processing...
}
}
cavagnaro:
So yeah, posting many times same question will definitively help you. Keep going.
hsujdik:
To OB I dont if works the same as other protocols because I havent used it yet, but usually you have to set an event handler before opening the protocol
PeteHoyle:
To get Campaign Events it looks like you have to Register for the Campaign after you have opened the connection:
[code]public OutboundServer()
{
OutboundServerProtocol mOCSProtocol = new OutboundServerProtocol(new Endpoint(new Uri("tcp://demosrv:6127")));
mOCSProtocol.Received += OnOCSMessageReceived;
mOCSProtocol.SetConnectionInvoker(DefaultInvoker.InvokerSingleton);
mOCSProtocol.UserName = "demo";
mOCSProtocol.UserPassword = "";
mOCSProtocol.Open(TimeSpan.FromSeconds(5));
//Register Campaign Campaign DBID, Agent Group DBID, Campaign Group DBID, RequestProperties.
RequestRegisterCampaign req = RequestRegisterCampaign.Create(101, 130, 101, null);
mOCSProtocol.Send(req);
}
private void OnOCSMessageReceived(object sender, EventArgs e)
{
var args = e as MessageEventArgs;
if ((args != null) && (args.Message != null))
{
Console.WriteLine("Message Type: " + args.Message.GetType());
if (args.Message is EventCampaignRegistered)
{
EventCampaignRegistered ecr = args.Message as EventCampaignRegistered;
Console.WriteLine("Campaign Registered: " + ecr);
}
else if (args.Message is EventCampaignStatus)
{
EventCampaignStatus ecs = args.Message as EventCampaignStatus;
Console.WriteLine("Campaign Status: " + ecs);
}
}
}[/code]
blanco:
thanks @PeteHoyle registering campaign solved my problem ;)
Navigation
[0] Message Index
Go to full version