Knowledgebase:
SmartMedia 2.8 routing script parameters
Posted by Michal Podoski, Last modified by Danny Staub on 15 November 2017 02:55 PM

Script parameters protocol mapping

The following call parameters are available in the call object. For example

 called_number = call[:called]
Script parameter nameISDN
R2 CASSS7
SIP
Comment
SmartMedia
version
leg_id N/A N/A N/A N/A Leg ID  
session_id N/A N/A N/A N/A Session ID  
calling Q931: 'Calling party number' IE - Number digits  ANI (Group B) Q763: 'Calling party number' IE - address signals (*) SIP:From - user-info * In ANSI SS7 LNP networks, the IE 'generic address parameter' is used (when present) instead.  
calling_noa Q931: 'Calling party number' IE - Type of number N/A Q763: 'Calling party number' IE - nature of address indicator (*) N/A * In ANSI SS7 LNP networks, the IE 'generic address parameter' is used (when present) instead  
calling_npi  Q931: 'Calling party number' IE - Numbering plan identification N/A Q763: 'Calling party number' IE - numbering plan indicator (*) N/A * In ANSI SS7 LNP networks, the IE 'generic address parameter' is used (when present) instead  
calling_display  Q931: 'Display' IE - Display information

Q931: 'Facility CNAM' IE when presentation is allowed for DMS/NI2 variants

N/A Q763: 'Display information' IE - display information SIP:From - display-name    
calling_display_type Q931: 'Display' IE - Display information (present and/or first byte) N/A Q763: 'Display information' IE - present or not N/A    
calling_presentation  Q931: 'Calling party number' IE - Presentation indicator N/A Q763: 'Calling party number' IE - address presentation restricted indicator

SIP:From - display-name (displays 'anonymous' or not)

SIP:Remote-party-id - privacy

   
calling_screening Q931: 'Calling party number' IE - Screening indicator N/A Q763: 'Calling party number' IE - screening SIP:Remote-party-id - screen    
calling_category N/A Call party category (Group A) Q763: 'Calling party's category' IE - calling party's category

SIP:From - cpc

SIP:P-asserted-identity - cpc

   
calling_subscriber

(Generic Number / NDS)

Q931: 2nd 'Calling party number' IE - Number digits  N/A Q763: Generic number IE with type 'additional calling party number' - Number digits

SIP:P-asserted-identity - userinfo

SIP:Remote-party-id - user-info

Requires option 'support 2 calling number IE' in the profile. This variable has priority over 'private_address' in the outgoing direction.  
calling_subscriber_noa Q931: 2nd 'Calling party number' IE - Type of number N/A Q763: Generic number IE with type 'additional calling party number' - nature of address indicator SIP:P-asserted-identity - userinfo

SIP:Remote-party-id - user-info

   
calling_subscriber_npi  Q931: 2nd 'Calling party number' IE - Numbering plan identification N/A Q763: Generic number IE with type 'additional calling party number' - numbering plan indicator SIP:P-asserted-identity - userinfo

SIP:Remote-party-id - user-info


 

 
calling_subscriber_presentation Q931: 2nd 'Calling party number' IE - Presentation indicator N/A Q763: Generic number IE with type 'additional calling party number' - presentation restricted indicator SIP:P-asserted-identity - userinfo

SIP:Remote-party-id - user-info

   
calling_subscriber_screening  Q931: 2nd 'Calling party number' IE - Screening indicator N/A Q763: Generic number IE with type 'additional calling party number' - screening SIP:P-asserted-identity - userinfo

SIP:Remote-party-id - user-info

   
private_display Q931: 'Facility CNAM' IE when presentation is restricted for DMS/NI2 variants N/A N/A

SIP:P-asserted-identity - display-name

SIP:Remote-party-id - display-name

   
private_display_type  N/A N/A N/A N/A Indicate presence or not of the private calling information  
private_address N/A N/A N/A

SIP:P-asserted-identity - userinfo

