As traduções são geradas por tradução automática. Em caso de conflito entre o conteúdo da tradução e da versão original em inglês, a versão em inglês prevalecerá.
Você usa a ação ReceiveDigits
para coletar dígitos DTMF de entrada e compará-los com uma expressão regular. Quando o aplicativo de mídia SIP recebe dígitos que correspondem à expressão regular, ele invoca uma AWS Lambda função com um evento. ACTION_SUCCESSFUL
Os dígitos coletados aparecem no valor ReceivedDigits
do objeto ActionData
.
Por exemplo:
{
"SchemaVersion": "1.0",
"Sequence": 4,
"InvocationEventType": "ACTION_SUCCESSFUL",
"ActionData": {
"ReceivedDigits": "",
"Type": "ReceiveDigits",
"Parameters": {
"CallId": "call-id-1
",
"InputDigitsRegex": "^\d{2}#$
",
"InBetweenDigitsDurationInMilliseconds": 5000
,
"FlushDigitsDurationInMilliseconds": 10000
}
},
"CallDetails": {
"TransactionId": "transaction-id
",
"AwsAccountId": "aws-account-id
",
"AwsRegion": "us-east-1
",
"SipRuleId": "sip-rule-id
",
"SipApplicationId": "sip-application-id
",
"Participants": [
{
"CallId": "call-id-1
",
"ParticipantTag": "LEG-A",
"To": "+12065551212
",
"From": "+15105550101
",
"Direction": "Inbound",
"StartTimeInMilliseconds": "159700958834234
",
"Status": "Connected"
}
]
}
}
Quando o chamador insere dígitos que correspondem ao seu padrão de expressão regular, o aplicativo de mídia SIP invoca uma AWS Lambda função que retorna o seguinte tipo de carga útil:
{
"SchemaVersion": "1.0",
"Sequence": 5,
"InvocationEventType": "DIGITS_RECEIVED",
"ActionData": {
"ReceivedDigits": "11#
",
"Type": "ReceiveDigits",
"Parameters": {
"CallId": "call-id-1
",
"InputDigitsRegex": "^\d{2}#$
",
"InBetweenDigitsDurationInMilliseconds": 5000
,
"FlushDigitsDurationInMilliseconds": 10000
}
},
"CallDetails": {
"TransactionId": "transaction-id
",
"AwsAccountId": "aws-account-id
",
"AwsRegion": "us-east-1
",
"SipRuleId": "sip-rule-id
",
"SipApplicationId": "sip-application-id
",
"Participants": [
{
"CallId": "call-id-1
",
"ParticipantTag": "LEG-A",
"To": "+12065551212
",
"From": "+15105550101
",
"Direction": "Inbound",
"StartTimeInMilliseconds": "159700958834234
",
"Status": "Connected"
}
]
}
}
Veja um exemplo prático em GitHub: https://github.com/aws-samples/amazon-chime-sma-on-demand-recording