We've Moved!
Please note that we have moved to our New Forum site.
Chia 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
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
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
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);
Thanks for your feedback. By using CampaignManager I assume the user (agent) will need some specific right or permission?
Thanks,
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.
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
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.
Make sense, I will try later and update you.
Thanks again!
Thanks,
Keng
I am able to resolve the ICampaignManager on the InteractionEvent.
Marking your response as "Best Answer".
Thanks again!
Regards,
Keng