SIP:Remote-party-id - user-info

   
called  Q931: 'Called party number' IE - Number digits  DNIS (Group A) Q763: 'Called party number' IE - address signals SIP:To - user-info and host    
called_noa  Q931: 'Called party number' IE - Type of number N/A Q763: 'Called party number' IE - nature of address indicator N/A    
called_npi  Q931: 'Called party number' IE - Numbering plan identification N/A Q763: 'Called party number' IE - numbering plan indicator N/A    
charge_number N/A N/A ANSI: 'Charge number' IE - address signals N/A    
charge_number_noa  N/A N/A ANSI: 'Charge number' IE - nature of address indicator N/A    
charge_number_npi N/A N/A ANSI: 'Charge number' IE - numbering plan indicator N/A    
redirecting_number_forward_enabled  N/A N/A N/A N/A Overwrite default redirecting number and original called number forwarding behavior from incoming to outgoing leg   
redirecting_number  Q931: 'Redirecting number' 1st IE - Number digits  N/A Q763: 'Redirecting number' IE - address signals SIP:Diversion (2nd header) - display-name    
redirecting_number_noa  Q931: 'Redirecting number' 1st IE - Type of number N/A Q763: 'Redirecting number' IE - nature of address indicator N/A    
redirecting_number_npi  Q931: 'Redirecting number' 1st IE - Numbering plan identification N/A Q763: 'Redirecting number' IE - numbering plan indicator N/A    
redirecting_number_presentation  Q931: 'Redirecting number' 1st IE - Presentation indicator  N/A Q763: 'Redirecting number' IE - address presentation restricted indicator SIP:Diversion (2nd header) - diversion-privacy    
redirecting_number_indicator  N/A N/A Q763: 'Redirection information' IE - redirecting indicator N/A    
redirecting_number_reason  Q931: 'Redirecting number' 1st IE - Reason for redirection N/A Q763: 'Redirection information' IE - redirecting reason SIP:Diversion (2nd header) - diversion-reason    
redirecting_number_counter  N/A N/A Q763: 'Redirection information' IE - redirection counter SIP:Diversion (2nd header) - diversion-counter    
original_called_number

(OCN) 

Q931: 'Redirecting number' 2nd IE - Number digits  N/A Q763: 'Redirection number' IE - address signals SIP:Diversion  (1st header) - display-name    
original_called_number_noa  Q931: 'Redirecting number' 2nd IE - Type of number N/A Q763: 'Redirection number' IE - nature of address indicator N/A    
original_called_number_npi  Q931: 'Redirecting number' 2nd IE - Numbering plan identification N/A Q763: 'Redirection number' IE - numbering plan indicator N/A    
original_called_number_presentation  Q931: 'Redirecting number' 2nd IE - Presentation indicator  N/A Q763: 'Redirection number' IE - address presentation restricted indicator SIP:Diversion (1st header) - diversion-privacy    
original_called_number_reason  Q931: 'Redirecting number' 2nd IE - Reason for redirection N/A Q763: 'Redirection information' IE - original redirection reason SIP:Diversion (1st header) - diversion-reason    
original_called_number_counter  N/A N/A N/A SIP:Diversion (1st header) - diversion-counter    
ported_number  N/A N/A Q763: 'Called party number' IE - address signals SIP:RequestURI - rn Only valid if SIP/SS7 supports LNP  
ported_number_noa  N/A N/A Q763: 'Called party number' IE - nature of address indicator N/A Only valid if SIP/SS7 supports LNP  
ported_number_npi  N/A N/A Q763: 'Called party number' IE - numbering plan indicator N/A Only valid if SIP/SS7 supports LNP  
oli

(Originating line information) 

5ESS Codeset 6 OLI - Value N/A ANSI: 'Originating line information' IE - OLI

SIP:From - oli

SIP:P-asserted-identity - oli

   
request_uri  N/A N/A N/A Complete Request URI string    
request_uri_forward_enabled  N/A N/A N/A N/A Overwrite default URI forwarding behavior from incoming to outgoing leg  
sip_header N/A N/A N/A Any header Requires option 'Forward custom headers' in Profiles->SIP  2.7.63
nap

(Network Access Point) 

