wxc_sdk.telephony.prem_pstn.dial_plan module

class wxc_sdk.telephony.prem_pstn.dial_plan.DialPlan(*, id: str | None = None, name: str | None = None, routeId: str, routeName: str | None = None, routeType: RouteType, customer: Customer | None = None)[source]

Bases: ApiModel

dial_plan_id: str | None

Unique identifier for the dial plan.

name: str | None

A unique name for the dial plan.

route_id: str

ID of route type associated with the dial plan.

route_name: str | None

Name of route type associated with the dial plan.

route_type: RouteType

Route Type associated with the dial plan.

customer: Customer | None

Customer information.

class wxc_sdk.telephony.prem_pstn.dial_plan.CreateResponse(*, id: str, dialPatternErrors: list[DialPatternValidate])[source]

Bases: ApiModel

dial_plan_id: str
dial_pattern_errors: list[DialPatternValidate]
property ok: bool
class wxc_sdk.telephony.prem_pstn.dial_plan.PatternAndAction(*, dialPattern: str, action: PatternAction)[source]

Bases: ApiModel

dial_pattern: str

A unique dial pattern

action: PatternAction

action to add or delete a pattern

static add(pattern: str) PatternAndAction[source]
static delete(pattern: str) PatternAndAction[source]
class wxc_sdk.telephony.prem_pstn.dial_plan.DialPlanApi(*, session: wxc_sdk.rest.RestSession, base: str = None)[source]

Bases: ApiChild

list(dial_plan_name: str | None = None, route_group_name: str | None = None, trunk_name: str | None = None, order: str | None = None, org_id: str | None = None, **params) Generator[DialPlan, None, None][source]

List all Dial Plans for the organization.

Dial plans route calls to on-premises destinations by use of the trunks or route groups with which the dial plan is associated. Multiple dial patterns can be defined as part of your dial plan. Dial plans are configured globally for an enterprise and apply to all users, regardless of location.

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

Parameters:
  • dial_plan_name (str) – Return the list of dial plans matching the dial plan name.

  • route_group_name (str) – Return the list of dial plans matching the route group name.

  • trunk_name (str) – Return the list of dial plans matching the trunk name.

  • order (str) – Order the dial plans according to the designated fields. Available sort fields: name, routeName, routeType. Sort order is ascending by default

  • org_id (str) – List dial plans for this organization.

Returns:

create(name: str, route_id: str, route_type: RouteType, dial_patterns: List[str] | None = None, org_id: str | None = None) CreateResponse[source]

Create a Dial Plan for the organization.

Dial plans route calls to on-premises destinations by use of trunks or route groups. They are configured globally for an enterprise and apply to all users, regardless of location. A dial plan also specifies the routing choice (trunk or route group) for calls that match any of its dial patterns. Specific dial patterns can be defined as part of your dial plan.

Creating a dial plan requires a full administrator auth token with a scope of spark-admin:telephony_config_write.

Parameters:
  • name (str) – A unique name for the dial plan.

  • route_id (str) – ID of route type associated with the dial plan.

  • route_type (wxc_sdk.common.RouteType) – Route Type associated with the dial plan.

  • dial_patterns (list[str]) – An Array of dial patterns

  • org_id (str) – Organization to which dial plan belongs.

Returns:

result of dial plan creation

Return type:

CreateResponse

details(dial_plan_id: str, org_id: str | None = None) DialPlan[source]

Get a Dial Plan for the organization.

Dial plans route calls to on-premises destinations by use of trunks or route groups. They are configured globally for an enterprise and apply to all users, regardless of location. A dial plan also specifies the routing choice (trunk or route group) for calls that match any of its dial patterns. Specific dial patterns can be defined as part of your dial plan.

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

Parameters:
  • dial_plan_id (str) – ID of the dial plan.

  • org_id (str) – Organization to which dial plan belongs.

Returns:

dial plan details

Return type:

DialPlan

update(update: DialPlan, org_id: str | None = None)[source]

Modify a Dial Plan for the organization.

Dial plans route calls to on-premises destinations by use of trunks or route groups. They are configured globally for an enterprise and apply to all users, regardless of location. A dial plan also specifies the routing choice (trunk or route group) for calls that match any of its dial patterns. Specific dial patterns can be defined as part of your dial plan.

Modifying a dial plan requires a full administrator auth token with a scope of spark-admin:telephony_config_write.

Parameters:
  • update – DialPlan objects with updated settings. Only name, route_id and route_type are considered. All three need to be set

  • org_id (str) – Organization to which dial plan belongs.

delete_dial_plan(dial_plan_id: str, org_id: str | None = None)[source]

Delete a Dial Plan for the organization.

Dial plans route calls to on-premises destinations by use of trunks or route groups. They are configured globally for an enterprise and apply to all users, regardless of location. A dial plan also specifies the routing choice (trunk or route group) for calls that match any of its dial patterns. Specific dial patterns can be defined as part of your dial plan.

Deleting a dial plan requires a full administrator auth token with a scope of spark-admin:telephony_config_write.

Parameters:
  • dial_plan_id (str) – ID of the dial plan.

  • org_id (str) – Organization to which dial plan belongs.

patterns(dial_plan_id: str, org_id: str | None = None, dial_pattern: str | None = None, **params) Generator[str, None, None][source]

List all Dial Patterns for the organization.

Dial plans route calls to on-premises destinations by use of trunks or route groups. They are configured globally for an enterprise and apply to all users, regardless of location. A dial plan also specifies the routing choice (trunk or route group) for calls that match any of its dial patterns. Specific dial patterns can be defined as part of your dial plan.

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

Parameters:
  • dial_plan_id (str) – ID of the dial plan.

  • org_id (str) – List dial patterns associated with a dial plan.

  • dial_pattern – An enterprise dial pattern is represented by a sequence of digits (1-9), followed by optional wildcard characters. Valid wildcard characters are ! (matches any sequence of digits) and X (matches a single digit, 0-9). The ! wildcard can only occur once at the end and only in an E.164 pattern

Returns:

list of patterns

Return type:

list[str]

modify_patterns(dial_plan_id: str, dial_patterns: List[PatternAndAction], org_id: str | None = None)[source]

Modify dial patterns for the Dial Plan.

Dial plans route calls to on-premises destinations by use of trunks or route groups. They are configured globally for an enterprise and apply to all users, regardless of location. A dial plan also specifies the routing choice (trunk or route group) for calls that match any of its dial patterns. Specific dial patterns can be defined as part of your dial plan.

Modifying a dial pattern requires a full administrator auth token with a scope of spark-admin:telephony_config_write.

Parameters:
  • dial_plan_id (str) – ID of the dial plan being modified.

  • dial_patterns (PatternAndAction) – Array of dial patterns to add or delete. Dial Pattern that is not present in the request is not modified.

  • org_id (str) – Organization to which dial plan belongs.

delete_all_patterns(dial_plan_id: str, org_id: str | None = None)[source]

Delete all dial patterns from the Dial Plan.

Dial plans route calls to on-premises destinations by use of trunks or route groups. They are configured globally for an enterprise and apply to all users, regardless of location. A dial plan also specifies the routing choice (trunk or route group) for calls that match any of its dial patterns. Specific dial patterns can be defined as part of your dial plan.

Deleting dial pattern requires a full administrator auth token with a scope of spark-admin:telephony_config_write.

Parameters:
  • dial_plan_id (str) – ID of the dial plan being modified.

  • org_id (str) – Organization to which dial plan belongs.

base = 'telephony/config/premisePstn/dialPlans'