在amazon connect中实现ESL



InAmazon connect,我需要通过套接字将调用流传递给外部应用程序,并控制来自该应用程序的调用。

例如ESLinFreeswitch: Event Socket Library

对于那些不知道ESL是什么的人,它将调用传递给外部应用程序中的套接字,并从该应用程序(如Play,Disconnect)获取命令

然后所有的命令都可以在FreeswitchESL库中使用。

amazon connect有这样的能力吗?

感谢

可以使用websockets启动连接

根据AWSAmazon Connect Participant Service手册:

方法CreateParticipantConnection创建与会者的连接。注意,ParticipantToken是用来调用这个API的,而不是ConnectionToken。

WEBSOCKET类型的响应URL的连接超时时间为100秒。客户端必须手动连接到返回的websocket URL并订阅所需的主题。

当websocket URL到期时,如response ConnectionExpiry参数所指定的,客户端需要再次调用此API以获取新的websocket URL,并执行与之前相同的步骤。

请求语法

' ' POST/participant/connection HTTP/1.1X-Amz-Bearer:ParticipantToken内容类型:application/json

{类型"; ["string";]} '

URI请求参数

请求使用以下URI参数。

ParticipantToken

这是一个头参数。

从StartChatContact API响应中获得的参与者令牌。

长度约束:最小长度为1。最大长度1000.

要求:是的

请求体

请求接受以下JSON格式的数据。

所需的连接信息类型。

类型:字符串数组

Array Members: Minimum number of 1 item.

有效值:WEBSOCKET | CONNECTION_CREDENTIALS

GO代码示例

来源
type CreateParticipantConnectionInput struct {
// This is a header parameter.
//
// The Participant Token as obtained from StartChatContact (https://docs.aws.amazon.com/connect/latest/APIReference/API_StartChatContact.html)
// API response.
//
// ParticipantToken is a required field
ParticipantToken *string `location:"header" locationName:"X-Amz-Bearer" min:"1" type:"string" required:"true"`
// Type of connection information required.
//
// Type is a required field
Type []*string `min:"1" type:"list" required:"true"`
// contains filtered or unexported fields
}
type CreateParticipantConnectionOutput struct {
// Creates the participant's connection credentials. The authentication token
// associated with the participant's connection.
ConnectionCredentials *ConnectionCredentials `type:"structure"`
// Creates the participant's websocket connection.
Websocket *Websocket `type:"structure"`
// contains filtered or unexported fields
}

var params CreateParticipantConnectionInput;
mySession := session.Must(session.NewSession())
// Create a ConnectParticipant client from just a session.
client := connectparticipant.New(mySession)
// Create a ConnectParticipant client with additional configuration
client := connectparticipant.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
params.ParticipantToken := getToken();// The Participant Token as obtained from StartChatContact (https://docs.aws.amazon.com/connect/latest/APIReference/API_StartChatContact.html) 
req, resp := client.CreateParticipantConnection(params);
err := req.Send()
if err == nil { // resp is now filled
fmt.Println(resp)
}
<标题>

ESL替代关于你的问题:

它将调用传递给外部应用程序中的套接字,并从该应用程序(如Play,Disconnect)获取命令然后所有的命令都可以在Freeswitch

ESL库中使用。

AWS不太可能计划此功能。

最新更新