N/A N/A N/A N/A Incoming leg NAP name (read-only)  
type_of_network_identification Q931: 'Transit network selection' IE - Type of network identification N/A Q763: 'Transit network selection' IE - Type of network identification  N/A   2.7
network_identification Q931: 'Transit network selection' IE - Network identification N/A Q763: 'Transit network selection' IE - Network identification  SIP: Request-Line - cic   2.7
network_identification_plan Q931: 'Transit network selection' IE - Network identification plan  N/A Q763: 'Transit network selection' IE - Network identification plan  N/A   2.7
location_number_forward_enabled  N/A N/A N/A N/A Overwrite default location number forwarding behavior from incoming to outgoing leg  2.7
location_number  N/A N/A Q763: 'Location number' IE - address signals N/A   2.7
location_number_noa  N/A N/A Q763: 'Location number' IE - nature of address indicator N/A   2.7
location_number_npi  N/A N/A Q763: 'Location number' IE - numbering plan indicator N/A   2.7
location_number_presentation N/A N/A Q763: 'Location number' IE - presentation restricted indicator N/A   2.7
location_number_screening  N/A N/A Q763: 'Location number' IE - screening N/A   2.7
mlpp_forward_enabled  N/A N/A N/A N/A A script needs to set this to true if it wants to overwrite MLPP information in the outgoing leg. Otherwise, profile relay 'outgoing mode' applies automatically. 2.7
mlpp_look_for_busy  N/A N/A Q763: 'MLPP precedence' IE - look ahead for busy N/A   2.7
mlpp_precedence_level  N/A N/A Q763: 'MLPP precedence' IE - precedence level SIP:Resource-Priority - q735   2.7
mlpp_network_identity  N/A N/A Q763: 'MLPP precedence' IE - network identity N/A   2.7
mlpp_service_domain N/A N/A Q763: 'MLPP precedence' IE - MLPP service domain N/A   2.7
called_isub  Q931: 'Called party subaddress' IE - subaddress information N/A Q763: 'Access transport' IE - Q931: 'Called party subaddress' IE - subaddress information SIP:To - isub parameter   2.7
called_isub_type Q931: 'Called party subaddress' IE - type of subaddress N/A Q763: 'Access transport' IE - Q931: 'Called party subaddress' IE - type of subaddress SIP:To - isub-encoding parameter   2.7
calling_isub  Q931: 'Calling party subaddress' IE - subaddress information N/A Q763: 'Access transport' IE - Q931: 'Calling party subaddress' IE - subaddress information SIP:From - isub   2.7
calling_isub_type Q931: 'Callinf party subaddress' IE - type of subaddress N/A Q763: 'Access transport' IE - Q931: 'Calling party subaddress' IE - type of subaddress SIP:From - isub-encoding   2.7
ss7_fci_default  N/A N/A Default forward call indicator (FCI) value. N/A SmartMediapack will overwrite FCI bits A, D, F, I and M with appropriate values according to call conditions 2.7
ss7_fci_force_mask  N/A N/A Mask to select bits from ss7_fci_default that must be forced. N/A Bits from ss7_fci_default which corresponding bit in ss7_fci_force_mask is set will be forced, and no more controlled by SmartMediapack 2.7
ss7_bci_default  N/A N/A Default backward call indicator (BCI) value. N/A SmartMediapack will overwrite BCI bits AB, I, K, M and N with appropriate values according to call conditions 2.7
ss7_bci_force_mask  N/A N/A Mask to select bits from ss7_bci_default that must be forced. N/A Bits from ss7_bci_default which corresponding bit in ss7_bci_force_mask is set will be forced, and no more controlled by SmartMediapack 2.7
tdm_ls_name

(Line Service or T1/E1 trunk) 

Incoming leg line service name Incoming leg line service name Incoming leg line service name N/A (read-only) 2.7
tdm_timeslot_nb Incoming leg timeslot number Incoming leg timeslot number Incoming leg timeslot number N/A (read-only) 2.7
rtp_local_addr N/A N/A N/A Incoming leg local SDP IP address (read-only) 2.7
rtp_local_port N/A N/A N/A Incoming leg local SDP IP port (read-only) 2.7
rtp_remote_addr N/A N/A N/A Incoming leg remote SDP IP address (read-only) 2.7
rtp_remote_port N/A N/A N/A Incoming leg remote SDP IP port (read-only) 2.7
ss7_cot_enabled  N/A N/A Requests SS7 in-call continuity test for this outgoing SS7 call N/A SmartMediapack will request continuity test on the timeslot before making the outgoing call. If COT fails, the call will be dropped (then another route may be attempted) 2.8
reverse_charging_indication Incoming leg Reverse charging indication IE present N/A N/A N/A If set in routing script, will add Reverse charging indication IE in outgoing leg (also use reverse_charging_indication_forward_enabled) 2.8.12
reverse_charging_indication_forward_enabled N/A N/A N/A N/A Enable forwarding of reverse charging indication from incoming to outgoing leg 2.8.12
sip_local_addr N/A N/A N/A Incoming leg local SIP IP address (read-only) 2.8.13
sip_local_port N/A N/A N/A Incoming leg local SIP UDP port (read-only) 2.8.13
sip_remote_addr N/A N/A N/A Incoming leg remote SIP IP address (read-only) 2.8.13
sip_remote_port N/A N/A N/A Incoming leg remote SIP UDP port (read-only) 2.8.13

Notice: All values are documented in the noa_npi_remap.rb script and may change between major release.

 

