Add Attestation-Info, Origination-ID and verstat in SIP headers according to incoming number

This script will add three SIP headers in the outgoing SIP Invites for stir/shaken cases

A. Add Header “Attestation-info”
Attestation-Info: A or B depending on the calling numbers
Will read from “calling_list.csv” file - if the number is present: A, otherwise B

B. Add “verstat” in FROM header (Added in sip_header_params script)
SIP-URI : From : "0123456789"sip:+123456789;verstat=TN-Validation-Passed@domain.com;user=phone;tag=abcdefghijk

C. Add Header “origination-ID” :
Origination-ID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx


How to use

  1. Load add_sip_attestation.rb script:
    Gateway → Routing Scripts → Import Script File
    File: add_sip_attestation.rb
    ScriptType: Customer
    Load at Startup: [unchecked]
  2. Edit main script in 3 places (maybe simple_routing.rb):
    require ‘add_sip_attestation’
    require ‘sip_header_params’ unless defined?(SipHeaderParams)

include AddSIPAttestation
include SipHeaderParams

before_filter :method => :add_sip_attestation

after_remap_filter :method => :sip_header_params, :headers_to_add => [
{
:documentation => “Add verstat to user parameters of most SIP headers”,
:type => :user_param,
:contents => “verstat=TN-Validation-Passed”,
:sip_headers => [
:calling
]
},
]

  1. Add CSV file with one column named “calling”
    Import file calling_list.csv: File DB → Custom Files → Import new file

Hi Luc !

Can you post your script please ?

Thanks

Florent