Author Topic: IWS - Getting the current agent and requesting Not Ready for all media  (Read 3711 times)

Offline Gabi

  • Jr. Member
  • **
  • Posts: 64
  • Karma: 0
Hello. First of all, I want to apologize in advance for my ignorance. I'm only starting to program IWS extensions and no one has ever explained anything to me (I did read the developer's manual, and learned many things from it, but there are still a lot of details which are not clear to me). So, I realize I'm asking pretty basic questions, sorry, but I don't know where else to find the answers.

So, that said... I want to set the agent's status to Not Ready/After Call Work for voice, e-mail and chat at the same time when an e-mail is marked done. I have found that the IAgent interface has a NotReady method for that, but [b]how do I get the agent [/b] so I can call that method? And also, does that make the request for all media types or just one?

And since we're at it, "when an e-mail is marked done" is the InteractionEmailMarkDoneById>MarkDone chain of commands, right? Or is it another?

I will greatly appreciate any help I can get.

Thank you in advance.

« Last Edit: December 02, 2014, 05:59:11 PM by Gabi »

Offline Kubig

  • Hero Member
  • *****
  • Posts: 2752
  • Karma: 44
Re: IWS - Getting the current agent and requesting Not Ready for all media
« Reply #1 on: December 03, 2014, 12:38:35 PM »
You have not switch agent status on particular media channels, but in general you call method like NotReady(). This method change agent status for all logged channel to the NotReady. About the commands, the InteractionEmailMarkDoneById seems to be the right, but you would be sure if you will test it. Unfortunately, with each new version of IWS there are some non-commented change within code-behind - so be aware :)

Offline Gabi

  • Jr. Member
  • **
  • Posts: 64
  • Karma: 0
Re: IWS - Getting the current agent and requesting Not Ready for all media
« Reply #2 on: December 03, 2014, 05:08:19 PM »
I do believe NotReady() should work, but who should be the receiver?

I mean... I have to write [b]someAgent.NotReady()[/b]. Who is "someAgent"? How do I obtain it?

As for the command, I've made it work with InteractionOpenMediaClose>Close (it was called at the right time), but I still can't change the agent's status because I can't get ahold of the agent object itself.

Offline Zoner

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
Re: IWS - Getting the current agent and requesting Not Ready for all media
« Reply #3 on: December 04, 2014, 06:11:28 AM »
If you have an IObjectContainer, you can just resolve the agent with:

[code]IAgent agent = container.Resolve<IAgent>();[/code]

You can get an instance of this container in the constructor of your class via DI.

[code]private readonly IObjectContainer container;

public AfterMediaVoiceLogOn(IObjectContainer container)
{
    this.container = container;
}[/code]

Offline Gabi

  • Jr. Member
  • **
  • Posts: 64
  • Karma: 0
Re: IWS - Getting the current agent and requesting Not Ready for all media
« Reply #4 on: December 29, 2014, 11:42:24 AM »
Thank you, Zoner! That was exactly what I needed.

I tried to reply earlier, but the forum wouldn't let me post.

Offline Kubig

  • Hero Member
  • *****
  • Posts: 2752
  • Karma: 44
Re: IWS - Getting the current agent and requesting Not Ready for all media
« Reply #5 on: December 29, 2014, 11:43:32 AM »
Strongly recommend to read available documentation and visit the developers training.