NSG- SS7 BT Configuration

 

Intention of this page to explain NSG connectivity with BT SS7 Network.

Network diagram :

BT ----SS7/ISUP ---- NSG ---- SIP --- SIP Server/Asterisk

NSG FreeTDM Configuration

NOTE: As of now many parameters settings are not available in GUI so recommanding once all basic SS7 configuration is generated then only add below mentioned configuration parameters and afterwards please dont use GUI. As GUI may override the settings. We are in process of upgrading GUI to support configuration of BT specific parameters but till then we need to manage by doing manual operation.

File:  /usr/local/nsg/conf/autoload_configs/freetdm.conf.xml -  

  1. Add below parameter in ss7 gen section.

                    <sng_gen> 
                          <param name="link_failure_action" value="1"/>   <!-- default value = 0 i.e.  keep calls , value=1 release calls in case there is link failure during ringing state -->
                    </sng_gen>

  1. Add/Modify below parameters in ISUP Interface section  - 

                     <isup_interface name="ISUP1">
                          <param name="isup.t6" value="600"/>
                          <param name="isup.t9" value="1800"/>
                          <param name="pauseAction" value="3"/>
                          <param name="defRelLocation" value="3"/>
                          <param name="isup.tpause" value="5000"/>
                     </isup_interface>

  1. Add/Modify below parameters in CC SPAN section - 

                               <cc_span>      
                                        <param name="cpg_on_progress" value="no">
                                         <param name="cpg_on_alert" value="yes"/>
                                          <param name="bearcap_check_enable" value="yes"/>
                                          <param name="cpg_on_progress_media" value="no"/>
                             </cc_span>

NOTE: Above settings should be good, BUT if require we might need to adjust cpg flag settings during IOT.

 

NSG Dialplan Configuration

file:  /usr/local/nsg/conf/dialplan/default.xml

Please find below examples of dialplan which can be handy to use during testing.

  1. Add below before bridging call to SIP side. PSTN to SIP context.

                     <action application="export" data="sip_h_X-FreeTDM-Real-Num=${freetdm_ss7_orig_clg_num}"/>
                     <action application="export" data="sip_h_X-FreeTDM-Bearer-Cap=${freetdm_bearer_capability}"/>
                     <action application="set" data="call_timeout=180"/>
                     <action application="export" data="call_timeout=180"/>

                     <!-- Only if you want NSG to play ringback then enable below -->

                     <!-- <action application="set" data="ringback=%(400,200,400,450);%(400,2000,400,450)"/> -->

  1. If there are too many X headers are going over SIP and we like to disable some, you can remove them via dialplan. Perform UNSET operation just before bridging call to SIP side.

