0

当呼叫在线时,我可以使用“Genesyslab.Platform.Voice.Protocols.TServer.Requests.Userdata.RequestAttachUserData”添加呼叫属性,但是当呼叫被挂断时该怎么办?

我在 WDE 中找到了这个

void SelectDispositionCodeSetAttachedData(string dispositionCodeValueName);
    //
    // Summary:
    //     Update or add the keys of the specificed KeyValueCollection in the attached data
    //     of the interaction . The current list of attached data can then be retrieved
    //     using GetAttachedData. If the interaction media type is 'voice' or 'instant message'
    //     and the interaction is not released the added/updated values are immediately
    //     committed to T/SIP Server. If the interaction media type is 'voice' or 'instant
    //     message' and the interaction is released the added/updated values are sent to
    //     T/SIP Server as a UserEvent when the interaction is marked done (programmatic?aly
    //     or by Agent). If it is an eServices interaction (e-mail, chat, etc.) and the
    //     interaction is still handled by the agent the added/updated values are immediately
    //     committed to Interaction Server. After e-Services interaction is released, no
    //     further programmatical update is committed to Interaction Server. For all interaction
    //     types any attached data programmatical update applied after interaction release
    //     is not reflected in UI controls such as 'Case information'.

这是我的代码:

Genesyslab.Platform.Commons.Collections.KeyValueCollection keyValueCollectionUpDate = new Genesyslab.Platform.Commons.Collections.KeyValueCollection();
                keyValueCollectionUpDate.Add("Business Result", "Platform: Business Result");
                keyValueCollectionUpDate.Add("StrAttribute1", "AttachedData.Business Result"); RequestAttachUserData requestAttachUserData= RequestAttachUserData.Create("7012", GetConnectionID(ExtractedArtributes[1][0].Value.ToString()), keyValueCollectionUpDate); IMessage respondingEvent2=tserverProtocol.Request(requestAttachUserData);

掉话后需要添加通话attts

4

3 回答 3

0

当代理单击 WDE 自定义命令中的“标记完成”时,我使用 WDE 本身附加数据来解决此问题。

于 2019-04-18T11:14:22.997 回答
0

通话中断时,您无法更新附加数据。

于 2019-04-18T07:43:06.103 回答
0

断开连接后将数据附加到语音呼叫的方法是发送一个UserEvent. 这确实需要AfterCallWork在您的环境中启用状态。您已经提到了解如何将命令插入命令链。该命令的示例Execute函数可以插入到“BundleClose”命令链中,在“Close”命令之前。

这个示例是在 VB 中,很抱歉,但我想你可以很容易地转换为 c#。

Public Function Execute(ByVal parameters As IDictionary(Of String, Object), ByVal progress As IProgressUpdater) As Boolean Implements IElementOfCommand.Execute
    ' To go to the main thread
    If Application.Current.Dispatcher IsNot Nothing AndAlso Not Application.Current.Dispatcher.CheckAccess() Then
        Dim result As Object = Application.Current.Dispatcher.Invoke(DispatcherPriority.Send, New ExecuteDelegate(AddressOf Execute), parameters, progress)
        Return CBool(result)
    Else

        Dim interactionsBundle As IInteractionsBundle = Nothing
        Dim interaction As IInteraction = Nothing
        interactionsBundle = parameters("CommandParameter")
        interaction = interactionsBundle.MainInteraction

        Dim channel As Enterprise.Model.Channel.IClientChannel = interaction.EntrepriseInteractionCurrent.ActiveChannel 'agent.Channel
        Dim protocol As IProtocol = channel.Protocol

        Dim kvp As Platform.Commons.Collections.KeyValueCollection = New Platform.Commons.Collections.KeyValueCollection()
        kvp.Add("keyname", "keyvalue")

        Dim userevent As Platform.Voice.Protocols.TServer.CommonProperties = Platform.Voice.Protocols.TServer.CommonProperties.Create()
        userevent.UserData = kvp

        Dim connID As Platform.Voice.Protocols.ConnectionId = Nothing

        Dim interactionVoice as IInteractionVoice = TryCast(interaction, IInteractionVoice)

        If interactionVoice IsNot Nothing Then
            userevent.UserEvent = Platform.Voice.Protocols.TServer.Events.EventUserEvent.MessageId
            connID = New Platform.Voice.Protocols.ConnectionId(interactionVoice.TConnectionId)
            
            Dim strDN As String = Nothing
            'ensure the correct DN is passed when attaching reason codes, in case agent is logged into multiple DNs
            Dim devices() As Enterprise.Model.Device.IDevice = interactionVoice.Device
            Dim device As Enterprise.Core.DN = devices(0)
            strDN = device.Name
            userevent.ThisDN = strDN
            userevent.ConnID = connID

            Dim req = Platform.Voice.Protocols.TServer.Requests.Special.RequestSendEvent.Create()
            req.UserEvent = userevent

            'send request
            protocol.Send(req)  

        End If
    End If
    
End Function
于 2021-10-07T09:28:28.883 回答