Hippias Minor
Hippias Minor

Reputation: 1967

Genesys Platform : Get Call Details 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

Upvotes: 1

Views: 1984

Answers (5)

Jirayu Kaewprateep
Jirayu Kaewprateep

Reputation: 760

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;

Upvotes: 0

brkngcn
brkngcn

Reputation: 11

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

Upvotes: 0

M Ram
M Ram

Reputation: 1

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

Upvotes: 0

orhun.begendi
orhun.begendi

Reputation: 937

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.

Upvotes: 3

Fuad Mehdiyev
Fuad Mehdiyev

Reputation: 13

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.

Upvotes: 1

Related Questions