Skip to content

create_sip_media_application_call

create_sip_media_application_call(
    from_phone_number: E164PhoneNumber,
    to_phone_number: E164PhoneNumber,
    sip_media_application_id: NonEmptyString,
    *,
    config_overrides: Optional[ChimeSDKVoiceClientConfig] = None,
    sip_headers: Optional[SipHeadersMap] = None,
    arguments_map: Optional[SMACreateCallArgumentsMap] = None,
) -> CreateSipMediaApplicationCallResponse

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.

Parameters:

  • from_phone_number (E164PhoneNumber) –

    The phone number that a user calls from. This is a phone number in your Amazon Chime SDK phone number inventory.

  • to_phone_number (E164PhoneNumber) –

    The phone number that the service should call.

  • sip_media_application_id (NonEmptyString) –

    The ID of the SIP media application.

  • sip_headers (Optional[SipHeadersMap], default: None ) –

    The SIP headers added to an outbound call leg.

  • arguments_map (Optional[SMACreateCallArgumentsMap], default: None ) –

    Context passed to a CreateSipMediaApplication API call. For example, you could pass key-value pairs such as: "FirstName": "John", "LastName": "Doe"

Raises:

Source code in docs_src/capo_chime_sdk_voice/_services/chime_sdk_voice.py
def create_sip_media_application_call(
    self,
    from_phone_number: "capo_chime_sdk_voice.types.e164_phone_number.E164PhoneNumber",
    to_phone_number: "capo_chime_sdk_voice.types.e164_phone_number.E164PhoneNumber",
    sip_media_application_id: "capo_chime_sdk_voice.types.non_empty_string.NonEmptyString",
    *,
    config_overrides: Optional[ChimeSDKVoiceClientConfig] = None,
    sip_headers: Optional[
        "capo_chime_sdk_voice.types.sip_headers_map.SipHeadersMap"
    ] = None,
    arguments_map: Optional[
        "capo_chime_sdk_voice.types.sma_create_call_arguments_map.SMACreateCallArgumentsMap"
    ] = None,
) -> "capo_chime_sdk_voice.types.create_sip_media_application_call_response.CreateSipMediaApplicationCallResponse":
    """<p>Creates an outbound call to a phone number from the phone number specified in the request, and it invokes the endpoint of the specified <code>sipMediaApplicationId</code>.</p>

    Args:
        from_phone_number: <p>The phone number that a user calls from. This is a phone number in your Amazon Chime SDK phone number inventory.</p>
        to_phone_number: <p>The phone number that the service should call.</p>
        sip_media_application_id: <p>The ID of the SIP media application.</p>
        sip_headers: <p>The SIP headers added to an outbound call leg.</p>
        arguments_map: <p>Context passed to a CreateSipMediaApplication API call. For example, you could pass key-value pairs such as: <code>"FirstName": "John", "LastName": "Doe"</code> </p>

    Raises:
        capo_chime_sdk_voice.errors.access_denied_exception.AccessDeniedException: <p>You don't have the permissions needed to run this action.</p>
        capo_chime_sdk_voice.errors.bad_request_exception.BadRequestException: <p>The input parameters don't match the service's restrictions.</p>
        capo_chime_sdk_voice.errors.forbidden_exception.ForbiddenException: <p>The client is permanently forbidden from making the request.</p>
        capo_chime_sdk_voice.errors.resource_limit_exceeded_exception.ResourceLimitExceededException: <p>The request exceeds the resource limit.</p>
        capo_chime_sdk_voice.errors.service_failure_exception.ServiceFailureException: <p>The service encountered an unexpected error.</p>
        capo_chime_sdk_voice.errors.service_unavailable_exception.ServiceUnavailableException: <p>The service is currently unavailable.</p>
        capo_chime_sdk_voice.errors.throttled_client_exception.ThrottledClientException: <p>The number of customer requests exceeds the request rate limit.</p>
        capo_chime_sdk_voice.errors.unauthorized_client_exception.UnauthorizedClientException: <p>The client isn't authorized to request a resource.</p>
        capo_chime_sdk_voice.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_chime_sdk_voice.types.create_sip_media_application_call_request.CreateSipMediaApplicationCallRequest]",
    ) -> OperationResponse[
        "capo_chime_sdk_voice.types.create_sip_media_application_call_response.CreateSipMediaApplicationCallResponse"
    ]:
        import capo_chime_sdk_voice._operations.chime_sdk_telephony_service.create_sip_media_application_call

        output, http_response = (
            capo_chime_sdk_voice._operations.chime_sdk_telephony_service.create_sip_media_application_call.create_sip_media_application_call(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_chime_sdk_voice.types.create_sip_media_application_call_request.CreateSipMediaApplicationCallRequest",
    ) -> dict[str, Any]:
        import capo_chime_sdk_voice.types.create_sip_media_application_call_request

        return capo_chime_sdk_voice.types.create_sip_media_application_call_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "CreateSipMediaApplicationCall", redact_input=_redact_input
        ),
    )
    input_: capo_chime_sdk_voice.types.create_sip_media_application_call_request.CreateSipMediaApplicationCallRequest = {
        "from_phone_number": from_phone_number,
        "to_phone_number": to_phone_number,
        "sip_media_application_id": sip_media_application_id,
    }
    if sip_headers is not None:
        input_["sip_headers"] = sip_headers
    if arguments_map is not None:
        input_["arguments_map"] = arguments_map

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output