Noa values

  • unknown_number (0x2)
  • international_number (0x4)
  • national_number (0x3)
  • subscriber_number (0x1)
  • network_specific (0x5)
  • network_routing_national_format (0x7)
  • network_routing_international_format (0x8)
  • abbreviated_number (0x6)
  • subscriber_number_operator_requested (0x71)
  • national_number_operator_requested (0x72)
  • international_number_operator_requested (0x73)
  • no_number_present_operator_requested (0x74)
  • no_number_present_cut_through_call_to_carrier (0x75)
  • test_line_test_code (0x77)
  • non_unique_subscriber_number (0x71)
  • non_unique_national_number (0x73)
  • non_unique_international_number (0x74)
  • call_950_numbe (0x76)
  • special_number (0x73)
  • national_number_with_transit_network_selection (0x74)
  • international_number_with_transit_network_selection (0x75)

Those values will be remapped to the protocol specific NOA value. To provide protocol specific value:

call_params[:called_noa] = 0x70

or

call_params[:called_noa] = 112

 

Npi values

  • unknown_number
  • isdn
  • telephony
  • private
  • data
  • telex
  • national

 

Calling Display Type values

  • unspecified => Type is unspecified.
  • calling_party_name => Type is 0xB1.

Those values will be remapped to the protocol specific Display Information Type value. To provide protocol specific value:

call_params[:calling_display_type] = 0xB1

or

call_params[:calling_display_type] = 177

 

Calling Display value

call_params[:calling_display] = "John Doe"

 

Presentation values for Calling number, Calling Subscriber (Generic Number), Redirecting Number, Original Called Number (OCN) and Location Number

  • unspecified
  • not_available (0x2)
  • allowed (0x0)
  • restricted (0x1)
  • addr_restricted
  • name_restricted

Calling Party Category

values for calling_category

  • unspecified (0xa)
  • unknown (0x0)
  • operator_french (0x1)
  • operator_english (0x2)
  • operator_german (0x3)
  • operator_russian (0x4)
  • operator_spanish (0x5)
  • subscriber (0xa)
  • subscriber_with_priority (0xb)
  • data (0xc)
  • test (0xd)
  • payphone (0xf)

 

Screening values for Calling number, Calling Subscriber (Generic Number), and Location Number

  • unspecified
  • no (0x0)
  • pass (0x1)
  • fail (0x2)
  • network_provided (0x3)

 

Redirecting indicator values

SS7:

  • no_redirection
  • call_rerouted
  • call_rerouted_all_restricted
  • call_diverted
  • call_diverted_all_restricted
  • call_rerouted_restricted
  • call_diverted_restricted
  • spare

 

Redirecting number, Original Called Number and Diversion Reason

ISDN:

  • unknown
  • busy
  • no_reply
  • deflection
  • dte_out_of_order
  • forwarding_by_called_dte
  • unconditional

SS7:

  • unknown
  • busy (SIP: user-busy)
  • no_reply (SIP: no-answer)
  • unconditional
  • deflection
  • deflection_immediate
  • mobile_not_reachable

 

OLI (originating line information) values

The OLI parameter is a string that represents an integer value from 0 to 255.

 

Information Transfer Capability values

information_transfer_capability:

  • digital
  • restricted_digital
  • digital_with_tones
  • speech
  • 3_1_khz_audio

 

redirecting_number_forward_enabled values

Controls forwarding or discarding of redirecting number (SIP: diversion header) to outgoing call leg.

Values for this parameter are "0", "1", "false" or "true.

  • 0/false: Redirecting number (and original called number) is not forwarded to outgoing call leg
  • 1/true: Redirecting number (and original called number) is forwarded to outgoing call leg

The value for this parameter at input of routing script depends on the "Forward redirecting number" parameter in the "Advanced" section of the Gateway configuration page of the Web Portal. The script may change this value to override the Gateway configuration.

Note: To "insert" a new redirecting number value on the outgoing leg, redirecting_number_forward_enabled must also be set to true.

 

request_uri

Enables access to the Request-Line URI.

For example, if the Request-Line is:

Request-Line: INVITE sip:123456@172.31.1.12:5060;user=phone;transport=udp SIP/2.0

Then the retrieved request_uri will be "sip:123456@172.31.1.12:5060;user=phone;transport=udp SIP/2.0". 

In the routing scripts, to retrieve only the called number, this script can be used:

    if call_params[:request_uri] && call_params[:request_uri] =~ /sip:(.*)@.*/
       call_params[:called] = $1
    end

 

