createSipMediaApplicationCall method
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 AccessDeniedException.
May throw BadRequestException.
May throw ForbiddenException.
May throw ResourceLimitExceededException.
May throw ServiceFailureException.
May throw ServiceUnavailableException.
May throw ThrottledClientException.
May throw UnauthorizedClientException.
Parameter fromPhoneNumber :
The phone number that a user calls from. This is a phone number in your
Amazon Chime SDK phone number inventory.
Parameter sipMediaApplicationId :
The ID of the SIP media application.
Parameter toPhoneNumber :
The phone number that the service should call.
Parameter argumentsMap :
Context passed to a CreateSipMediaApplication API call. For example, you
could pass key-value pairs such as: "FirstName": "John", "LastName":
"Doe"
Parameter sipHeaders :
The SIP headers added to an outbound call leg.
Implementation
Future<CreateSipMediaApplicationCallResponse> createSipMediaApplicationCall({
required String fromPhoneNumber,
required String sipMediaApplicationId,
required String toPhoneNumber,
Map<String, String>? argumentsMap,
Map<String, String>? sipHeaders,
}) async {
final $payload = <String, dynamic>{
'FromPhoneNumber': fromPhoneNumber,
'ToPhoneNumber': toPhoneNumber,
if (argumentsMap != null) 'ArgumentsMap': argumentsMap,
if (sipHeaders != null) 'SipHeaders': sipHeaders,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri:
'/sip-media-applications/${Uri.encodeComponent(sipMediaApplicationId)}/calls',
exceptionFnMap: _exceptionFns,
);
return CreateSipMediaApplicationCallResponse.fromJson(response);
}