Genesys CTI User Forum
Genesys CTI User Forum => Genesys-related Development => Topic started by: Gabi on January 13, 2017, 05:01:36 PM
-
I've been having some trouble with this.
I need a way to set the treatment and/or call result of an outbound record programatically in a setting where disposition codes are not shown to the user.
For instance, I could treat a certain record as busy or wrong number if certain conditions are met.
Is there any way to do this?
I tried setting the call result of the outbound record both before and after the SetCallResultOutboundRecord command of the SetCallResultOutboundRecord chain, but that has no effect on the calling list.
I will appreciate any help you can provide.
-
I found a way to do it, but then the call result I set is overwritten. This is what I've done so far.
This assumes I have an InteractionPullPreview called interaction, and that I have the result I want in a variable named result, and an IObjectContainer named container.
[code] IInteractionPullPreview previewInteraction = interaction as IInteractionPullPreview;
IRecord outboundRecord = previewInteraction.OutboundRecord;
outboundRecord.CallResult = result;
outboundRecord.SystemFields["GSW_TREATMENT"] = (object)"RecordTreatCampaign";//Or "RecordTreatPersonal", depending on your needs.
IEnterpriseServiceProvider. enterpriseServiceProvider = container.Resolve<IAgent>().EntrepriseService;
IOutboundService oService = enterpriseServiceProvider.Resolve<IOutboundService>("outboundService");
IDevice device = interaction.Agent.FirstMediaVoice.Device;
oService.UpdateRecord(device, outboundRecord, null, null);[/code]
But then the MarkProcessedOutboundChain command overwrites the call result. :(
-
Try this code snippet, it will update the call result in the model, but not the view, but it should be enough.
[code]
if (!string.IsNullOrEmpty(interaction.BundleId))
{
IInteractionsBundle interactionBundle = interactionManager.GetBundleById(interaction.BundleId);
if ((interactionBundle.UserData != null) && (Application.Current != null))
{
Application.Current.Dispatcher.Invoke(new System.Action(delegate()
{
outboundDispositionViewModel = interactionBundle.UserData.TryGetValue("OutboundDispositionViewModel") as IOutboundDispositionViewModel;
if (outboundDispositionViewModel != null)
{
//Set the Call result, does not update the view..
outboundDispositionViewModel.SelectedCallResult = callResult;
}
else
{
log.Debug("outboundDispositionViewModel is null");
}
}));
}
}[/code]
-
Thank you!