request_uri_forward_enabled values

Controls forwarding or discarding of request uri to outgoing call leg.The request uri is the information in the "Request-Line:" of the SIP INVITE message.

Values for this parameter are "0", "1", "false" or "true. 

  • 0/false: Request uri is not forwarded to outgoing call leg 
  • 1/true: Request uri is forwarded to outgoing call leg 

The value for this parameter at input of routing script is always false. 

 

sip_header values

Contains a hash table of custom sip headers from the inbound call leg. Any custom sip header can be added to an outgoing call leg:

call[ :sip_header ] = {"P-my-custom-header"=>"value1", "P-my-custom-header2"=>"value2", "P-my-custom-header3"=>"value3"}

 

List of sip headers that will not appear in call[:sip_header] since they are already processed by the SIP stack:

Accept               Error-Info             Remote-Party-ID      
Accept-Contact       Event                  Replaces                        
Accept-Encoding      Expires                Reply-To               
Accept-Language      From                   Request-Disposition    
Alert-Info           In-Reply-To            Subject          
Allow                Max-Forwards           Subscription-State  
Allow-Events         MIME-version           Supported           
Also                 Min-Expires            Timestamp           
Anonymity            Min-SE                 To             
Authorization        Organization           Unsupported  
Authentication-Info  Path                   User-Agent  
Call-ID              Priority               Via  
Call-Info            Privacy                Warning  
Contact              Proxy-Authenticate     WWW-Authenticate  
Content-Disposition  Proxy-Authorization    Require  
Content-Encoding     Proxy-Require          Response-Key  
Content-Language     P-Media-Authorization  Retry-After  
Content-Length       P-Preferred-Identity   RPID-Privacy  
Content-Type         P-Asserted-Identity    Route  
CSeq                 RAck                   RSeq  
RAck                 Reason                 Security-Client  
Reason               Record-Route           Security-Server  
Date                 Refer-To               Security-Verify
Diversion            Referred-By            Server
Encryption           Reject-Contact         Service-Route             
                                            Session-Expires

 

MLPP Precedence values

mlpp_look_for_busy:

  • allowed
  • path_reserved
  • not_allowed


mlpp_precedence_level:

  • flash_override
  • flash
  • immediate
  • priority
  • routine


mlpp_network_identity:

3 digits value from 0 to 999


mlpp_service_domain:

24 bits value from 0 to 16777215

 

ISUB subaddress information values

called_isub_type: calling_isub_type:

  • nsap
  • nsap_ia5
  • nsap_bcd
  • user


called_isub: calling_isub:

Digits for the subaddress information.

 

Route parameters

All route may have these parameters:

  • calling
  • called
  • nap
  • remapped_calling
  • remapped_called
  • remapped_nap
  • remapped_profile
  • remapped_incoming_profile

Example:

 route[:remapped_nap]

Additionally it is possible to add dynamic route attributes in the web portal. These can be referenced by their name.

 

Controlling UUI (user-to-user information) relay

UUI (user-to-user information) can be present in different messages received by either call leg during a call. For example, information can be carried during the initial invite, other information can be carried when the call is alerted, answered, or terminated.

Routing scripts can control if the UUI received from one leg through the call will be forwarded or not to the other call leg:

  • uui_forward_enabled

Routing scripts can also read and modify the UUI received with the incoming call leg, before it gets forwarded upon creation of the outgoing call leg:

  • uui

 

UUI (user-to-user indication) values

Byte array represented as ruby String. Use bridge=params[:bridge], then bridge[:uui] to access the data.

To access the bytes in Ruby, use ruby String operator []. For example: bridge[:uui][0] will return the binary value of the first UUI byte.

Function each_byte can also be useful to iterate through all bytes of the UUI.

 

uui_forward_enabled values

Controls forwarding or discarding of UUI to outgoing call leg.

Values for this parameter are "0", "1", "false" or "true.

  • 0/false: UUI is not forwarded between call legs
  • 1/true: UUI is forwarded between call legs

The value for this parameter at input of routing script depends on the "Forward UUI" parameter in the "Advanced" section of the Gateway configuration page of the Web Portal. The script may change this value to override the Gateway configuration.

 

Authorization

Starting with release 2.7, it is possible to issue RADIUS authorization requests from routing scripts. To do so, the params[:authorization] object must be filled with the required RADIUS attributes and an exception must be raised with reason :authorization_required.

