Skip to content

create_proxy_session

create_proxy_session(
    voice_connector_id: VoiceConnectorId,
    participant_phone_numbers: ParticipantPhoneNumberList,
    capabilities: CapabilityList,
    *,
    config_overrides: Optional[ChimeSDKVoiceClientConfig] = None,
    name: Optional[ProxySessionNameString] = None,
    expiry_minutes: Optional[PositiveInteger] = None,
    number_selection_behavior: Optional[NumberSelectionBehavior] = None,
    geo_match_level: Optional[GeoMatchLevel] = None,
    geo_match_params: Optional[GeoMatchParams] = None,
) -> CreateProxySessionResponse

Creates a proxy session for the specified Amazon Chime SDK Voice Connector for the specified participant phone numbers.

End of support notice: On April 7, 2026, AWS will end support for Amazon Chime SDK proxy sessions.

Parameters:

  • voice_connector_id (VoiceConnectorId) –

    The Voice Connector ID.

  • participant_phone_numbers (ParticipantPhoneNumberList) –

    The participant phone numbers.

  • name (Optional[ProxySessionNameString], default: None ) –

    The name of the proxy session.

  • expiry_minutes (Optional[PositiveInteger], default: None ) –

    The number of minutes allowed for the proxy session.

  • capabilities (CapabilityList) –

    The proxy session's capabilities.

  • number_selection_behavior (Optional[NumberSelectionBehavior], default: None ) –

    The preference for proxy phone number reuse, or stickiness, between the same participants across sessions.

  • geo_match_level (Optional[GeoMatchLevel], default: None ) –

    The preference for matching the country or area code of the proxy phone number with that of the first participant.

  • geo_match_params (Optional[GeoMatchParams], default: None ) –

    The country and area code for the proxy phone number.

Raises:

Source code in docs_src/capo_chime_sdk_voice/_services/chime_sdk_voice.py
def create_proxy_session(
    self,
    voice_connector_id: "capo_chime_sdk_voice.types.voice_connector_id.VoiceConnectorId",
    participant_phone_numbers: "capo_chime_sdk_voice.types.participant_phone_number_list.ParticipantPhoneNumberList",
    capabilities: "capo_chime_sdk_voice.types.capability_list.CapabilityList",
    *,
    config_overrides: Optional[ChimeSDKVoiceClientConfig] = None,
    name: Optional[
        "capo_chime_sdk_voice.types.proxy_session_name_string.ProxySessionNameString"
    ] = None,
    expiry_minutes: Optional[
        "capo_chime_sdk_voice.types.positive_integer.PositiveInteger"
    ] = None,
    number_selection_behavior: Optional[
        "capo_chime_sdk_voice.types.number_selection_behavior.NumberSelectionBehavior"
    ] = None,
    geo_match_level: Optional[
        "capo_chime_sdk_voice.types.geo_match_level.GeoMatchLevel"
    ] = None,
    geo_match_params: Optional[
        "capo_chime_sdk_voice.types.geo_match_params.GeoMatchParams"
    ] = None,
) -> "capo_chime_sdk_voice.types.create_proxy_session_response.CreateProxySessionResponse":
    """<p>Creates a proxy session for the specified Amazon Chime SDK Voice Connector for the specified participant phone numbers.</p> <important> <p>End of support notice: On April 7, 2026, AWS will end support for Amazon Chime SDK proxy sessions.</p> </important>

    Args:
        voice_connector_id: <p>The Voice Connector ID.</p>
        participant_phone_numbers: <p>The participant phone numbers.</p>
        name: <p>The name of the proxy session.</p>
        expiry_minutes: <p>The number of minutes allowed for the proxy session.</p>
        capabilities: <p>The proxy session's capabilities.</p>
        number_selection_behavior: <p>The preference for proxy phone number reuse, or stickiness, between the same participants across sessions.</p>
        geo_match_level: <p>The preference for matching the country or area code of the proxy phone number with that of the first participant.</p>
        geo_match_params: <p>The country and area code for the proxy phone number.</p>

    Raises:
        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.not_found_exception.NotFoundException: <p>The requested resource couldn't be found.</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_proxy_session_request.CreateProxySessionRequest]",
    ) -> OperationResponse[
        "capo_chime_sdk_voice.types.create_proxy_session_response.CreateProxySessionResponse"
    ]:
        import capo_chime_sdk_voice._operations.chime_sdk_telephony_service.create_proxy_session

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

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

        return capo_chime_sdk_voice.types.create_proxy_session_request.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_chime_sdk_voice.types.create_proxy_session_response.CreateProxySessionResponse",
    ) -> dict[str, Any]:
        import capo_chime_sdk_voice.types.create_proxy_session_response

        return capo_chime_sdk_voice.types.create_proxy_session_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "CreateProxySession",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_chime_sdk_voice.types.create_proxy_session_request.CreateProxySessionRequest = {
        "voice_connector_id": voice_connector_id,
        "participant_phone_numbers": participant_phone_numbers,
        "capabilities": capabilities,
    }
    if name is not None:
        input_["name"] = name
    if expiry_minutes is not None:
        input_["expiry_minutes"] = expiry_minutes
    if number_selection_behavior is not None:
        input_["number_selection_behavior"] = number_selection_behavior
    if geo_match_level is not None:
        input_["geo_match_level"] = geo_match_level
    if geo_match_params is not None:
        input_["geo_match_params"] = geo_match_params

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