Custom Header
2 posters
Page 1 of 1
Custom Header
Dear, all right?
I would like to add two new fields to the header, I believe it is in the scripts, but I have no idea which script to configure and which parameter to add ... in test call> advanced settings> Paremeter, I choose SIP header, I add a value, but the SBC does not send the defined parameter, how to use the SIP header parameter in the test call? thanks.
danielfcn- Number of Messages : 6
Point : 10
Registration Date : 2020-01-17
Re: Custom Header
Hi Daniel
You can use sip_header_params.rb script for adding parameters to sip headers. If you want to add/remove some headers you need to create a script for that. Please check our scripting guide from the following link;
https://docs.telcobridges.com/tbwiki/Routing_script_tutorial:Mini_Development_Guide
You can use sip_header_params.rb script for adding parameters to sip headers. If you want to add/remove some headers you need to create a script for that. Please check our scripting guide from the following link;
https://docs.telcobridges.com/tbwiki/Routing_script_tutorial:Mini_Development_Guide
Re: Custom Header
Thanks for the answer, is it possible to use add a custom header to the test call? I ask this because we are performing some tests with your tool, and I believe that changing the script I would have to have a route configured for the call to use the script parameters, am I right? thanks.
danielfcn- Number of Messages : 6
Point : 10
Registration Date : 2020-01-17
Re: Custom Header
In the Test Call Screen Advanced parameters you will Parameter Drop-Down menu. You need to select SIP Header and need to add the additional header on Value.
Re: Custom Header
I understand, you can take a look at the print below, the Value field is correct? it is necessary to use a specific language, as the capture cannot find the custom header, only the other generic headers.
https://servimg.com/view/20157844/1
https://servimg.com/view/20157844/1
danielfcn- Number of Messages : 6
Point : 10
Registration Date : 2020-01-17
Re: Custom Header
You don't need to use any special languagu on the parameter. If you want to send X-Custome-Header: Telcobridges in the INVITE message just write X-Custom-Header:Telcobridges on the parameter.
Re: Custom Header
Dear good afternoon, in which line of the sip_header params.rb script do I add the custom sip header parameters? Can you help me please?
After adding the parameter to the script, is it necessary to change any configuration on the route?
After adding the parameter to the script, is it necessary to change any configuration on the route?
danielfcn- Number of Messages : 6
Point : 10
Registration Date : 2020-01-17
Re: Custom Header
Pkease check how to use sip_header_params.rb script below;
1. Import this script with other filter script in the Web Portal (if not already done)
2. Locate your "main" script (the routing scripts entry point, like "simple_routing.rb")
and include current filter as an after_remap_filter
2.1. Add the following line at begining of the main routing script to load current filter script:
require 'sip_header_params' unless defined?(SipHeaderParams)
2.2. Include the current filter to your routing script's main class (first line afer 'class MyScriptName')
include SipHeaderParams
2.3. Attach current filter as an 'after_remap_filter', passing as argument an array that defines headers to add.
Example:
- :type Define the type of SIP header parameter to add.
:user_param, :uri_param, or :header_param
(see documentation above in this file for more information)
- :contents Contents to add for this parameter. No need to add ; separator, this will be automatically handled.
Example: "user=phone"
- :sip_headers An array of headers to add the parameter to. Possible values:
:calling (SIP "From" header)
:called (SIP "To" header)
:private_address (SIP "P-Asserted-Identity" or "Remote-Party-ID header" header)
:contact (SIP "Contact" header)
:redirecting_number (SIP first "Diversion" header)
:original_called_number (SIP second "Diversion" header)
This can also be any "generic" SIP header (unparsed by routing script):
"X-CustomHeader"
In this case, the script will attempt to find this header (raw) and add header parameters to it.
This may not work in all cases...
Other headers with specific handling:
:request_uri (SIP request-URI header)
Normally automatically build using information from "To" header.
So use this ONLY if you need request_uri to be different from "To".
Not recomended, this may generate inappropriate Request URI header.
Longer example:
3. Optionnally, you can create a new route column named "add_sip_header_params", type boolean.
This route column (attribute) will determine, per route, if the defined SIP headers must be added or not.
(custom route column can be created in the "Routes" section of the web portal under "Create New Route Column")
This route column (attribute) will determine, per route, if the defined SIP headers must be added or not.
(custom route column can be created in the "Routes" section of the web portal under "Create New Route Column")
1. Import this script with other filter script in the Web Portal (if not already done)
2. Locate your "main" script (the routing scripts entry point, like "simple_routing.rb")
and include current filter as an after_remap_filter
2.1. Add the following line at begining of the main routing script to load current filter script:
require 'sip_header_params' unless defined?(SipHeaderParams)
2.2. Include the current filter to your routing script's main class (first line afer 'class MyScriptName')
include SipHeaderParams
2.3. Attach current filter as an 'after_remap_filter', passing as argument an array that defines headers to add.
Example:
- Code:
after_remap_filter :method => :sip_header_params, :headers_to_add => [{ :type=>:user_param, :contents=>"user=phone", :sip_headers=>[:called] }]
- :type Define the type of SIP header parameter to add.
:user_param, :uri_param, or :header_param
(see documentation above in this file for more information)
- :contents Contents to add for this parameter. No need to add ; separator, this will be automatically handled.
Example: "user=phone"
- :sip_headers An array of headers to add the parameter to. Possible values:
:calling (SIP "From" header)
:called (SIP "To" header)
:private_address (SIP "P-Asserted-Identity" or "Remote-Party-ID header" header)
:contact (SIP "Contact" header)
:redirecting_number (SIP first "Diversion" header)
:original_called_number (SIP second "Diversion" header)
This can also be any "generic" SIP header (unparsed by routing script):
"X-CustomHeader"
In this case, the script will attempt to find this header (raw) and add header parameters to it.
This may not work in all cases...
Other headers with specific handling:
:request_uri (SIP request-URI header)
Normally automatically build using information from "To" header.
So use this ONLY if you need request_uri to be different from "To".
Not recomended, this may generate inappropriate Request URI header.
Longer example:
- Code:
after_remap_filter :method => :sip_header_params, :headers_to_add => [
{
:documentation => "Add user=phone to user parameters of most SIP headers",
:type => :uri_param,
:contents => "user=phone",
:sip_headers => [
:calling,
:called,
:private_address,
:contact,
:redirecting_number,
:original_called_number,
"X-CustomHeader"
]
},
{
:documentation => "Add foo=123 to uri parameters of 'From' header",
:type => :uri_param,
:contents => "foo=bar",
:sip_headers => [ :calling ]
}
]
3. Optionnally, you can create a new route column named "add_sip_header_params", type boolean.
This route column (attribute) will determine, per route, if the defined SIP headers must be added or not.
(custom route column can be created in the "Routes" section of the web portal under "Create New Route Column")
This route column (attribute) will determine, per route, if the defined SIP headers must be added or not.
(custom route column can be created in the "Routes" section of the web portal under "Create New Route Column")
Re: Custom Header
Thanks for the reply friend, I definitely can't do these settings, the sip_header_params.rb script already exists, it's in "Filter Scripts" I've already added "require 'sip_header_params' unless defined? (SipHeaderParams)" in the simple_routing_sbc.rb script and the script simple_routing.rb, I already added the custom parameters in the script sip_header_params.rb (print attachment) but without success, I would like the call to exit with the parameters of the link https://docs.telcobridges.com/mediawiki/images/c/c9/TB_Custom_SIP_Headers .pcap used as an example.

I would like the calls to go out this way.


I would like the calls to go out this way.

danielfcn- Number of Messages : 6
Point : 10
Registration Date : 2020-01-17
Re: Custom Header
In that case you need to write a script. Please check our scripting guide;
https://docs.telcobridges.com/tbwiki/Routing_script_tutorial:Mini_Development_Guide
Or you can contact with support@telcobridges.com with all details and we can try to help you.
https://docs.telcobridges.com/tbwiki/Routing_script_tutorial:Mini_Development_Guide
Or you can contact with support@telcobridges.com with all details and we can try to help you.

» Script to remove sip header
» SIP contact header during SIP Registration
» Need to remove the Route header on invite and register, but don't know how to implement the script.
» Adding a SIP Header to outgoing call
» Adding a pre-defined SIP header to outgoing leg
» SIP contact header during SIP Registration
» Need to remove the Route header on invite and register, but don't know how to implement the script.
» Adding a SIP Header to outgoing call
» Adding a pre-defined SIP header to outgoing leg
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum