Author Topic: IWS Customization - detecting when line has disconnected  (Read 3869 times)

Offline abudwill

  • Full Member
  • ***
  • Posts: 157
  • Karma: 4
IWS Customization - detecting when line has disconnected
« on: January 02, 2014, 10:58:45 PM »
Hello,

I am performing various custom tasks for the following scenarios:
* PushPreview record is delivered to agents desktop
* Agent dials record
* Phone line is disconnected (after successful dial)
* Agent marks record as done

To accomplish this I have done the following:
* To perform actions when a record is delivered to the agent desktop, my custom logic lives in the view that is displayed
* For detecting when an agent dials a record, I insert a custom command into the "MediaVoiceMakeCall" chain
* To perform actions when an agent marks a record as done, I insert a custom command into the "BundleClose" chain

I am having a difficult time figuring out how to detect when the phone line gets disconnected.  I see there is a "InteractionVoiceReleaseCall" chain, however that only seems to fire if an agent clicks the release call button.  If the agent hangs up via headset or customer disconnects, this chain is not fired.

Can anyone provide guidance on how I can detect if the call is disconnected?

Regards,
Andrew

Offline abudwill

  • Full Member
  • ***
  • Posts: 157
  • Karma: 4
Re: IWS Customization - detecting when line has disconnected
« Reply #1 on: January 03, 2014, 11:47:28 PM »
Hello,

I have come up with a couple ways of doing this.

To give a little more context - I have an outbound campaign running in Push Preview mode.

My first approach involved attaching a method to the push preview interactions event (IInteraction.InteractionEvent).  As events would flow through my method I would look for the IInteractionVoice object to come through.  When it came through I would again attach a method to the event that fires on that object (IInteraction.InteractionEvent again).  When the line disconnected I was able to see the event and perform actions as needed.  This didn't seem like an ideal way to accomplish what I wanted.

I eventually found what I needed in another forum post: [url=https://forums.genesyslab.com/showthread.php?t=5639]https://forums.genesyslab.com/showthread.php?t=5639[/url]

After reading this post I did the following:

1. Added IAgent to the constructor of my view.
2. Added the following code:

[CODE]IEnterpriseServiceProvider serviceProvider = agentManager.EntrepriseService.Provider;
IVoiceService voiceService = serviceProvider.Resolve<IVoiceService>("voiceService");
voiceService.RegisterEvents(agentManager.FirstMediaVoice.Channel, new Action<Genesyslab.Enterprise.Model.Envelope.IEnvelope<Genesyslab.Enterprise.Model.Interaction.IInteraction>>(VoiceInteractionEvent));[/CODE]

3. Added the following method:

[CODE]private void VoiceInteractionEvent(IEnvelope<Genesyslab.Enterprise.Model.Interaction.IInteraction> interactionEvent)
{
if (interactionEvent.Body.State == Genesyslab.Enterprise.Model.Interaction.InteractionStateType.Ended)
{ ... actions I need to perform ... }
}[/CODE]

Seeing code similar to this in the aforementioned post makes logical sense, but also creates some other questions:

1. I have been using mostly the IWS APIs and not the Enterprise SDK APIs.  Is there somewhere I can get more information on the Enterprise SDK?  I have grabbed the .chm file.  I am more interested in learning things at a higher level such as "What is IEnterpriseServiceProvider and how does it fit in to the whole IWS experience".  This isn't really something that the .chm file goes into.

2. I don't see anything about IVoiceService in the IWS .chm file or the Enterprise SDK .chm file, where would I find more documentation on this interface?