首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在amazon连接中实现ESL

在amazon连接中实现ESL
EN

Stack Overflow用户
提问于 2021-09-18 14:45:12
回答 1查看 143关注 0票数 2

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

类似于ESL in Freeswitch事件套接字库

对于那些不知道ESL是什么的人,它在外部应用程序中传递对套接字的调用,并从该应用程序获得命令,比如PlayDisconnect

然后,所有命令都在ESL库中的Freeswitch中可用。

亚马逊联网有这样的能力吗?

谢谢

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-09-18 16:10:34

是的,您可以使用websockets启动连接。

根据AWS手册Amazon Connect Participant Service

方法CreateParticipantConnection创建参与者的连接。请注意,ParticipantToken用于调用此API,而不是ConnectionToken。 WEBSOCKET类型的响应URL的连接过期超时为100。客户端必须手动连接到返回的websocket并订阅所需的主题。 在websocket到期时,如响应ConnectionExpiry参数中指定的那样,客户端需要再次调用此API以获得新的websocket并执行与前面相同的步骤。 请求语法 POST /participant/connection HTTP/1.1 X-Amz-Bearer: `ParticipantToken` Content-type: application/json { "[Type](https://docs.aws.amazon.com/connect-participant/latest/APIReference/API_CreateParticipantConnection.html#connectparticipant-CreateParticipantConnection-request-Type)": [ "`string`" ] } URI请求参数 请求使用以下URI参数。 ParticipantToken 这是一个标头参数。 从StartChatContact API响应中获得的参与者令牌。 长度约束:最小长度为1。最大长度为1000。 要求:是 请求体 请求接受以下JSON格式的数据。 类型 所需连接信息的类型。 类型:字符串数组 数组成员:最少一个项的数目。 有效值:WEBSOCKET | CONNECTION_CREDENTIALS

样本GO

来源

代码语言:javascript
复制
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替代方案

至于你的问题:

它在外部应用程序中传递对套接字的调用,并从该应用程序(如PlayDisconnect )获取命令,然后在FreeswitchESL库中提供所有命令。

AWS不太可能计划此功能。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69235667

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档