The testDialplan() XML-RPC API method makes it possible to inspect how a call will be routed.

Only customers with System Management permission are allowed to issue testDialplan() xmlapi call

The application supports trusted mode and the i_customer parameter should be provided.


testDialplan()

Mandatory parameters

  • cli - Caller number. String

  • cld - Called number. String

Optional parameters

  • fallback_i_account - The i_account value to use when automatic account recognition is impossible. When DID or authentication rule has been matched the fallback_i_account parameter is ignored. Mandatory in certain scenarios. Integer

  • remote_udp_port - source UDP port of the caller. Mandatory in certain scenarios. Integer

  • remote_ip - source IP of the caller. Mandatory in certain scenarios. String

  • to_domain - the domain from the To: SIP header from the INVITE request. Optional. String. Available starting from Sippy 2020

  • from_domain - the domain from the From: SIP header from the INVITE request. Optional. String. Available starting from Sippy 2020.

  • is_ivr_originated - When it is true then neither authentication rules nor DIDs are tested and the fallback_i_account parameter becomes mandatory. Boolean, default is False
  • i_protocol - Integer, default is 1

    • 1 - SIP

    • 2 - H.323 (deprecated starting from Sippy 2020 version)

    • 3 - IAX2

  • nated - This parameter specifies if the call should be considered as being originated from behind NAT. It affects the i_media_relay return value. Available starting from version 5.2. Boolean, default is False
  • call_start_time - The time of making the call. Either dateTime.iso8601 format in UTC or String in format '%H:%M:%S.000 GMT %a %b %d %Y' (e.g. 09:57:29.000 GMT Mon May 29 2017). Available starting from Sippy 2020. Not NULL, if not specified, defaults to now.
  • pai_hdr - the username portion from SIP URI from P-Asserted-Identity header. Optional. String. Available starting from Sippy 2021.
  • rpid_hdr - the username portion from SIP URI from Remote-Party-ID header. Optional. String. Available starting from Sippy 2021.

Returned data could be one of the following:

Failure

  • faultCode = 4XX code

  • faultString - text with description of the failure, e.g. "Call cannot be authenticated automatically. Please specify the fallback account."


Successful lookup but call is not authorized

  • result = “Failure”

  • cause - text

  • other params depending on failure


DID IVR

  • i_did

  • result = OK

  • i_did_authorization

  • i_ivr_application

Success

  • result = OK
  • i_did (optional)

  • i_did_authorization (optional)

  • i_authentication (optional)

  • i_account

  • i_tariff

  • tariff_name

  • i_rate

  • prefix

  • cli

  • cld

  • username

  • average_duration

  • billing parameters (free_seconds, interval_1, interval_N, connect_fee, price_1, price_N, grace_period, post_call_surcharge)

  • i_routing_group

  • routing_group_name

  • lrn_cld_in (optional)

  • lrn_cld (optional)

  • lrn_cli_in (optional)

  • lrn_cli (optional)

  • area_name (optional)

  • routes or onnet_account

  • estimated_cost_orig (estimated cost on origination side) 

  • stir_shaken_enabled (whether or not STIR/SHAKEN is enabled on Routing Group level. Since Sippy 2023)

  • ambiguous_auth (optional from 2021 version). Array which could consist of those parameters in any combination:

    • cli

    • pai

    • rpid


The routes is an array of dictionaries with the keys:

  • cli

  • cld

  • prefix

  • i_destination_set

  • destination_set_name

  • i_route

  • i_media_relay

  • media_relay_is_system

  • i_vendor

  • vendor_name

  • i_connection

  • connection_name

  • capacity

  • num_sessions

  • preference

  • quality_monitor_enabled

  • quality_monitor_action

  • connection_quality

  • failed_quality_monitor (from 2021 version)

  • connection_destination_status (from 2021 version)

  • qmon_action

  • estimated_cost (estimated cost for a Routing Entry on termination side)

  • stir_shaken_mode (per-routing entry setting for Stir-Shaken, either 'required', 'supported', or 'disabled'. Since Sippy 2023)

  • system_connection

  • billing parameters (free_seconds, interval_1, interval_N, connect_fee, price_1, price_N, grace_period, post_call_surcharge)

  • area_name (optional)
  • forbidden
  • huntstop
  • timeout_100
  • timeout_1xx
  • timeout_200
  • onnet_route_type

    • 1 - Listen to Voicemail

    • 2 - Record Voicemail

    • 3 - On-Net route

    • 7 - Service code

    • NULL - vendor route

  • error - optional field. Possible values:

    • loss_protection

  • error_cause - optional field. Explanation of the error


The onnet_account is a dictionary with the following keys:


  • i_account

  • username

  • i_did

  • routes - the same as above


Minutes from minute plan have to be tracked using the separate xmlapi method:

http://support.sippysoft.com/solution/articles/107406-xml-rpc-api-matching-cld-with-account-minute-plans