在 amazon connect 中实施 ESL
Implement ESL in amazon connect
在 Amazon connect 中,我需要通过套接字将调用流程传递给外部应用程序并控制来自该应用程序的调用。
Freeswitch
中的 ESL
:Event Socket Library
对于那些不知道 ESL 是什么的人,它将调用传递给外部应用程序中的套接字并从该应用程序获取命令,如 Play
、Disconnect
然后所有命令都在 Freeswitch
的 ESL
库中可用。
amazon connect有这样的能力吗?
谢谢
是的,您可以使用 websockets 开始连接
根据 AWS manual 对于 Amazon Connect Participant Service
:
Method CreateParticipantConnection
creates the participant's connection. Note that ParticipantToken is used for invoking this API instead of ConnectionToken.
The response URL for WEBSOCKET
Type has a connect expiry timeout of 100s. Clients must manually connect to the returned websocket URL and subscribe to the desired topic.
Upon websocket URL expiry, as specified in the response ConnectionExpiry parameter, clients need to call this API again to obtain a new websocket URL and perform the same steps as before.
Request Syntax
``POST /participant/connection HTTP/1.1
X-Amz-Bearer: ParticipantToken
Content-type: application/json
{
"Type": [ "string
" ]
}``
URI Request Parameters
The request uses the following URI parameters.
This is a header parameter.
The Participant Token as obtained from StartChatContact API response.
Length Constraints: Minimum length of 1. Maximum length of 1000.
Required: Yes
Request Body
The request accepts the following data in JSON format.
Type of connection information required.
Type: Array of strings
Array Members: Minimum number of 1 item.
Valid Values: 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替代方案
关于你的问题:
It pass the call to a socket in external application and get command from that application like Play
, Disconnect
And then all commands are available in ESL
library in Freeswitch
AWS 不太可能计划此功能。
在 Amazon connect 中,我需要通过套接字将调用流程传递给外部应用程序并控制来自该应用程序的调用。
Freeswitch
中的 ESL
:Event Socket Library
对于那些不知道 ESL 是什么的人,它将调用传递给外部应用程序中的套接字并从该应用程序获取命令,如 Play
、Disconnect
然后所有命令都在 Freeswitch
的 ESL
库中可用。
amazon connect有这样的能力吗?
谢谢
是的,您可以使用 websockets 开始连接
根据 AWS manual 对于 Amazon Connect Participant Service
:
Method
CreateParticipantConnection
creates the participant's connection. Note that ParticipantToken is used for invoking this API instead of ConnectionToken.The response URL for
WEBSOCKET
Type has a connect expiry timeout of 100s. Clients must manually connect to the returned websocket URL and subscribe to the desired topic.Upon websocket URL expiry, as specified in the response ConnectionExpiry parameter, clients need to call this API again to obtain a new websocket URL and perform the same steps as before.
Request Syntax
``POST /participant/connection HTTP/1.1 X-Amz-Bearer:
ParticipantToken
Content-type: application/json{ "Type": [ "
string
" ] }``URI Request Parameters
The request uses the following URI parameters.
This is a header parameter.
The Participant Token as obtained from StartChatContact API response.
Length Constraints: Minimum length of 1. Maximum length of 1000.
Required: Yes
Request Body
The request accepts the following data in JSON format.
Type of connection information required.
Type: Array of strings
Array Members: Minimum number of 1 item.
Valid Values:
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替代方案
关于你的问题:
It pass the call to a socket in external application and get command from that application like
Play
,Disconnect
And then all commands are available inESL
library inFreeswitch
AWS 不太可能计划此功能。