Example below is removing Redirect Number and Divert Line ID X header from SIP INVITE.

                       <action application="unset" data="sip_h_X-FreeTDM-RDNIS"/>
                        <action application="unset" data="sip_h_X-FreeTDM-RDNIS-NADI"/>
                        <action application="unset" data="sip_h_X-FreeTDM-RDNIS-Plan"/>
                        <action application="unset" data="sip_h_X-FreeTDM-SpanName"/>
                        <action application="unset" data="sip_h_X-FreeTDM-DivertLineId-NADI"/>
                        <action application="unset" data="sip_h_X-FreeTDM-DivertLineId-Screen"/>
                        <action application="unset" data="sip_h_X-FreeTDM-DivertLineId-Plan"/>
                        <action application="unset" data="sip_h_X-FreeTDM-DivertLineId-IncInd"/>

 

  1. Add below before bridging call to TDM side.

                        <action application="set" data="call_timeout=180"/>
                        <action application="export" data="call_timeout=180"/>

  1. We might need to expose some freetdm variables from X headers (depends on scenarios), examples are as given below - 

                        <action application="export" data="freetdm_ss7_gn_digits=${sip_h_X-FreeTDM-GN}" />
                        <action application="export" data="freetdm_ss7_gn_numqual=${sip_h_X-FreeTDM-GN-NumQual}" />
                        <action application="export" data="freetdm_ss7_gn_nadi=${sip_h_X-FreeTDM-GN-NADI}" />
                        <action application="export" data="freetdm_ss7_gn_screen_ind=${sip_h_X-FreeTDM-GN-Screen}" />
                        <action application="export" data="freetdm_ss7_gn_pres_ind=${sip_h_X-FreeTDM-GN-Presentation}" />
                        <action application="export" data="freetdm_ss7_gn_npi=${sip_h_X-FreeTDM-GN-Plan}" />
                        <action application="export" data="freetdm_ss7_gn_num_inc_ind=${sip_h_X-FreeTDM-GN-NumInComp}" />
                        <action application="export" data="freetdm_ss7_pres_num_digits=${sip_h_X-FreeTDM-PresNumber}" />
                        <action application="export" data="freetdm_ss7_pres_num_screen_ind=${sip_h_X-FreeTDM-PresNumber-Screen}" />
                        <action application="export" data="freetdm_ss7_pres_num_pres_ind=${sip_h_X-FreeTDM-PresNumber-PresInd}" />
                        <action application="export" data="freetdm_ss7_pres_num_npi=${sip_h_X-FreeTDM-PresNumber-Plan}" />
                        <action application="export" data="freetdm_ss7_pres_num_nadi=${sip_h_X-FreeTDM-PresNumber-NADI}" />
                        <action application="export" data="freetdm_ss7_pres_num_pref_plan_ind=${sip_h_X-FreeTDM-PresNumber-PrefInd}" />
                       <action application="export" data="freetdm_bearer_capability=${sip_h_X-FreeTDM-Bearer-Cap}"/>

 

  1. If we want to change NADI based on caller id number then we can use below dialplan conditions/rules before bridging call to TDM.

              <condition field="caller_id_number" expression="[\+]([0-9a-zA-Z]+)" break="never" >
                        <action application="log" data="INFO Called number ${caller_id_number}" />
                        <action inline="true" application="export" data="freetdm_ss7_clg_nadi=4" />
                        <action inline="true" application="set" data="caller_id_number=$1" />
                        <action inline="true" application="set" data="caller_id_name=$1" />
                        <action inline="true" application="export" data="freetdm_ss7_rdnis_nadi=4"/>
               </condition>

  1. If we want to change destination number based on Nature of Address indicator field then use below dialplan condition in "pstn-to-sip" context.

               <condition field="${freetdm_ss7_pres_num_nadi}" expression="^(3)$" break="never">  <!-- if NADI is 3 then prefix destination number with 44 ..this is just an example..-->
                     <action application="set" data="destnumber=44${destnumber}" />
                      <action application="log" data="INFO NAI ${freetdm_ss7_pres_num_nadi}" />
                      <action application="log" data="INFO Destnum${destnumber}" />
                </condition>

  1. If we want to reject call due to "Invalid number or Incomplete address" then we can use below syntax. Please note that this is just an example to modify as per your requirement.

     
   Below example we are checking if number not matching in regular expression then anti-action will kick off and we can reject the call with required Release cause and location value.

   <condition field="destination_number" expression="^(01473\d\d\d\d\d\d)|(1473\d\d\d\d\d\d)|(01473\d\d\d\d\d\d\d)|(1473\d\d\d\d\d\d\d)$" break="never">

                        <action application="log" data="Invalid/Unknown number ..Hanging up"/>

                        <anti-action application="set" data="ss7_rel_cause=28"/>

                        <anti-action application="export" data="ss7_rel_cause=28"/>

                        <anti-action application="set" data="ss7_rel_loc=3"/>

                        <anti-action application="export" data="ss7_rel_loc=3"/>

                        <anti-action application="hangup" data="UNALLOCATED_NUMBER"/>

                </condition>

Asterisk Configuration : 

This section to describe Asterisk configuration if asterisk is using as SIP Server where NSG will terminate SIP traffic.

If Asterisk is receiving originating call from BT and then trying to place outgoing call towards BT,  then Asterisk needs to relay X headers to outgoing leg as received from Incoming leg. 

