The testDialplan() XML-RPC API method allows to inspect how a call will be routed, method available starting from 5.0 version of Sippy.

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

The application support trusted mode and i_customer parameter should be supplied in this case.


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

  • 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

    • 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.

Returned data could be one of the following cases:

Failure

  • result = “Failure”

  • cause - text

  • other params depending on failure

DID IVR

  • i_did

  • i_did_authorization

  • i_ivr_application

Success

  • i_did (optional)

  • i_did_authorization (optional)

  • i_authentication (optional)

  • i_account

  • i_tariff

  • 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, area_name)

  • i_routing_group

  • lrn_cld_in (optional)

  • lrn_cld (optional)

  • routes or onnet_account


The routes is an array of dictionaries with the keys:

  • cli

  • cld

  • prefix

  • i_destination_set

  • destination_set_name

  • i_route

  • i_media_relay

  • i_vendor

  • vendor_name

  • i_connection

  • connection_name

  • capacity

  • num_sessions

  • preference

  • quality_monitor_enabled

  • connection_quality

  • qmon_action

  • estimated_cost

  • system_connection

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

  • forbidden
  • 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