SN10k - called number routing based on SIP Request URI (RURI)
Posted by Michal Podoski, Last modified by Daniel Lizaola on 20 December 2017 12:48 PM

By default SN10k uses the SIP From: Header value in :called routing script variable. In most cases this is the standard way SIP Soft Switches handle called number routing. From time to time however the requirement is to use data provided in the user-info part of Request URI Header (RURI). Here is how to achieve this.

* Assumption is, you are using SmartMedia 2.7 or 2.8 branch
** Another assumpton is that you have no custom modifications introduced to the routing process. If this isn't true you would need to ensure the directives in point 5 are deployed in the right order

1. Go to:
'Menu -> Gateway -> Routes -> Routing Script'
- if you haven't created any Scripts yet please go ahead and create a new Routing Script

2. Enter the newly created Routing Script (or the previously used one):
'Menu -> Gateway -> Routes -> Routing Script -> /your script/'

(In case you have already configured the gateway application to use this Routing Sctript, you will be automatically redirected to "Editing script" view)

3. You should find youself in the "Editing script" screen
- locate the "Editing script file" context
- in the "Scripts" table locate the script called "simple_routing" and open it for edition
- ensure that the "Load on startup" parameter is checked 
- press "Save" on the bottom of the screen

4. Next after getting back to the "Editing script file"
- browse the "Example Scripts" list 
- locate script "called_pre_remap_and_ruri.rb"
- open the script for edition and check:
* line 9 contains: "module CalledPreRemapAndRuri"
* line 17 contains: "def called_pre_remap_and_ruri params"

5. Get back to the "simple_routing" script
- implement following changes (line numbers are absolute - they don't contain currently implemented changes)
* between lines 8 and 9 insert: "require 'called_pre_remap_and_ruri'"
* between lines 30 nd 31 insert: "include CalledPreRemapAndRuri"
* after above insert: "before_filter :method => :called_pre_remap_and_ruri"
- press "Save on the bottom of the screen

6. Go to 'Menu -> Gateway'
- make sure that parameter "Use script" is using the name of the Routing Script in which you have been just modyfing "simple_routing" file

 

From now on call[:called] variable will be populated from RURI user-info header.

 

Example script can be found here

(8748 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).