Relying X header in asterisk dialplan -     
As shown below we are trying to add set local variable "span" based on incoming X header "SpanName".
exten => _X.,1,set(span=${SIP_HEADER(X-freetdm-SpanName)})

below example we are adding X header in outgoing leg  whose value we are picking from incoming leg/invite.

exten => _X.,1,SIPAddHeader(X-Freetdm-HopCounter: ${SIP_HEADER(Max-Forwards)})

 

Examples- 

Examples below are for adding various fields into outgoing leg based on incoming leg values captured in respective variables.

; Pres number
exten => s,n,SIPAddHeader(X-FreeTDM-PresNumber: ${POLI})
exten => s,n,SIPAddHeader(X-FreeTDM-PresNumber-Screen: ${POLI-screen})
exten => s,n,SIPAddHeader(X-FreeTDM-PresNumber-NADI: ${POLI-nadi})
exten => s,n,SIPAddHeader(X-FreeTDM-PresNumber-PresInd: ${POLI-pres})
exten => s,n,SIPAddHeader(X-FreeTDM-PresNumber-Plan: ${POLI-plan})
exten => s,n,SIPAddHeader(X-FreeTDM-PresNumber-PrefInd: ${POLI-pref})

 

; GN number
exten => s,n,SIPAddHeader(X-FreeTDM-GN: ${GOLI})
exten => s,n,SIPAddHeader(X-FreeTDM-GN-NumQual: ${GOLI-qual})
exten => s,n,SIPAddHeader(X-FreeTDM-GN-NADI: ${GOLI-nadi})
exten => s,n,SIPAddHeader(X-FreeTDM-GN-Screen: ${GOLI-screen})
exten => s,n,SIPAddHeader(X-FreeTDM-GN-Presentation: ${GOLI-pres})
exten => s,n,SIPAddHeader(X-FreeTDM-GN-Plan: ${GOLI-plan})
exten => s,n,SIPAddHeader(X-FreeTDM-GN-NumInComp: ${GOLI-incomp})

 

; Here is a setting of the "usual" Asterisk variables.
; NOTE! The variable for the calling ID I keep in E164 and that needs changing before sending
exten => s,n,Set(CALLERID(num)=${IF($["${TOLI:0:2}"="44"]?${TOLI:2}:${TOLI})})
exten => s,n,Set(CALLERID(name)=${CALLERID(num)})
exten => s,n,SIPAddHeader(X-FreeTDM-Presentation: ${OOLI-pres})
exten => s,n,SIPAddHeader(X-FreeTDM-Screen: ${OOLI-screen})
exten => s,n,SIPAddHeader(X-FreeTDM-NADI: ${OOLI-nadi})
exten => s,n,SIPAddHeader(X-FreeTDM-CPC: ${OOLI-cpc})

; National Forward Call Indicator
exten => s,n,SIPAddHeader(X-FreeTDM-NFCI-CLI-BlockingInd: ${NFCI-blockIND})
exten => s,n,SIPAddHeader(X-FreeTDM-NFCI-NwTransAddr-Ind: ${NFCI-trans})
exten => s,n,SIPAddHeader(X-FreeTDM-LxL_RCI: ${NFCI-lxlRCI})
exten => s,n,SIPAddHeader(X-FreeTDM-LxL_ISI: ${NFCI-lxlISI})

; Nature of call in HEX
exten => s,n,SIPAddHeader(X-FreeTDM-IAM-NATURE-CONN-HEX: ${IAM-NATURE})
exten => s,n,SIPAddHeader(X-FreeTDM-Bearer-Cap: ${IAM-EXTRA})
exten => s,n,SIPAddHeader(X-FreeTDM-IAM-FWD-IND-HEX: ${IAM-FWD})

; Select TDN:
exten => s,n,SIPAddHeader(X-FreeTDM-DNIS-NADI: ${ODN-nadi})

References:  

  1. SIP to ISUP UK Spec i.e. ND1017 

 2. Automatic Congestion Control (ACC) in NSG.

 

Return to Documentation Home I Return to Sangoma Support