createSipMediaApplicationCall method

Future<CreateSipMediaApplicationCallResponse> createSipMediaApplicationCall({
  1. required String sipMediaApplicationId,
  2. String? fromPhoneNumber,
  3. String? toPhoneNumber,
})

Creates an outbound call to a phone number from the phone number specified in the request, and it invokes the endpoint of the specified sipMediaApplicationId.

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

Parameter sipMediaApplicationId : The ID of the SIP media application.

Parameter fromPhoneNumber : The phone number that a user calls from.

Parameter toPhoneNumber : The phone number that the user dials in order to connect to a meeting

Implementation

Future<CreateSipMediaApplicationCallResponse> createSipMediaApplicationCall({
  required String sipMediaApplicationId,
  String? fromPhoneNumber,
  String? toPhoneNumber,
}) async {
  ArgumentError.checkNotNull(sipMediaApplicationId, 'sipMediaApplicationId');
  final $payload = <String, dynamic>{
    if (fromPhoneNumber != null) 'FromPhoneNumber': fromPhoneNumber,
    if (toPhoneNumber != null) 'ToPhoneNumber': toPhoneNumber,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/sip-media-applications/${Uri.encodeComponent(sipMediaApplicationId)}/calls',
    exceptionFnMap: _exceptionFns,
  );
  return CreateSipMediaApplicationCallResponse.fromJson(response);
}