Skip to main content
Content Starts Here

We've Moved!

Please note that we have moved to our New Forum site.


Ask Search:
Chia Hung KengChia Hung Keng 

Genesys WDE Extension: How to retrieve dialing mode from InteractionEvent

Hi,

Is there anyway to determine the dialing mode of an outbound interaction received in WDE via the InteractionEvent?

container.Resolve<IInteractionManager>().InteractionEvent += new System.EventHandler<EventArgs<IInteraction>>(InteractionEvent);

private void InteractionEvent(object sender, EventArgs<IInteraction> e)
{
            IInteraction interaction = e.Value;
var dialingMode = interaction.OutboundChainRecord.Records.First().CampaignInfo.Mode;
}

I was trying to retrieve the dialing mode from CampaignInfo.Mode but it doesn't return any value.

Thanks,
Keng
Best Answer chosen by Chia Hung Keng
Pete HoylePete Hoyle (Genesys)
Actually thinking about this more, you are trying to resolve the ICampaignManager in the constructor of you custom module. What is probably happening is that at the time the constructor of your custom module is run the Outbound Module probably has not yet been called and so the ICampaignManager has not yet been registered.

Either wait until WDE has finished loading before resolving the ICampaignManager or resolve the ICampaignManager on the InteractionEvent where you want to get the Campaign Mode.

All Answers

Pete HoylePete Hoyle (Genesys)
Hi Keng,

As you say the way you use always seems to return null for the Dialing Mode.

Have a look at getting your CampaignName from the Interaction and then using the IOutboundManager to get the IWCampaign where you can get the Dialing Mode.

                                ICampaignManager campaignManager = container.Resolve<ICampaignManager>();
                                IWCampaign myCampaign = campaignManager.GetIWCampaignByName(record.CampaignInfo.Name);
                                log.Debug("MyCampaignMode: " + myCampaign.Mode);
Chia Hung KengChia Hung Keng
Hi Pete,

Thanks for your feedback. By using CampaignManager I assume the user (agent) will need some specific right or permission?

Thanks,
Keng
Pete HoylePete Hoyle (Genesys)
Hi Keng,

Not that I am aware of, just the privaledge to use Outbound which I assumed they had already if they were handling Outbound calls.
The ICampaignManager is updated by the UserEvents sent from OCS when a campaing status changes.

Give it a try and see..

Thanks,

Pete.
Chia Hung KengChia Hung Keng
Hi Pete,

I'm getting the following exception when retrieving the campaign manager:
{"Resolution of the dependency failed, type = \"Genesyslab.Desktop.Modules.Outbound.Model.Campaign.ICampaignManager\", name = \"\". Exception message is: The current build operation (build key Build Key[Genesyslab.Desktop.Modules.Outbound.Model.Campaign.ICampaignManager, null]) failed: The current type, Genesyslab.Desktop.Modules.Outbound.Model.Campaign.ICampaignManager, is an interface and cannot be constructed. Are you missing a type mapping? (Strategy type BuildPlanStrategy, index 3)"}

Sample code:
public class ExtensionModule : IModule
{
...
public ExtensionModule(IObjectContainer container, IViewManager viewManager, ICommandManager commandManager)
{
    this._container = container;
    this._viewManager = viewManager;
    this._commandManager = commandManager;
    ICampaignManager campaignManager = _container.Resolve<ICampaignManager>(); << Exception
}
}

Appricate if you could provide some insight.

Thanks,
Keng
Pete HoylePete Hoyle (Genesys)
Actually thinking about this more, you are trying to resolve the ICampaignManager in the constructor of you custom module. What is probably happening is that at the time the constructor of your custom module is run the Outbound Module probably has not yet been called and so the ICampaignManager has not yet been registered.

Either wait until WDE has finished loading before resolving the ICampaignManager or resolve the ICampaignManager on the InteractionEvent where you want to get the Campaign Mode.
This was selected as the best answer
Chia Hung KengChia Hung Keng
Hi Pete,

Make sense, I will try later and update you.

Thanks again!

Thanks,
Keng
Chia Hung KengChia Hung Keng
Hi Pete,

I am able to resolve the ICampaignManager on the InteractionEvent.

Marking your response as "Best Answer".

Thanks again!

Regards,
Keng