1
  • I want to get Call Details from Genesys Platform SIP Server.

  • And Genesys Platform has Platform SDK for .NET .

  • Anybod has a SIMPLE sample code which shows how to get call details using Platform SDK for .NET [ C# ] from SIP Server?

Extra Notes:

Call Details : especially i wanted to get AgentId for a given call

and

From Sip Server : I am not sure if Sip Server is the best candiate to take call details. So open to other suggestions/ alternatives

Hippias Minor
  • 1,917
  • 2
  • 21
  • 46
  • Please provide more information - where do you need to obtain the call details from? Another system that needs this data or you want to develop something in the platform itself? – Plamen G May 02 '15 at 12:35
  • Well thanks for your interest. Another system needs data but I can use platform to obtain this data. – Hippias Minor May 28 '15 at 14:18
  • What information do you have to query SIP Server for the call? i.e. what do you plan to use to identify the call that you wish to get information about? Do you have the `ConnID` ? – hynsey Oct 15 '15 at 12:38

5 Answers5

3

You can build a class that monitor DN actions. Also you watch specific DN or all DN depending what you had to done. If its all about the call, this is the best way to this.

Firstly, you must define a TServerProtocol, then you must connect via host,port and client info.

    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();

I always use async way to do this. I got my reason thou :) You can detect when connection open with event that provided by SDK.

    protocol.Opened += new EventHandler(OnProtocolOpened);
    protocol.Closed += new EventHandler(OnProtocolClosed);
    protocol.Received += new EventHandler(OnMessageReceived);
    protocol.Error += new EventHandler(OnProtocolError);

Here there is OnMessageReceived event. This event where the magic happens. You can track all of your call events and DN actions. If you go genesys support site. You'll gonna find a SDK reference manual. On that manual quiet easy to understand there lot of information about references and usage. So in your case, you want agentid for a call. So you need EventEstablished to do this. You can use this in your recieve event;

    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;
     }

You can lot of this with this usage. Like dialing, holding on a call inbound or outbound even you can detect internal calls and reporting that genesys platform don't.

I hope this is clear enough.

Mikhail Ionkin
  • 568
  • 4
  • 20
orhun.begendi
  • 937
  • 3
  • 16
  • 31
1

If you have access to routing strategy and you can edit it. You can add some code to strategy to send the details you need to some web server (for example) or to DB. We do such kind of stuff in our strategy. After successful routing block as a post routing strategy sends values of RTargetPlaceSelected and RTargetAgentSelected.

0

Try this:

Genesyslab.Platform.Contacts.Protocols.ContactServer.Requests.JirayuGetInteractionContent

JirayuGetInteractionContent =
    Genesyslab.Platform.Contacts.Protocols.ContactServer.Requests.JirayuGetInteractionContent.Create();
 JirayuGetInteractionContent.InteractionId = "004N4aEB63TK000P";
Genesyslab.Platform.Commons.Protocols.IMessage respondingEventY = contactserverProtocol.Request(JirayuGetInteractionContent);
Genesyslab.Platform.Commons.Collections.KeyValueCollection keyValueCollection = ((Genesyslab.Platform.Contacts.Protocols.ContactServer.Events.EventGetInteractionContent)respondingEventY).InteractionAttributes.AllAttributes;
General Grievance
  • 4,555
  • 31
  • 31
  • 45
0

We are getting AgentID and Place as follows, Step-1: Create a Custome Command Class and Add Chain of command In ExtensionSampleModule class as follows,

 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
M Ram
  • 1
  • 4
0
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;
}
brkngcn
  • 1
  • 1