Genesys Engage on-premises

 View Only

Discussion Thread View
  • 1.  WDE Customization. Make Call programatically

    Posted 05-28-2015 17:05
    Hi, I´m customizing WDE. I login my agent in place P305, in the extension 305, and acd position acd_305. I want to make a call programatically to extension 202, so first in my custom module I obtaing Agent, Voice Service and Channel Service as following:

     agent = unityContainer.Resolve<Genesyslab.Desktop.Modules.Core.Model.Agents.IAgent>();
             
             IEnterpriseServiceProvider enterpriseServiceProvider = agent.EntrepriseService;
             
             voiceService = enterpriseServiceProvider.Resolve<IVoiceService>("voiceService");

             channelService = enterpriseServiceProvider.Resolve<IChannelService>("channelService");

    All this atributes are static, and can be obtained from other classes.
    When I want to make the call, i invoke the following method:

    voiceService.MakeCall(agent.EnterpriseAgent, channelService.GetChannel("TServerNEAX"), "202@SwitchNEAX", Genesyslab.Enterprise.Model.Interaction.MakeCallType.Regular, "", kvp, kvp, kvp, 20000);

    Exception tells me my agent dn is not valid. But if I call 202 naturally from interaction bar, the call can be executed without problems. 
    Any ideas?

    Thank you!
                


     


  • 2.  RE: WDE Customization. Make Call programatically

    Posted 06-04-2015 19:52
    Try looking at ICommandManager interface and executing the MediaMakeVoiceCall command manually, much easier.


  • 3.  RE: WDE Customization. Make Call programatically

    Posted 10-01-2019 16:43
    I know this thread is very old, but it's quite helpful for me, so I thought I'd post my 2 cents.

    The actual exception is 'Agent has no valid DN'. I'm in the same situation. Thank you for posting this code though! I couldn't find this documented anywhere, and ICommandManager isn't helpful since we're initiating an event, not injecting logic into an existing command chain. MediaMakeVoiceCall isn't found anywhere in any documentation.

    Instead of making a call from an agent, make it from a device. Here is what worked for me: (tested with 8.5.3)
    _agent = container.Resolve<IAgent>();
    
    IClientChannel _tserverChannel;
    
    IChannelService _channelService = _agent.EntrepriseService.Resolve<IChannelService>("channelService");
    
    var channels = _channelService.ListChannels<Genesyslab.Platform.Voice.Protocols.TServerProtocol>();
    if (channels.Length > 0)
    {
        _tserverChannel = channels[0];
    }
    else
    {
        throw new Exception("Could not find a TServer Channel");
    }
    
    IDeviceService deviceService = _agent.EntrepriseService.Resolve<IDeviceService>("deviceService");
    IDevice _device = deviceService.GetDevice(_agent.Place.PlaceName, _agent.Tenant.Name, _tserverChannel.Name);
    
    IVoiceService _voiceSvc = _agent.EntrepriseService.Resolve<IVoiceService>("voiceService");
    string phoneToDial = "1234";
    _voiceSvc.MakeCall((IDN)_device, _tserverChannel, phoneToDial, MakeCallType.Regular, "", null, null, null);


    ------------------------------
    Jeff Collell
    Fisher Investments
    ------------------------------



Need Help finding something?

Check out the Genesys Knowledge Network - your all-in-one access point for Genesys resources