When the authorization is completed, the routing script is called again with the result. The params[:authorization] object will be filled with the RADIUS attributes from the response. The params[:authorization][:result] field will also contain a string indicating the result of the authorization:

  • accept: The authorization was successful.
  • reject: The authorization was refused.
  • challenge: The authorization was challenged.
  • timeout: The authorization was not answered.

 

Call diversion options

It's possible to control the call flow when a call diversion information is received in the alerting state.

Two fields are available: bridge[ :diversion ] and bridge[ :diversion_reason ]

The internal release cause DIVERT_NOT_ALLOWED is used by gateway application to terminate both legs.

 bridge[ :diversion ] = :allowed

The alert message will not be analyzed and the call will be progressed. Default behavior.

 bridge[ :diversion ] = :not_allowed

If the alert message indicates that the call is diverted, the call will be released no matter the In-band information to allow early media.

 bridge[ :diversion ] = :not_allowed_w_early_media

The call will be released If the alert message indicates that the call is diverted with in-band information to allow early media.

 bridge[ :diversion_reason ] = "*"

If the diversion is not allowed, the gateway will drop the call for any redirecting reason.

 bridge[ :diversion_reason ] = []
 bridge[ :diversion_reason ] << :busy
 bridge[ :diversion_reason ] << :unconditional

If the diversion is not allowed, the redirecting reason will be analyzed and the call will only be dropped for the configured cases.

 

Call transfer requests

SmartMedia allows to relay Call transfer requests from one leg to the other, or to process them locally (making another outgoing call to replace the call that requested the call transfer).

If the chosen Call transfer mode is to process requests locally, upon reception of a call transfer request (SIP REFER or ISDN Facility), routing script will be called once again, to select the routes for the new outgoing call (call transfer target).

 

How to route call transfer request

Routing of a call transfer request is done exactly like routing of a normal incoming call. The routing script generally does not need any modification to support that.

In some cases, the routing script may want to use information related to the transfer request to perform routing, or to insert information in the outgoing call leg. Additional information is provided to the routing script, allowing routing decisions using information from the call transfer request (SIP REFER or ISDN Facility). See below.

 

params[ :call ] content during transfer request

When processing a call transfer request, the params[ :call ] hash contains the information from the inbound call (same as was passed to the routing script upon arrival of the inbound call)

call = params[ :call ]          -> Information from original inbound call, with exception of call[ :called ]

One exception (convenient because it allows a unmodified routing script to process call transfer request the same way as any other routing request):

call[ :called ]                 -> Replaced by the called number from the call transfer request (also called "redirection number")

Complementary information:

call[ :original_called_number ] -> Contains the called number that was initially received from the incoming call, prior to call transfer request
call[ :redirecting_number ]     -> Number of the call from which the call transfer request was received (generally equals to original_called_number)

These fields will also be included in the outgoing call made after routing:

  • original called number and redirecting number are existing fields on SS7 and ISDN calls
  • SIP "diversion" header is used for SIP calls

 

params[ :transfer ] content

(this if valid only for release 2.7.102 and above)
When processing a call transfer request, information from the call transfer request message (SIP REFER, ISDN Facility) is provided in params[ :transfer ]:

 transfer = params[ :transfer ]

The following field is always present:

 transfer[ :original_nap ]      -> Contains the NAP of the first call from which a call transfer request was received
 transfer[ :redirecting_nap ]   -> Contains the NAP of the call from which the current call transfer request was received
                                   (same as :original_nap for the first call transfer, different for subsequent transfers)

Examples of other fields that may be present, when appropriate:

 transfer[ :uui ]               -> The UUI (user-to-user information) found in the call transfer request
 transfer[ :sip_header ]        -> Contains custom SIP headers from the call transfer request
 transfer[ :request_uri ]       -> Contains the SIP Request URI

These fields are 'read-only'. They won't be included in the outgoing call, as they represent the content of the call transfer request, not the outgoing call to make.

To insert/modify attributes of the outgoing call, the parameters from params[ :call ] must be edited instead.

 

Redirection

In release 2.8, redirection contacts are obtained from the routing engine in the following format:

  • params[:contacts][:list] contains the contact log. Each contact within the list has the following fields:
    • :called_number - the called number
    • :is_number_ported - if the called number has been ported
    • :ported_number - the called number that was ported (if available)
    • :sip_uri - the SIP URI of the contact (if available)
    • :raw_data - the raw data representing the contact in the signaling protocol
    • :priority - the priority of the contact [0-1000]
    • :expiration - the expiration time in seconds of the contact
  • params[:contacts][:index] contains the index of the contact that is currently being routed.
  • params[:contacts][:source_indexes] contains a comma-separated list of indexes from params[:contacts][:list]. Each index represents the contact from which the contact in the list was obtained from. For instance: "nil,0,0,2"describes the following example contact hierarchy:
 * 1234 <sip:1234@test.com>
    |- 1234 <sip:1234@other.com>
    `- 5555 <sip:5555@test.com>
        `- 5555 <sip:5555@final.com>

 

