" /> Cannot make call programatically in WDE - Genesys CTI User Forum

Author Topic: Cannot make call programatically in WDE  (Read 8551 times)

Offline gzooby

  • Full Member
  • ***
  • Posts: 141
  • Karma: 0
  • Software Engineer at Telefax S.A.
Cannot make call programatically in WDE
« on: May 28, 2015, 05:08:07 PM »
Advertisement
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:

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

        channelService = enterpriseServiceProvider.Resolve<IChannelService>("channelService");[/b]

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

[b]voiceService.MakeCall(agent.EnterpriseAgent, channelService.GetChannel("TServerNEAX"), "202@SwitchNEAX", Genesyslab.Enterprise.Model.Interaction.MakeCallType.Regular, "", kvp, kvp, kvp, 20000);
[/b]
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!

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7641
  • Karma: 56330
Re: Cannot make call programatically in WDE
« Reply #1 on: May 28, 2015, 05:55:12 PM »
Try to make the call from the Extension, not the agent

Offline gzooby

  • Full Member
  • ***
  • Posts: 141
  • Karma: 0
  • Software Engineer at Telefax S.A.
Re: Cannot make call programatically in WDE
« Reply #2 on: May 28, 2015, 06:00:11 PM »
MMM ok, can you show how it would be? An example?
Thank you for your response!
Regards

Z

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7641
  • Karma: 56330
Re: Cannot make call programatically in WDE
« Reply #3 on: May 28, 2015, 06:03:50 PM »
Nope, just following logic, never coded on WDE that but how all deployments I did work

Guess you have to capture the place and get the DNs from it...

Offline gzooby

  • Full Member
  • ***
  • Posts: 141
  • Karma: 0
  • Software Engineer at Telefax S.A.
Re: Cannot make call programatically in WDE
« Reply #4 on: May 28, 2015, 06:15:15 PM »
Here is the problem, when I do agent.EnterpriseAgent, this Enterprise agent doesnīt have any devices. I donīt know whit is this happening

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7641
  • Karma: 56330
Re: Cannot make call programatically in WDE
« Reply #5 on: May 28, 2015, 06:46:02 PM »
Shouldn't, place is the one with devices

Offline gzooby

  • Full Member
  • ***
  • Posts: 141
  • Karma: 0
  • Software Engineer at Telefax S.A.
Re: Cannot make call programatically in WDE
« Reply #6 on: May 28, 2015, 08:53:38 PM »
The thing is, that from the place i cannot obtaing the dn. I got the device like this :
[b]
CustomModule.ObtainCurrentAgent().Place.DeviceService.GetDevices("305", "Resources").ElementAt(0)[/b]


But from here, I wasnīt able to get dn... :-\

Offline abudwill

  • Full Member
  • ***
  • Posts: 157
  • Karma: 4
Re: Cannot make call programatically in WDE
« Reply #7 on: May 28, 2015, 11:20:24 PM »
Use commands instead?

[code]
                    string xfr = "12345";
                    IDictionary<string, object> parameters = new Dictionary<string, object>();
                    parameters.Add("CommandParameter", @case.MainInteraction);
                    parameters.Add("Destination", xfr);
                    commandManager.GetChainOfCommandByName("InteractionVoiceSingleStepTransfer").Execute(parameters);
[/code]

Offline abudwill

  • Full Member
  • ***
  • Posts: 157
  • Karma: 4
Re: Cannot make call programatically in WDE
« Reply #8 on: May 28, 2015, 11:43:10 PM »
Sorry...  I re-read and realized you need to MAKE a call, not transfer a call.  I didn't see a command in docs to flat out make a call :(

Offline Timur Karimov

  • Sr. Member
  • ****
  • Posts: 415
  • Karma: 2
Re: Cannot make call programatically in WDE
« Reply #9 on: May 29, 2015, 07:58:25 AM »
Hi,
How it mented Abudwil you can use the WDE command interface instead of using the T-Server protocols. Here is a little thought about how you should change the Abudwill code:
[code]
                    string xfr = "202";
                    Agents.IMediaVoice myIMediaVoice=youEnterpriseAgentObject.FirstMediaVoice;
                    IDictionary<string, object> parameters = new Dictionary<string, object>();
                    parameters.Add("CommandParameter", myIMediaVoice);
                    parameters.Add("Destination", xfr);
                    parameters.Add("MakeCallType", MakeCallType.Regular);
                    commandManager.GetChainOfCommandByName("MakeCall").Execute(parameters);
[/code]

Look at complete describe of custom commands here
[url=http://docs.genesys.com/Documentation/IW/latest/Developer/PlaceandMedia#cite_note-IMediaVoice-14]http://docs.genesys.com/Documentation/IW/latest/Developer/PlaceandMedia#cite_note-IMediaVoice-14[/url]
hope it help,
Tim

Offline gzooby

  • Full Member
  • ***
  • Posts: 141
  • Karma: 0
  • Software Engineer at Telefax S.A.
Re: Cannot make call programatically in WDE
« Reply #10 on: May 29, 2015, 05:24:11 PM »
Thank you both guys, I willgive it a try, and tell you how it was.
Ur very kind!

Z :)

Offline gzooby

  • Full Member
  • ***
  • Posts: 141
  • Karma: 0
  • Software Engineer at Telefax S.A.
Re: Cannot make call programatically in WDE
« Reply #11 on: May 29, 2015, 07:28:39 PM »
  Agents.IMediaVoice myIMediaVoice=youEnterpriseAgentObject.FirstMediaVoice;

The thing is that FirstMediaVoice returns a IMedia type and I need IMediaVoice type...

Offline gzooby

  • Full Member
  • ***
  • Posts: 141
  • Karma: 0
  • Software Engineer at Telefax S.A.
Re: Cannot make call programatically in WDE
« Reply #12 on: May 29, 2015, 07:34:02 PM »
Maybe a simple casting would do...Gonna try that

Offline gzooby

  • Full Member
  • ***
  • Posts: 141
  • Karma: 0
  • Software Engineer at Telefax S.A.
Re: Cannot make call programatically in WDE
« Reply #13 on: May 29, 2015, 08:42:29 PM »
Thank you all guys for your help. I was able to do ir finally, if someone would like a code sample, just let me know!

Great!!! ;D

Offline aravind_mano

  • Newbie
  • *
  • Posts: 39
  • Karma: 0
Re: Cannot make call programatically in WDE
« Reply #14 on: November 04, 2016, 05:21:32 AM »
Hi, can you please provide me the working code sample. I am struggling on this same issue