ReceiveDigits - Amazon Chime SDK

ReceiveDigits

When a user enters digits that match the regular expression pattern specified in this action, the SIP media application invokes the AWS Lambda function.

{ "Type": "ReceiveDigits", "Parameters": { "CallId": "call-id-1", "ParticipantTag": "LEG-A", "InputDigitsRegex": "^\d{2}#$", "InBetweenDigitsDurationInMilliseconds": 1000, "FlushDigitsDurationInMilliseconds": 10000 } }
CallId

DescriptionCallId of participant in the CallDetails of the AWS Lambda function invocation

Allowed values – A valid call ID

Required – No

Default value – None

ParticipantTag

DescriptionParticipantTag of one of the connected participants in the CallDetails

Allowed valuesLEG-A or LEG-B

Required – No

Default valueParticipantTag of the invoked callLeg Ignored if you specify CallId

InputDigitsRegex

Description – A regular expression pattern

Allowed values – A valid regular expression pattern

Required – Yes

Default value – None

InBetweenDigitsDurationInMilliseconds

Description – Interval between digits before checking to see if the input matches the regular expression pattern

Allowed values – Duration in milliseconds

Required – Yes

Default value – None

FlushDigitsDurationInMilliseconds

Description – Interval after which received DTMF digits are flushed and sent to the AWS Lambda function. If the SIP media application receives a new digit after the interval ends, the timer starts again.

Allowed valuesInBetweenDigitsDurationInMilliseconds

Required – Yes

Default value – None

The SIP media application discards DTMF digits for the duration of a call until it receives a new ReceiveDigits action. The FlushDigitsDurationInMilliseconds interval starts when the SIP media application receives the first DTMF digit. If the user enters the correct digits before the interval expires, the SIP media application invokes the AWS Lambda function described in Receiving caller input.

If the user input doesn't match the regular expression pattern, the SIP media application repeats the "failure" audio file message until the application exhausts the repeat count or the user inputs valid digits.

See working examples on GitHub: