我想从 Genesys 平台 SIP 服务器获取呼叫详细信息。
并且 Genesys Platform 有Platform SDK for .NET。
- Anybod 有一个简单的示例代码,它显示了如何使用 Platform SDK for .NET [C#] 从 SIP 服务器获取呼叫详细信息?
额外说明:
通话详细信息:特别是我想获取给定通话的AgentId
和
来自 Sip Server:我不确定 Sip Server 是否是获取通话详细信息的最佳候选者。所以对其他建议/替代方案持开放态度
我想从 Genesys 平台 SIP 服务器获取呼叫详细信息。
并且 Genesys Platform 有Platform SDK for .NET。
额外说明:
通话详细信息:特别是我想获取给定通话的AgentId
和
来自 Sip Server:我不确定 Sip Server 是否是获取通话详细信息的最佳候选者。所以对其他建议/替代方案持开放态度
您可以构建一个监控 DN 操作的类。您还可以查看特定的 DN 或所有 DN,具体取决于您必须完成的操作。如果一切都与通话有关,那么这是最好的方法。
首先,您必须定义一个 TServerProtocol,然后您必须通过主机、端口和客户端信息进行连接。
var endpoint = new Endpoint(host, port, config);
//Endpoint backupEndpoint = new Endpoint("", 0, config);
protocol = new TServerProtocol(endpoint)
{
ClientName = clientName
};
//Sync. way;
protocol.Open();
//Async way;
protocol.BeginOpen();
我总是使用异步方式来做到这一点。我明白了你的理由:) 你可以通过 SDK 提供的事件检测连接何时打开。
protocol.Opened += new EventHandler(OnProtocolOpened);
protocol.Closed += new EventHandler(OnProtocolClosed);
protocol.Received += new EventHandler(OnMessageReceived);
protocol.Error += new EventHandler(OnProtocolError);
这里有 OnMessageReceived 事件。这个魔术发生的事件。您可以跟踪所有呼叫事件和 DN 操作。如果你去genesys支持网站。您将找到 SDK 参考手册。在那本手册上很容易理解,那里有很多关于参考和使用的信息。因此,在您的情况下,您需要 agentid 进行通话。所以你需要 EventEstablished 来做到这一点。您可以在您的接收活动中使用它;
var message = ((MessageEventArgs)e).Message;
// your event-handling code goes here
switch (message.Id)
{
case EventEstablished.MessageId:
var eventEstablished = message as EventEstablished;
var AgentID = eventEstablished.AgentID;
break;
}
你可以用这种用法来做很多事情。就像拨号一样,保持呼入或呼出呼叫,即使您可以检测到内部呼叫并报告genesys平台没有。
我希望这已经足够清楚了。
如果您有权访问路由策略并且可以对其进行编辑。您可以在策略中添加一些代码,以将所需的详细信息发送到某些 Web 服务器(例如)或 DB。我们在我们的战略中做这样的事情。在成功的路由块作为后路由策略发送 RTargetPlaceSelected 和 RTargetAgentSelected 的值。
我们得到 AgentID 和 Place 如下, 步骤 1: 创建一个 Custome 命令类并在 ExtensionSampleModule 类中添加命令链,如下所示,
class LogOnCommand : IElementOfCommand
{
readonly IObjectContainer container;
ILogger log;
ICommandManager commandManager;
public bool Execute(IDictionary<string, object> parameters, IProgressUpdater progress)
{
if (Application.Current.Dispatcher != null && !Application.Current.Dispatcher.CheckAccess())
{
object result = Application.Current.Dispatcher.Invoke(DispatcherPriority.Send, new ExecuteDelegate(Execute), parameters, progress);
return (bool)result;
}
else
{
// Get the parameter
IAgent agent = parameters["EnterpriseAgent"] as IAgent;
IIdentity workMode = parameters["WorkMode"] as IIdentity;
IAgent agentManager = container.Resolve<IAgent>();
Genesyslab.Desktop.Modules.Core.Model.Agents.IPlace place = agentManager.Place;
if (place != null)
{
string Place = place.PlaceName;
}
else
log.Debug("Place object is null");
CfgPerson person = agentManager.ConfPerson;
if (person != null)
{
string AgentID = person.UserName;
log.DebugFormat("Place: {0} ", AgentID);
}
else
log.Debug("AgentID object is null");
}
}
}
// In ExtensionSampleModule
readonly ICommandManager commandManager;
commandManager.InsertCommandToChainOfCommandAfter("MediaVoiceLogOn", "LogOn", new
List<CommandActivator>() { new CommandActivator()
{ CommandType = typeof(LogOnCommand), Name = "OnEventLogOn" } });
enter code here
尝试这个:
>
Genesyslab.Platform.Contacts.Protocols.ContactServer.Requests.JirayuGetInteractionContent JirayuGetInteractionContent = Genesyslab.Platform.Contacts.Protocols.ContactServer.Requests.JirayuGetInteractionContent.Create();
JirayuGetInteractionContent.InteractionId = "004N4aEB63TK000P"; Genesyslab.Platform.Commons.Protocols.IMessageresponsiveEventY = contactserverProtocol.Request(JirayuGetInteractionContent); Genesyslab.Platform.Commons.Collections.KeyValueCollection keyValueCollection = ((Genesyslab.Platform.Contacts.Protocols.ContactServer.Events.EventGetInteractionContent)respondingEventY).InteractionAttributes.AllAttributes;
IInteractionVoice interaction = (IInteractionVoice)e.Value;
switch (interaction.EntrepriseLastInteractionEvent.Id)
{
case EventEstablished.MessageId:
var eventEstablished = interaction.EntrepriseLastInteractionEvent as EventEstablished;
var genesysCallUuid = eventEstablished.CallUuid;
var genesysAgentid = eventEstablished.AgentID;
.
.
.
.
break;
}