Actions

Routing Script Tutorial: Routing Script Tests: Difference between revisions

(Created page with "{{DISPLAYTITLE:Routing Script Tests}} The Web portal features a tool for testing scripts. You enter parameters to simulate the incoming call and after pressing the Test button, it will output selected routes and numbers. You do not need to activate the new routes, or the new scripts to use this test tool: It can be used to test the routing scripts and routing table before activating it. This is available in the Routing Scripts section of the Web portal. === Test parame...")
 
No edit summary
Line 1: Line 1:
{{DISPLAYTITLE:Routing Script Tests}}
{{DISPLAYTITLE:Routing Script Tests}}
==Introduction==
The Web portal features a tool for testing scripts. You enter parameters to simulate the incoming call and after pressing the Test button, it will output selected routes and numbers.  You do not need to activate the new routes, or the new scripts to use this test tool: It can be used to test the routing scripts and routing table before activating it.
The Web portal features a tool for testing scripts. You enter parameters to simulate the incoming call and after pressing the Test button, it will output selected routes and numbers.  You do not need to activate the new routes, or the new scripts to use this test tool: It can be used to test the routing scripts and routing table before activating it.
This is available in the Routing Scripts section of the Web portal.
This is available in the Routing Scripts section of the Web portal.


=== Test parameters ===
== Test parameters ==
==== @call_params  ====
=== @call_params  ===


That variable should contain a hash of call parameters that will be passed to the routing script. This is equivalent to the incoming call parameters.  
That variable should contain a hash of call parameters that will be passed to the routing script. This is equivalent to the incoming call parameters.  
Line 10: Line 11:
<br>  
<br>  


==== @nap_list  ====
=== @nap_list  ===


A list of the hash containing the nap statuses. This is equivalent to the nap statuses at the time the call is to be routed.  
A list of the hash containing the nap statuses. This is equivalent to the nap statuses at the time the call is to be routed.  
Line 18: Line 19:
<br>  
<br>  


==== @params  ====
=== @params  ===


A hash of hashes containing parameters. This hash contains bridge parameters and other kind of parameter groups may be added in the future.  
A hash of hashes containing parameters. This hash contains bridge parameters and other kind of parameter groups may be added in the future.  

Revision as of 14:56, 29 March 2024

Introduction

The Web portal features a tool for testing scripts. You enter parameters to simulate the incoming call and after pressing the Test button, it will output selected routes and numbers. You do not need to activate the new routes, or the new scripts to use this test tool: It can be used to test the routing scripts and routing table before activating it. This is available in the Routing Scripts section of the Web portal.

Test parameters

@call_params

That variable should contain a hash of call parameters that will be passed to the routing script. This is equivalent to the incoming call parameters.


@nap_list

A list of the hash containing the nap statuses. This is equivalent to the nap statuses at the time the call is to be routed.

The nap list is hashed by the nap names in UPPERCASE. It is important to consider this when creating new dynamic route or nap attributes that may nap names that will be used to fetch a status.


@params

A hash of hashes containing parameters. This hash contains bridge parameters and other kind of parameter groups may be added in the future.

 @params = {
    :bridge => {:announcement_tone, "announcement.wav"},
    :contacts => {
      :index=>"1",
      :list=>[
         {:called_number=>"6660", :priority=>"1000", :is_number_ported=>"0", :sip_uri=>"",
          :raw_data=>"", :expiration=>"3600"},
         {:called_number=>"6661", :priority=>"1000", :is_number_ported=>"0", :sip_uri=>"sip:6661@192.168.215.127", 
          :raw_data=>"<sip:6661@192.168.215.127>", :expiration=>"3600"}
      ],
      :source_indexes=>"nil,0"
    }
 }




Back to Routing Script Tutorial.