Understanding call flow for Amazon Chime SDK PSTN audio - Amazon Chime SDK

Understanding call flow for Amazon Chime SDK PSTN audio

This diagram shows the flow of a call through the Amazon Chime SDK PSTN audio service and a customer’s AWS Lambda function. In this example, the application plays a prompt to the caller, gathers dual-tone multi frequency (DTMF) digits, and then connects them to an Amazon Chime SDK meeting.

Numbers in the diagram correspond to the numbered explanations below the diagram.

Diagram of basic call flow through the PSTN audio service and AWS Lambda functions.

In the diagram:

  1. The Amazon Chime SDK PSTN audio service receives a call to a phone number that is provisioned in a SIP rule.

  2. The PSTN audio service fetches the associated SIP media application and invokes the associated AWS Lambda function with a NEW_INBOUND_CALL event (LEG-A).

  3. The AWS Lambda function returns a list of actions, including PlayAudioAndGetDigits, which instructs the PSTN audio service to answer the call, play an audio file to the caller, and collect the DTMF digits entered by the caller.

  4. The PSTN audio service answers the call, plays an audio prompt, and collects DTMF digits input by the caller.

  5. The PSTN audio service invokes the AWS Lambda function with the DTMF digits input. The AWS Lambda function uses the AWS SDK to create an Amazon Chime SDK meeting and a meeting attendee.

  6. Once the AWS SDK returns a MeetingId and AttendeeId, the AWS Lambda function returns an action to join the call to the Amazon Chime SDK Meeting (LEG-B).

  7. A Real-time Transport Protocol (RTP) session is established between the caller from the public switched telephone network (PSTN) and the Amazon Chime SDK Media service.

  8. When the PSTN caller hangs up, the PSTN audio service invokes the AWS Lambda function with a HANGUP event, and the AWS Lambda function deletes the attendee.