wxc_sdk.telephony.location package

class wxc_sdk.telephony.location.CallingLineId(*, name: str | None = None, phoneNumber: str | None = None)[source]

Bases: ApiModel

Location calling line information.

name: str | None

Group calling line ID name. By default it will be org name. when updating the name make sure to also include the phone number

phone_number: str | None

Directory Number / Main number in E164 Forma

class wxc_sdk.telephony.location.PSTNConnection(*, type: RouteType, id: str)[source]

Bases: ApiModel

Connection details

type: RouteType

Webex Calling location only supports TRUNK and ROUTE_GROUP connection type.

id: str

A unique identifier of route type.

class wxc_sdk.telephony.location.TelephonyLocation(*, id: str | None = None, name: str | None = None, announcementLanguage: str | None = None, callingLineId: CallingLineId | None = None, connection: PSTNConnection | None = None, externalCallerIdName: str | None = None, userLimit: int | None = None, pAccessNetworkInfo: str | None = None, outsideDialDigit: str | None = None, routingPrefix: str | None = None, chargeNumber: str | None = None, defaultDomain: str | None = None, e911SetupRequired: bool | None = None, enforceOutsideDialDigit: bool | None = None, subscriptionId: str | None = None)[source]

Bases: ApiModel

location_id: str | None

A unique identifier for the location.

name: str | None

The name of the location.

announcement_language: str | None

Location’s phone announcement language.

calling_line_id: CallingLineId | None

Location calling line information.

connection: PSTNConnection | None

Connection details are only returned for local PSTN types of TRUNK or ROUTE_GROUP.

external_caller_id_name: str | None

External Caller ID Name value. Unicode characters.

user_limit: int | None

Limit on the number of people at the location, Read-Only.

p_access_network_info: str | None

Location Identifier.

outside_dial_digit: str | None

Must dial to reach an outside line, default is None.

routing_prefix: str | None

Must dial a prefix when calling between locations having same extension within same location.

charge_number: str | None

Chargeable number for the line placing the call. When this is set, all calls placed from this location will include a P-Charge-Info header with the selected number in the SIP INVITE.

default_domain: str | None

IP Address, hostname, or domain, Read-Only

e911_setup_required: bool | None

True if E911 setup is required.

enforce_outside_dial_digit: bool | None

True when enforcing outside dial digit at location level to make PSTN calls.

subscription_id: str | None
class wxc_sdk.telephony.location.TelephonyLocationApi(session: wxc_sdk.rest.RestSession)[source]

Bases: ApiChild

intercept: LocationInterceptApi

call intercept settings

internal_dialing: InternalDialingApi

internal dialing settings

moh: LocationMoHApi

moh settings

number: LocationNumbersApi

number settings

voicemail: LocationVoicemailSettingsApi

Location VM settings (only enable/disable transcription for now)

receptionist_contacts_directory: ReceptionistContactsDirectoryApi

Receptionist contacts directories

generate_password(location_id: str, generate: list[str] | None = None, org_id: str | None = None)[source]

Generates an example password using the effective password settings for the location. If you don’t specify anything in the generate field or don’t provide a request body, then you will receive a SIP password by default.

It’s used while creating a trunk and shouldn’t be used anywhere else.

Generating an example password requires a full or write-only administrator auth token with a scope of spark-admin:telephony_config_write.

Parameters:
  • location_id (str) – Location for which example password has to be generated.

  • generate (list[str]) – password settings array.

  • org_id (str) – Organization to which location belongs.

Returns:

new password

Return type:

str

validate_extensions(location_id: str, extensions: list[str], org_id: str | None = None) ValidateExtensionsResponse[source]

Validate extensions for a specific location.

Validating extensions requires a full administrator auth token with a scope of spark-admin:telephony_config_write.

Parameters:
  • location_id (str) – Validate extensions for this location.

  • extensions (list[str]) – Array of extensions that will be validated.

  • org_id (str) – Validate extensions for this organization.

Returns:

Validation result

Return type:

wxc_sdk.common.ValidateExtensionsResponse

base = 'telephony/config/locations'
details(location_id: str, org_id: str | None = None) TelephonyLocation[source]

Shows Webex Calling details for a location, by ID.

Specify the location ID in the locationId parameter in the URI.

Searching and viewing location in your organization requires an administrator auth token with the spark-admin:telephony_config_read scope.

Parameters:
  • location_id (str) – Retrieve Webex Calling location attributes for this location.

  • org_id (str) – Retrieve Webex Calling location attributes for this organization.

Returns:

Webex Calling details for location

Return type:

TelephonyLocation

enable_for_calling(location: Location, org_id: str | None = None) str[source]

Enable a location by adding it to Webex Calling. This add Webex Calling support to a location created using the POST /v1/locations API.

Locations are used to support calling features which can be defined at the location level.

This API requires a full administrator auth token with a scope of spark-admin:telephony_config_write. :return: A unique identifier for the location. :rtype: str

list(name: str | None = None, order: str | None = None, org_id: str | None = None) Generator[TelephonyLocation, None, None][source]

Lists Webex Calling locations for an organization with Webex Calling details.

Searching and viewing locations with Webex Calling details in your organization require an administrator auth token with the spark-admin:telephony_config_read scope. :param name: List locations whose name contains this string. :type name: str :param order: Sort the list of locations based on name, either asc or desc. :type order: str :param org_id: List locations for this organization. :type org_id: str :return: generator of TelephonyLocation instances

update(location_id: str, settings: TelephonyLocation, org_id: str | None = None)[source]

Update Webex Calling details for a location, by ID.

Specify the location ID in the locationId parameter in the URI.

Modifying the connection via API is only supported for the local PSTN types of TRUNK and ROUTE_GROUP.

Updating a location in your organization requires an administrator auth token with the spark-admin:telephony_config_write scope.

Example :

api.telephony.location.update(location_id=location_id,
                              settings=TelephonyLocation(
                                  calling_line_id=CallingLineId(
                                      phone_number=tn),
                                  routing_prefix=routing_prefix,
                                  outside_dial_digit='9'))
Parameters:
  • location_id (str) – Updating Webex Calling location attributes for this location.

  • settings (TelephonyLocation) – settings to update

  • org_id (str) – Updating Webex Calling location attributes for this organization.

Returns:

change_announcement_language(location_id: str, language_code: str, agent_enabled: bool | None = None, service_enabled: bool | None = None, org_id: str | None = None)[source]

Change Announcement Language

Change announcement language for the given location.

Change announcement language for current people/workspaces and/or existing feature configurations. This does not change the default announcement language which is applied to new users/workspaces and new feature configurations.

Changing announcement language for the given location requires a full administrator auth token with a scope of spark-admin:telephony_config_write.

Parameters:
  • location_id (str) – Change announcement language for this location.

  • language_code (str) – Language code.

  • agent_enabled (bool) – Set to true to change announcement language for existing people and workspaces.

  • service_enabled (bool) – Set to true to change announcement language for existing feature configurations.

  • org_id (str) – Change announcement language for this organization.

device_settings(location_id: str, org_id: str | None = None) DeviceCustomization[source]

Get device override settings for a location.

This requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.

Parameters:
  • location_id (str) – Unique identifier for the location

  • org_id (str) – Settings on the device in this organization

Returns:

device customization response

Return type:

DeviceCustomization

Submodules