azure.communication.phonenumbers.siprouting.aio package

class azure.communication.phonenumbers.siprouting.aio.SipRoutingClient(endpoint: str, credential: AsyncTokenCredential, **kwargs: Any)[source]

A client to interact with the SIP routing gateway asynchronously. This client provides operations to retrieve and update SIP routing configuration.

Parameters
  • endpoint (str) – The endpoint url for Azure Communication Service resource.

  • credential (AsyncTokenCredential) – The credentials with which to authenticate.

Keyword Arguments

api_version (str) – Api Version. Default value is “2021-05-01-preview”. Note that overriding this default value may result in unsupported behavior.

async close()None[source]
async delete_trunk(trunk_fqdn: str, **kwargs: Any)None[source]

Deletes SIP trunk.

Parameters

trunk_fqdn (str) – FQDN of the trunk to be deleted.

Returns

None

Return type

None

Raises

~azure.core.exceptions.HttpResponseError, ValueError

classmethod from_connection_string(conn_str: str, **kwargs: Any)SipRoutingClient[source]

Factory method for creating client from connection string.

Parameters

conn_str (str) – Connection string containing endpoint and credentials

Returns

The newly created client.

Return type

SipRoutingClient

async get_trunk(trunk_fqdn: str, **kwargs: Any)Optional[SipTrunk][source]

Retrieve a single SIP trunk.

Parameters

trunk_fqdn (str) – FQDN of the desired SIP trunk.

Returns

SIP trunk with specified trunk_fqdn. If it doesn’t exist, returns None.

Return type

SipTrunk or None

Raises

~azure.core.exceptions.HttpResponseError, ValueError, LookupError

async list_routes(**kwargs: Any)Iterable[SipTrunkRoute][source]

Retrieves an iterable of currently configured SIP routes.

Returns

Current SIP routes configuration.

Return type

Iterable[SipTrunkRoute]

Raises

~azure.core.exceptions.HttpResponseError

async list_trunks(**kwargs: Any)Iterable[SipTrunk][source]

Retrieves an iterable of currently configured SIP trunks.

Returns

Current SIP trunks configuration.

Return type

Iterable[SipTrunk]

Raises

~azure.core.exceptions.HttpResponseError

async set_routes(routes: List[SipTrunkRoute], **kwargs: Any)None[source]

Overwrites the list of SIP routes.

Parameters

routes (List[SipTrunkRoute]) – New list of routes to be set.

Returns

None

Return type

None

Raises

~azure.core.exceptions.HttpResponseError, ValueError

async set_trunk(trunk: SipTrunk, **kwargs: Any)None[source]

Modifies SIP trunk with the given FQDN. If it doesn’t exist, adds a new trunk.

Parameters

trunk (SipTrunk) – Trunk object to be set.

Returns

None

Return type

None

Raises

~azure.core.exceptions.HttpResponseError, ValueError

async set_trunks(trunks: List[SipTrunk], **kwargs: Any)None[source]

Overwrites the list of SIP trunks.

Parameters

trunks (List[SipTrunk]) – New list of trunks to be set.

Returns

None

Return type

None

Raises

~azure.core.exceptions.HttpResponseError, ValueError