Terminating calls

In release 2.8, it is now possible to terminate a call through the routing scripts. The reason code must be specified in params[:bridge][:reason]. The :terminate hash must be created and copied into params:

 terminate = {}
 params[:terminate] = terminate

The following fields can then be set in :terminate:

  • :sip_header
  • :contacts # list of contacts as described in the redirection section
  • :isup_raw
  • :isup_raw_variant
  • :redirecting_number
  • :redirecting_number_noa
  • :redirecting_number_npi
  • :redirecting_number_presentation
  • :redirecting_number_reason
  • :redirecting_number_counter
  • :redirecting_number_indicator
  • :original_called_number
  • :original_called_number_noa
  • :original_called_number_npi
  • :original_called_number_presentation
  • :original_called_number_reason
  • :original_called_number_counter

 

Reason values

You can check here for Termination Reason Cause codes in Web Portal 'Menu -> Profiles -> /profile name/ -> Reason Cause Mapping -> Edit Reason Cause Mapping' 

Example to refuse an incoming call leg.

 raise RoutingException, :no_route

Reason cause strings available inside routing scripts:

1. Q.850 reason causes:

 :unallocated_number
 :no_route_to_network
 :no_route_to_destination
 :send_special_tone
 :misdialled_trunk_prefix
 :channel_unacceptable
 :call_awarded_in_established_channel
 :preemption
 :reattempt
 :ported_number
 :normal_call_clearing
 :user_busy
 :no_user_responding
 :no_answer_from_user
 :subscriber_absent
 :call_rejected
 :number_changed
 :redirection
 :exchange_routing_error
 :non_selected_user_clearing
 :destination_out_of_order
 :address_incomplete
 :facility_rejected
 :response_to_status_enquiry
 :normal_unspecified
 :no_circuit_available
 :network_out_of_order
 :frame_mode_out_of_service
 :frame_mode_connection_operational
 :temporary_failure
 :switching_equipment_congestion
 :access_information_discarded
 :requested_circuit_not_available
 :precedence_call_blocked
 :resource_unavailable
 :quality_of_service_not_available
 :requested_facility_not_subscribed
 :outgoing_calls_barred
 :outgoing_calls_barred_within_cug
 :incoming_calls_barred
 :incoming_calls_barred_within_cug
 :bearer_cap_not_authorized
 :bearer_cap_not_available
 :inconsistency_access_info
 :service_not_available
 :bearer_cap_not_implemented
 :channel_type_not_implemented
 :requested_facility_not_implemented
 :only_restricted_digital_info
 :service_not_implemented
 :invalid_call_reference
 :channel_does_not_exist
 :call_identity_does_not_exist
 :call_identity_in_use
 :no_call_suspended
 :call_has_been_cleared
 :user_not_member_of_cug
 :incompatible_destination
 :non_existant_cug
 :invalid_transit_network
 :invalid_message_unspecified
 :mandatory_ie_missing
 :message_type_non_existent
 :not_compatible_with_call_state
 :ie_non_existent
 :invalid_ie_content
 :message_not_compatible
 :recovery_on_timer_expiry
 :parameter_non_existent_passed_on
 :msg_with_non_recognized_param_discarded
 :protocol_error
 :interworking_unspecified

2. SmartMedia reason causes:

 :normal
 :resource_error
 :timeout
 :no_route
 :call_collision
 :sync_drop
 :signaling_error
 :locally_rejected
 :interface_not_available
 :reset_in_progress
 :adapter_reject
 :missing_or_invalid_ie
 :incoming_only
 :system_configuration_changed
 :resource_no_more_available
 :incompatible_media
 :resource_allocation_failed
 :data_path_not_available
 :local_congestion
 :authorization_required
 :call_divert_is_not_allowed

