【问题标题】:Genesys Platform : Get Call Details From Sip ServerGenesys 平台:从 Sip 服务器获取呼叫详细信息
【发布时间】:2015-04-24 13:18:52
【问题描述】:
  • 我想从 Genesys 平台 SIP 服务器获取 呼叫详细信息

  • 而且 Genesys 平台有 Platform SDK for .NET

  • Anybod 有一个简单的示例代码,它显示了如何使用 Platform SDK for .NET [C#] 从 SIP 服务器获取呼叫详细信息

补充说明:

通话详细信息:特别是我想为给定通话获取 AgentId

来自 Sip Server:我不确定 Sip Server 是否是最好的候选人 接听电话详情。所以对其他建议/替代方案持开放态度

【问题讨论】:

  • 请提供更多信息 - 您需要从哪里获取通话详细信息?另一个需要这些数据的系统,或者您想在平台本身开发一些东西?
  • 感谢您的关注。另一个系统需要数据,但我可以使用平台来获取这些数据。
  • 呼叫SIP服务器需要什么信息?即您打算使用什么来识别您希望获取信息的呼叫?你有ConnID 吗?

标签: pbx sip-server genesys


【解决方案1】:

您可以构建一个监控 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平台没有。

我希望这已经足够清楚了。

【讨论】:

    【解决方案2】:

    如果您有权访问路由策略并且可以对其进行编辑。您可以在策略中添加一些代码,以将所需的详细信息发送到某些 Web 服务器(例如)或 DB。我们在我们的战略中做这样的事情。成功路由块后作为后路由策略发送 RTargetPlaceSelected 和 RTargetAgentSelected 的值。

    【讨论】:

      【解决方案3】:

      试试这个:

      >

      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;

      【讨论】:

        【解决方案4】:

        我们得到 AgentID 和 Place 如下, 第 1 步: 在 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
        

        【讨论】:

          【解决方案5】:
          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;
          }
          

          【讨论】:

            猜你喜欢
            • 1970-01-01
            • 2019-07-14
            • 1970-01-01
            • 2019-12-18
            • 1970-01-01
            • 2017-07-16
            • 2018-07-03
            • 2022-08-19
            • 1970-01-01
            相关资源
            最近更新 更多