Actions

Adding Timeslot Control to Routing Scripts

Revision as of 13:48, 19 September 2023 by Luc Morissette (talk | contribs) (→‎Adding new timeslot variable)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
This article applies to: Product Version
ProSBC 3.1, 3.2

This article describes how to add timeslot_control.rb script to any Routing scripts.
The script demonstrates how to make routing decisions based on the inbound timeslot, and how to use routing decisions to select an outbound timeslot. This is useful in CAS environments where some timeslots in a T1/E1 may be used for different purposes.

Requirements for this script

This script has been designed for controlling timeslots so the system must have TDM interfaces configured in the system. See: [TDM lines]

Add timeslot_control.rb Script in system

Download this file:

timeslot control routing script

Then uncompress and upload it in the system with these instructions: Import Customized Routing Script You can also copy/paste the content of the main file and create a new 'Main' Script using the Create New Script File menu

Setting up Timeslot Control Script

To set up a Filter, the main script needs to be modified. The main script can be either simple_routing.rb, simple_routing_sbc.rb, or any other script with the 'Main' type.



Go to the routing script section of the Web portal

Gateway -> Routing scripts -> simple_routing_sbc.rb [Edit]

Three things need to be added. At the start of the script:

require 'timeslot_control'

In the main class:

include TimeslotControl
   route_remap :method => :timeslot_control


The final 'Main' script will look like this:

require 'base_routing'
require 'timeslot_control'

class SimpleRouting < BaseRouting
  include TimeslotControl
  
  before_filter :method => :timeslot_read

  route_match :call_field_name => :called
  route_match :call_field_name => :calling
  route_match :call_field_name => :nap

  route_remap :call_field_name => :called, :route_field_name => :remapped_called
  route_remap :call_field_name => :calling, :route_field_name => :remapped_calling
  route_remap :call_field_name => :nap, :route_field_name => :remapped_nap

  route_remap :method => :timeslot_control

end

There may be other scripts called by this 'Main' script. This is normal.


Adding new timeslot variable

You need to add two new custom columns to use this script. There is a default value created and it can be changed in each route afterwards. The best is to create a multiple choice option to prevent errors. In this case, it will be the list of available line services (TDM lines) that can be used for controlling the timeslots (all CAS trunks).

Gateway -> Routes -> Create New Route Column

Name: lineservice
Type attributes: none|DS1_01|DS1_02|DS1_03|...|DS1_84
Default: none

The result will look like this:

Then you can do the same for the timeslots:

Gateway -> Routes -> Create New Route Column

Name: timeslot
Type attributes: none|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24
Default: none

The result will look like this:


You can then go in each route and change these values.
lineservice='DS1_02' will use the second T1 configured. 'none' will disable the use of this feature.
timeslot='5' will use the timestot 5 of DS1_02 for this route.