createMeetingDialOut method

Future<CreateMeetingDialOutResponse> createMeetingDialOut({
  1. required String fromPhoneNumber,
  2. required String joinToken,
  3. required String meetingId,
  4. required String toPhoneNumber,
})

Uses the join token and call metadata in a meeting request (From number, To number, and so forth) to initiate an outbound call to a public switched telephone network (PSTN) and joins them into Chime meeting. Also ensures that the From number belongs to the customer.

To play welcome audio or implement an interactive voice response (IVR), use the CreateSipMediaApplicationCall API with the corresponding SIP media application ID.

May throw BadRequestException. May throw ForbiddenException. May throw ResourceLimitExceededException. May throw ThrottledClientException. May throw UnauthorizedClientException. May throw ServiceUnavailableException. May throw ServiceFailureException.

Parameter fromPhoneNumber : Phone number used as the caller ID when the remote party receives a call.

Parameter joinToken : Token used by the Amazon Chime SDK attendee. Call the CreateAttendee API to get a join token.

Parameter meetingId : The Amazon Chime SDK meeting ID.

Type: String

Pattern: a-fA-F0-9{8}(?:-a-fA-F0-9{4}){3}-a-fA-F0-9{12}

Required: No

Parameter toPhoneNumber : Phone number called when inviting someone to a meeting.

Implementation

Future<CreateMeetingDialOutResponse> createMeetingDialOut({
  required String fromPhoneNumber,
  required String joinToken,
  required String meetingId,
  required String toPhoneNumber,
}) async {
  ArgumentError.checkNotNull(fromPhoneNumber, 'fromPhoneNumber');
  ArgumentError.checkNotNull(joinToken, 'joinToken');
  _s.validateStringLength(
    'joinToken',
    joinToken,
    2,
    2048,
    isRequired: true,
  );
  ArgumentError.checkNotNull(meetingId, 'meetingId');
  ArgumentError.checkNotNull(toPhoneNumber, 'toPhoneNumber');
  final $payload = <String, dynamic>{
    'FromPhoneNumber': fromPhoneNumber,
    'JoinToken': joinToken,
    'ToPhoneNumber': toPhoneNumber,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/meetings/${Uri.encodeComponent(meetingId)}/dial-outs',
    exceptionFnMap: _exceptionFns,
  );
  return CreateMeetingDialOutResponse.fromJson(response);
}