azure.communication.phonenumbers.siprouting package¶
-
class
azure.communication.phonenumbers.siprouting.
SipRoutingClient
(endpoint: str, credential: TokenCredential, **kwargs: Any)[source]¶ A client to interact with the AzureCommunicationService SIP routing gateway. This client provides operations to retrieve and manage SIP routing configuration.
- Parameters
endpoint (str) – The endpoint url for Azure Communication Service resource.
credential (TokenCredential) – 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.
-
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
-
get_trunk
(trunk_fqdn: str, **kwargs: Any) → Optional[SipTrunk][source]¶ Retrieve a single SIP trunk.
-
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
-
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
-
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
- Raises
~azure.core.exceptions.HttpResponseError, ValueError
-
class
azure.communication.phonenumbers.siprouting.
SipTrunk
(**kwargs)[source]¶ Represents a SIP trunk for routing calls. See RFC 4904.
-
class
azure.communication.phonenumbers.siprouting.
SipTrunkRoute
(*, name: str, number_pattern: str, description: Optional[str] = None, trunks: Optional[List[str]] = None, **kwargs)[source]¶ Represents a trunk route for routing calls.
All required parameters must be populated in order to send to Azure.
- Variables
description (str) – Gets or sets description of the route.
name (str) – Required. Gets or sets name of the route.
number_pattern (str) – Required. Gets or sets regex number pattern for routing calls. .NET regex format is supported. The regex should match only digits with an optional ‘+’ prefix without spaces. I.e. “^+[1-9][0-9]{3,23}$”.
trunks (list[str]) – Gets or sets list of SIP trunks for routing calls. Trunks are represented as FQDN.
- Keyword Arguments
description (str) – Gets or sets description of the route.
name (str) – Required. Gets or sets name of the route.
number_pattern (str) – Required. Gets or sets regex number pattern for routing calls. .NET regex format is supported. The regex should match only digits with an optional ‘+’ prefix without spaces. I.e. “^+[1-9][0-9]{3,23}$”.
trunks (list[str]) – Gets or sets list of SIP trunks for routing calls. Trunks are represented as FQDN.
-
as_dict
(keep_readonly=True, key_transformer=<function attribute_transformer>, **kwargs)¶ Return a dict that can be JSONify using json.dump.
Advanced usage might optionally use a callback as parameter:
Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains ‘type’ with the msrest type and ‘key’ with the RestAPI encoded key. Value is the current value in this object.
The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.
See the three examples in this file:
attribute_transformer
full_restapi_key_transformer
last_restapi_key_transformer
If you want XML serialization, you can pass the kwargs is_xml=True.
- Parameters
key_transformer (function) – A key transformer function.
- Returns
A dict JSON compatible object
- Return type
-
classmethod
deserialize
(data, content_type=None)¶ Parse a str using the RestAPI syntax and return a model.
-
classmethod
enable_additional_properties_sending
()¶
-
classmethod
from_dict
(data, key_extractors=None, content_type=None)¶ Parse a dict using given key extractor return a model.
By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)
-
classmethod
is_xml_model
()¶
-
serialize
(keep_readonly=False, **kwargs)¶ Return the JSON that would be sent to azure from this model.
This is an alias to as_dict(full_restapi_key_transformer, keep_readonly=False).
If you want XML serialization, you can pass the kwargs is_xml=True.