要求:必须给用户打个电话,然后播放语音信息。
Step#1:
在php中进行startoutboundvoicecontact调用。下面是AWS调用及其相关属性的链接。
StartOutboundVoiceContact.html
https://docs.aws.amazon.com/aws-sdk-php/v3/api/api-connect-2017-08-08.html#startoutboundvoicecontact
Step#2:
AWS将使用“预定义语音消息在播放提示”(需要使此动态将来自api)运行特定的联系人流,并对用户进行调用。
Step#3:
用户将接上电话并收听语音信息,呼叫将自动断开,或者用户可以选择断开连接。
Question#1:可以在startoutboundvoicecontact API中传递“动态文本”吗?
Question#2: In Step#1,Contact flow -> Play提示符有文本到语音输入动态选项,但我不太确定它是如何工作的?
Question#3:还有其他api将有助于实现上述功能吗?
发布于 2018-05-26 01:15:02
是的,这在API中是可以实现的,我只是在javascript中实现了相同的流,但是主要部分应该是相同的。

$.Attributes变量在play提示符中添加动态属性。单击联系人流中的Play prompt,并添加您想要在呼叫中使用的文本。我使用了SSML,这也适用于文本:

记住保存并发布的联系人流。
Javascript:
const connect = new aws.Connect();
var params = {
Attributes: {'message' : 'my dynamic message'},
ContactFlowId: 'your contact flow guid (found from url in browser)', /* required */
DestinationPhoneNumber: 'phonenumber to call', /* required */
InstanceId: 'your connect instance id (found from url in browser)', /* required */
SourcePhoneNumber: 'phone number you claimed in connect'
};
connect.startOutboundVoiceContact(params, function (err, data) {
if (err) { console.log('Error', err.stack) }
else { console.log('Success') }
});PHP可能看起来像这样(对不起,从未编码PHP.):
$result = $client->startOutboundVoiceContact([
'Attributes' => array('message' => 'my dynamic message'),
'ContactFlowId' => 'your contact flow guid (found from url in browser)' // REQUIRED
'DestinationPhoneNumber' => 'phonenumber to call', // REQUIRED
'InstanceId' => 'your connect instance id (found from url in browser)', // REQUIRED
'SourcePhoneNumber' => 'phone number you claimed in connect',
]);https://stackoverflow.com/questions/49785535
复制相似问题