3. SIP reason causes:
Reason causes starting with a digit must use the following syntax (can't use : as prefix).

 '400_bad_request'
 '401_unauthorized'
 '402_payment_required'
 '403_forbidden'
 '404_not_found'
 '405_method_not_allowed'
 '406_not_acceptable'
 '407_proxy_authentication_required'
 '408_request_timeout'
 '409_conflict'
 '410_gone'
 '413_request_entity_too_large'
 '414_request_URI_too_long'
 '415_unsupported_media'
 '416_unsupported_URI_scheme'
 '420_bad_extension'
 '421_extension_required'
 '422_session_timer_too_small'
 '423_interval_too_brief'
 '429_referrer_identity_error'
 '480_temporary_unavailable'
 '481_call_or_transaction_does_not_exist'
 '482_loop_detected'
 '483_too_many_hops'
 '484_address_incomplete'
 '485_ambiguous'
 '486_busy_here'
 '487_request_terminated'
 '488_not_acceptable_here'
 '489_bad_event'
 '491_retry_after'
 '500_server_internal_error'
 '501_not_implemented'
 '502_bad_gateway'
 '503_service_unavailable'
 '504_server_timeout'
 '505_version_unsupported'
 '513_message_too_large'
 '600_busy_everywhere'
 '603_decline'
 '604_not_exist_anywhere'
 '606_not_acceptable'

 

Nap status

All of the below NAP status fields are provided to be used by the routing scripts:

Notice: These values may change between major releases.

 Routing script call attribute name    Description
 --------------------------------------------------------------------------------------------
 "signaling_type"                      Signaling type.
 "inst_incoming_call_cnt"              Instantaneous Count of incoming calls.
 "inst_outgoing_call_cnt"              Instantaneous Count of outgoing calls.
 "available_cnt"                       Number of available circuits or channels.
 "unavailable_cnt"                     Number of unavailable circuits or channels.
 "availability_percent"                Percentage of available circuits or channels.
 "usage_percent"                       Percentage of used circuits or channels.
 "unused_shared_percent"               Percentage of used circuits or channels of this NAP available to make new calls with (taking into account shared with other NAPs)
 "total_incoming_call_cnt"             Total Count of incoming calls.
 "asr_statistics_struct"               Detailed Answer-Seizure Rate Statistics.
 "global_asr_percent"                  Global calculated ASR percentage.
 "total_outgoing_call_cnt"             Total Count of outgoing calls.
 "last_24h_asr_percent"                Last 24 hours calculated ASR percentage.
 "last_24h_outgoing_call_cnt"          Last 24 hours outgoing calls.
 "current_hour_asr_percent"            Current hour calculated ASR percentage.
 "current_hour_outgoing_call_cnt"      Current hour outgoing calls.
 "last_hour_asr_percent"               Last hour calculated ASR percentage.
 "last_hour_outgoing_call_cnt"         Last hour outgoing calls.
 "availability_detection_struct"       Detailed availibility detection Statistics
 "poll_remote_proxy"                   Remote proxy polling enabled
 "is_available"                        Remote proxy actually available or not
 "time_since_polling"                  Time since the last availibility polling
 "time_available_seconds"              Number of seconds since the NAP is available
 "time_unavailable_seconds"            Number of seconds since the NAP is unavailable
 "registration_struct"                 Detailed registration Statistics
 "register_to_proxy"                   Register to proxy enabled
 "registered"                          Actually registered or not
 "time_since_refresh"                  Time since the last refresh
 "time_registered_seconds"             Number of seconds since the NAP is registered
 "time_not_registered_seconds"         Number of seconds since the NAP is not registered
 


If the nap status is part of a substructure, it's name in the routing scripts must be composed of the structure name appended by an underscore and the field name.

For example the name to use for the global ASR percentage is:

 asr_statistics_struct_global_asr_percent


It is also possible to add dynamic nap attributes in the web portal. These can be referenced by their name.

 

Routing Script Tests

The Web portal features a tool for script testing. User must enter parameters to simulate the incoming call. Test is commenced by pressing "Test" button and as result an output of selected routes and numbers will be presented. You do not need to activate the new routes, or the new scripts to use this test tool. It can be used to test the routing scripts and routing table before activating it, as long as you are using the modified configuration context. Tool is available in the Routing Scripts section of the Web portal.

 

Test parameters

@call_params

Vvariable should contain a hash of call parameters that will passed to the routing script. This is equivalent to the incoming call parameters.

 

@nap_list

A list of hash containing the nap statuses. This is equivalent to the nap statuses at the time the call is to be routed.

The nap list is hashed by the nap names in UPPERCASE. It is important to consider this when creating new dynamic route or nap attributes that may nap names that will be used to fetch a status.

 

@params

A hash of hashes containing parameters. This hash contains bridge parameters and other kind of parameter groups may be added in the future.

Example: @params = {:bridge => {:announcement_tone, "announcement.wav"}}

 

 

(1853 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).