Telcobridges - Session Border Controllers
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Custom Header

3 posters

Go down

Custom Header Empty Custom Header

Post by danielfcn Fri Jan 17, 2020 3:42 pm


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

Back to top Go down

Custom Header Empty Re: Custom Header

Post by Admin Mon Jan 20, 2020 2:34 am

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

Admin
Admin

Number of Messages : 508
Point : 1199
Registration Date : 2017-11-27

http://freesbc.yetkinforum.com

Back to top Go down

Custom Header Empty Re: Custom Header

Post by danielfcn Mon Jan 20, 2020 8:09 am

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

Back to top Go down

Custom Header Empty Re: Custom Header

Post by Admin Mon Jan 20, 2020 8:30 am

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.

Admin
Admin

Number of Messages : 508
Point : 1199
Registration Date : 2017-11-27

http://freesbc.yetkinforum.com

Back to top Go down

Custom Header Empty Re: Custom Header

Post by danielfcn Mon Jan 20, 2020 9:06 am

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

danielfcn

Number of Messages : 6
Point : 10
Registration Date : 2020-01-17

Back to top Go down

Custom Header Empty Re: Custom Header

Post by Admin Mon Jan 20, 2020 9:17 am

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.

Admin
Admin

Number of Messages : 508
Point : 1199
Registration Date : 2017-11-27

http://freesbc.yetkinforum.com

Back to top Go down

Custom Header Empty Re: Custom Header

Post by danielfcn Mon Feb 17, 2020 11:54 am

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?

danielfcn

Number of Messages : 6
Point : 10
Registration Date : 2020-01-17

Back to top Go down

Custom Header Empty Re: Custom Header

Post by Admin Mon Feb 17, 2020 12:04 pm

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:
             
Code:
after_remap_filter :method => :sip_header_params, :headers_to_add => [{ :type=>:user_param, :contents=>"user=phone", :sip_headers=>[:called] }]
           Each element of this array is a hash that contains the following keys:
             - :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")

Admin
Admin

Number of Messages : 508
Point : 1199
Registration Date : 2017-11-27

http://freesbc.yetkinforum.com

Back to top Go down

Custom Header Empty Re: Custom Header

Post by danielfcn Mon Feb 17, 2020 1:54 pm

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.

Custom Header Script10


I would like the calls to go out this way.
Custom Header Print_10

danielfcn

Number of Messages : 6
Point : 10
Registration Date : 2020-01-17

Back to top Go down

Custom Header Empty Re: Custom Header

Post by Admin Tue Feb 18, 2020 2:05 am

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.

Admin
Admin

Number of Messages : 508
Point : 1199
Registration Date : 2017-11-27

http://freesbc.yetkinforum.com

Back to top Go down

Custom Header Empty Custom Header

Post by gjaca@voipgroup.com Fri Jul 21, 2023 3:21 pm

Hi Guys, I have the same need. sip_headers_params does not solves it since I need to insert/create a new custom header.

I have found in the wiki this:

call[ :sip_header ] = "NewHeader=Value"

But I don't know how to implement it within the simple_routing_sbc script.

If you could give an example, I would really appreciate it.

Thanks

gjaca@voipgroup.com

Number of Messages : 2
Point : 4
Registration Date : 2023-07-21

Back to top Go down

Custom Header Empty Re: Custom Header

Post by Admin Mon Jul 24, 2023 1:54 am

Please check following link to add customer SIP header:
https://forums.freesbc.com/t683-adding-a-sip-header-to-outgoing-call

Admin
Admin

Number of Messages : 508
Point : 1199
Registration Date : 2017-11-27

http://freesbc.yetkinforum.com

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum