Actions

Routing script tutorial:Mini Development Guide: Difference between revisions

No edit summary
 
(435 intermediate revisions by 18 users not shown)
Line 1: Line 1:
== Call object  ==
{{DISPLAYTITLE:Routing Script Tutorial: Development Guide}}


=== Get  ===


Those function are used to get the call parameters. The possible parameters are described in the section "Call parameters"
==Introduction==
This Routing Script Tutorial provides you with essential information in managing the routing of your calls. Consult the sections below to learn more.


  called_number = caf_call.get :called
{| class="wikitable"


=== List_params  ===
|[[File:NoteIcon.png|100px]]|| An alternate version of this guide for routing scripts is available. [[Routing script tutorial|Consult it to enhance your learning.]]
 
This function is used to retrieve the list of supported call parameters. For example to extract all the possible call params from the the call object and put it in hash.
 
  caf_call.list_params.each {|param| call[param] = caf_call.get param }
 
=== Accept  ===
 
This function is used to accept a call. It takes 2 arguments, the call parameters (hash) and the route parameters (hash).
 
Apply route remapping rules
 
  caf_call.accept out_call, route
 
=== Refuse  ===
 
This function is used to refuse a call with a reason code argument parameters :  
 
  caf_call.refuse :reason => :temporary_failure
 
The supported values are described in the section "Reason values".
 
=== Script parameters protocol mapping  ===
 
The following call parameters are available in the call object:
 
{| cellspacing="1" cellpadding="1" border="1" style="width: 921px; height: 805px;"
|-
! scope="col" | '''Script parameter name'''
! scope="col" | '''ISDN<br>'''
! scope="col" | '''R2 CAS'''<br>
! scope="col" | '''SS7<br>'''
! scope="col" | '''SIP<br>'''
! scope="col" | '''Comment<br>'''
|-
| calling<br>
| Q931: 'Calling party number' IE - Number digits <br>
| ANI (Group B)<br>
| Q763: 'Calling party number' IE - address signals (*)<br>
| SIP:From - user-info<br>
| * In ANSI SS7 LNP networks, the IE 'generic address parameter' is used (when present) instead.<br>
|-
| calling_noa<br>
| Q931: 'Calling party number' IE - Type of number<br>
| N/A<br>
| Q763: 'Calling party number' IE - nature of address indicator (*)<br>
| N/A<br>
| * In ANSI SS7 LNP networks, the IE 'generic address parameter' is used (when present) instead<br>
|-
| calling_npi <br>
| Q931: 'Calling party number' IE - Numbering plan identification<br>
| N/A<br>
| Q763: 'Calling party number' IE - numbering plan indicator (*)<br>
| N/A<br>
| * In ANSI SS7 LNP networks, the IE 'generic address parameter' is used&nbsp;(when present) instead<br>
|-
| calling_display <br>
| Q931: 'Display' IE - Display information<br>
| N/A<br>
| Q763: 'Display information' IE - display information<br>
| SIP:From - display-name<br>
| <br>
|-
| calling_display_type<br>
| Q931: 'Display' IE - Display information (present and/or first byte)<br>
| N/A<br>
| Q763: 'Display information' IE - present or not<br>
| N/A<br>
| <br>
|-
| calling_presentation <br>
| Q931: 'Calling party number' IE - Presentation indicator<br>
| N/A<br>
| Q763: 'Calling party number' IE - address presentation restricted indicator<br>
|
SIP:From - display-name (displays 'anonymous' or not)
 
SIP:Remote-party-id - privacy<br>
 
| <br>
|-
| calling_screening<br>
| Q931: 'Calling party number' IE - Screening indicator<br>
| N/A<br>
| Q763: 'Calling party number' IE - screening<br>
| SIP:Remote-party-id - screen<br>
| <br>
|-
| calling_category<br>
| N/A<br>
| Call party category (Group A)<br>
| Q763: 'Calling party's category' IE - calling party's category<br>
|
SIP:From - cpc
 
SIP:P-asserted-identity - cpc<br>
 
| <br>
|-
| private_display<br>
| N/A<br>
| N/A<br>
| N/A<br>
|
SIP:P-asserted-identity - display-name<br>
 
SIP:Remote-party-id - display-name<br>
 
| <br>
|-
| private_display_type <br>
| N/A<br>
| N/A<br>
| N/A<br>
| N/A<br>
| Indicate presence or not of the private calling information<br>
|-
| private_address<br>
| N/A<br>
| N/A<br>
| N/A<br>
|
SIP:P-asserted-identity - userinfo
 
SIP:Remote-party-id - user-info<br>
 
| <br>
|-
| called <br>
| Q931: 'Called party number' IE - Number digits <br>
| DNIS (Group A)<br>
| Q763: 'Called party number' IE - address signals<br>
| SIP:To - user-info and host<br>
| <br>
|-
| called_noa <br>
| Q931: 'Called party number' IE - Type of number<br>
| N/A<br>
| Q763: 'Called party number' IE - nature of address indicator<br>
| N/A<br>
| <br>
|-
| called_npi <br>
| Q931: 'Called party number' IE - Numbering plan identification<br>
| N/A<br>
| Q763: 'Called party number' IE - numbering plan indicator<br>
| N/A<br>
| <br>
|-
| charge_number<br>
| N/A<br>
| N/A<br>
| ANSI: 'Charge number' IE - address signals<br>
| N/A<br>
| <br>
|-
| charge_number_noa <br>
| N/A<br>
| N/A<br>
| ANSI: 'Charge number' IE - nature of address indicator<br>
| N/A<br>
| <br>
|-
| charge_number_npi<br>
| N/A<br>
| N/A<br>
| ANSI: 'Charge number' IE - numbering plan indicator<br>
| N/A<br>
| <br>
|-
| redirecting_number_forward_enabled <br>
| N/A<br>
| N/A<br>
| N/A<br>
| N/A<br>
| Overwrite default redirecting number forwarding behavior from incoming to outgoing leg <br>
|-
| redirecting_number <br>
| Q931: 'Redirecting number' 1st IE - Number digits <br>
| N/A<br>
| Q763: 'Redirecting number' IE - address signals<br>
| SIP:Diversion (2nd header) - display-name<br>
| <br>
|-
| redirecting_number_noa <br>
| Q931: 'Redirecting number'&nbsp;1st IE - Type of number<br>
| N/A<br>
| Q763: 'Redirecting number' IE - nature of address indicator<br>
| N/A<br>
| <br>
|-
| redirecting_number_npi <br>
| Q931: 'Redirecting number' 1st IE - Numbering plan identification<br>
| N/A<br>
| Q763: 'Redirecting number' IE - numbering plan indicator<br>
| N/A<br>
| <br>
|-
| redirecting_number_presentation <br>
| Q931: 'Redirecting number' 1st IE - Presentation indicator <br>
| N/A<br>
| Q763: 'Redirecting number' IE - address presentation restricted indicator<br>
| SIP:Diversion&nbsp;(2nd header) - diversion-privacy<br>
| <br>
|-
| redirecting_number_screening <br>
| Q931: 'Redirecting number' 1st IE - Screening indicator<br>
| N/A<br>
| Q763: 'Redirecting number' IE - screening (national)<br>
| SIP:Diversion (2nd header) - diversion-screen<br>
| <br>
|-
| redirecting_number_reason <br>
| Q931: 'Redirecting number' 1st IE - Reason for redirection<br>
| N/A<br>
| Q763: 'Redirection information' IE - redirecting reason<br>
| SIP:Diversion (2nd header) - diversion-reason<br>
| <br>
|-
| redirecting_number_counter <br>
| N/A<br>
| N/A<br>
| Q763: 'Redirection information' IE - redirection counter<br>
| SIP:Diversion (2nd header) - diversion-counter<br>
| <br>
|-
| original_called_number <br>
| Q931: 'Redirecting number' 2nd IE - Number digits <br>
| N/A<br>
| Q763: 'Redirection number' IE - address signals<br>
| SIP:Diversion&nbsp; (1st header) - display-name<br>
| <br>
|-
| original_called_number_noa <br>
| Q931: 'Redirecting number' 2nd IE - Type of number<br>
| N/A<br>
| Q763: 'Redirection number' IE - nature of address indicator<br>
| N/A<br>
| <br>
|-
| original_called_number_npi <br>
| Q931: 'Redirecting number' 2nd IE - Numbering plan identification<br>
| N/A<br>
| Q763: 'Redirection number' IE - numbering plan indicator<br>
| N/A<br>
| <br>
|-
| original_called_number_presentation <br>
| Q931: 'Redirecting number' 2nd IE - Presentation indicator <br>
| N/A<br>
| Q763: 'Redirection number' IE - address presentation restricted indicator<br>
| SIP:Diversion (1st header) - diversion-privacy<br>
| <br>
|-
| original_called_number_screening <br>
| Q931: 'Redirecting number' 2nd IE - Screening indicator<br>
| N/A<br>
| Q763: 'Redirection number' IE - screening (national)<br>
| SIP:Diversion (1st header) - diversion-screen<br>
| <br>
|-
| original_called_number_reason <br>
| Q931: 'Redirecting number' 2nd IE - Reason for redirection<br>
| N/A<br>
| Q763: 'Redirection information' IE - original redirection reason<br>
| SIP:Diversion (1st header) - diversion-reason<br>
| <br>
|-
| original_called_number_counter <br>
| N/A<br>
| N/A<br>
| N/A<br>
| SIP:Diversion (1st header) - diversion-counter<br>
| <br>
|-
| ported_number <br>
| N/A<br>
| N/A<br>
| Q763: 'Called party number' IE - address signals<br>
| SIP:RequestURI - rn<br>
| Only valid if SIP/SS7 supports LNP<br>
|-
| ported_number_noa <br>
| N/A<br>
| N/A<br>
| Q763: 'Called party number' IE - nature of address indicator<br>
| N/A<br>
| Only valid if SIP/SS7 supports LNP<br>
|-
| ported_number_npi <br>
| N/A<br>
| N/A<br>
| Q763: 'Called party number' IE - numbering plan indicator<br>
| N/A<br>
| Only valid if SIP/SS7 supports LNP<br>
|-
| oli <br>
| 5ESS Codeset 6 OLI - Value<br>
| N/A<br>
| ANSI: 'Originating line information' IE - OLI<br>
|
SIP:From - oli
 
SIP:P-asserted-identity - oli<br>
 
| <br>
|-
| request_uri <br>
| N/A<br>
| N/A<br>
| N/A<br>
| Complete Request URI string<br>
| <br>
|-
| request_uri_forward_enabled <br>
| N/A<br>
| N/A<br>
| N/A<br>
| N/A<br>
| Overwrite default URI&nbsp;forwarding behavior from incoming to outgoing leg<br>
|-
| sip_header<br>
| N/A<br>
| N/A<br>
| N/A<br>
| Any header<br>
| Outgoing leg (write) only <br>
|-
| nap<br>
| N/A<br>
| N/A<br>
| N/A<br>
| N/A<br>
| Incoming leg NAP name (read-only)<br>
|}
|}


<br>
==Accessing Routing Script Parameters ==
 
[[Routing Script Tutorial: Accessing Routing Script Parameters|Learn how to access routing script parameters.]]
'''Notice:''' All values are documented in the '''noa_npi_remap.rb''' script and may change between major release.
 
=== Noa values  ===
 
*<tt>unknown_number</tt>
*<tt>international_number</tt>
*<tt>national_number</tt>
*<tt>subscriber_number</tt>
*<tt>network_specific</tt>
*<tt>network_routing_national_format</tt>
*<tt>network_routing_international_format</tt>
*<tt>abbreviated_number</tt>
*<tt>subscriber_number_operator_requested</tt>
*<tt>national_number_operator_requested</tt>
*<tt>international_number_operator_requested</tt>
*<tt>no_number_present_operator_requested</tt>
*<tt>no_number_present_cut_through_call_to_carrier</tt>
*<tt>test_line_test_code</tt>
*<tt>non_unique_subscriber_number</tt>
*<tt>non_unique_national_number</tt>
*<tt>non_unique_international_number</tt>
*<tt>call_950_number</tt>
 
Those values will be remapped to the protocol specific NOA value. To provide protocol specific value:
 
*<tt>call_params[:called_noa] = 0x70</tt>
 
or
 
*<tt>call_params[:called_noa] = 112</tt>
 
=== Npi values  ===
 
*<tt>unknown_number</tt>
*<tt>isdn</tt>
*<tt>telephony</tt>
*<tt>private</tt>
*<tt>data</tt>
*<tt>telex</tt>
*<tt>national</tt>
 
=== Calling Display Type values  ===
 
*<tt>unspecified</tt> =&gt; Type is unspecified.
*<tt>calling_party_name</tt> =&gt; Type is 0xB1.
 
Those values will be remapped to the protocol specific Display Information Type value. To provide protocol specific value:
 
*<tt>call_params[:calling_display_type] = 0xB1</tt>
 
or
 
*<tt>call_params[:calling_display_type] = 177</tt>
 
=== Calling Display value  ===
 
*<tt>call_params[:calling_display] = "Roger Fluffy"</tt>
 
=== Presentation values  ===
 
*<tt>unspecified</tt>
*<tt>not_available</tt>
*<tt>allowed</tt>
*<tt>restricted</tt>
*<tt>addr_restricted</tt>
*<tt>name_restricted</tt>
 
=== Screening values  ===
 
*<tt>unspecified</tt>
*<tt>no</tt>
*<tt>pass</tt>
*<tt>fail</tt>
*<tt>network_provided</tt>
 
=== Redirecting number reason values  ===
 
ISDN:
 
*<tt>unknown</tt>
*<tt>busy</tt>
*<tt>no_reply</tt>
*<tt>deflection</tt>
*<tt>dte_out_of_order</tt>
*<tt>forwarding_by_called_dte</tt>
*<tt>unconditional</tt>
 
SS7:
 
*<tt>unknown</tt>
*<tt>busy</tt>
*<tt>no_reply</tt>
*<tt>unconditional</tt>
*<tt>deflection</tt>
*<tt>deflection_immediate</tt>
*<tt>mobile_not_reachable</tt>
 
=== OLI (originating line information) values  ===
 
The OLI parameter is a string that represents an integer value from 0 to 255.
 
<br>
 
=== 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.
 
<br>
 
=== request_uri  ===
 
Enables access to the Request-Line URI.<br>
 
For example, if the Request-Line is:
<pre>Request-Line: INVITE sip:4175162082@172.22.45.13:5060;user=phone;transport=udp SIP/2.0</pre>
Then the retrieved request_uri will be "sip:4175162082@172.22.45.13:5060;user=phone;transport=udp SIP/2.0". <br>
 
In the routing scripts, to retrieve only the called number, this script can be used:<br>
<pre>    if call_params[:request_uri] &amp;&amp; call_params[:request_uri] =~ /sip:(.*)@.*/
      call_params[:called] = $1
    end
</pre>
=== 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.<br>
 
Values for this parameter are "0", "1", "false" or "true. <br>
 
0/false: Request uri is not forwarded to outgoing call leg <br>
 
1/true: Request uri is forwarded to outgoing call leg <br>
 
The value for this parameter at input of routing script is always false. <br>
 
== Route parameters  ==
 
All route may have these parameters:
 
*calling
*called
*nap
*remapped_calling
*remapped_called
*remapped_nap
*remapped_profile
 
Additionally it is possible to add dynamic route attributes in the web portal. These can be referenced by their name.
 
== Playing Prompts in Calls (Bridge parameters)  ==
 
New feature in release 2.6, all bridges may have these parameters. These can be used to play IVR prompts or wav files in different states of the call flow, like playing an announcement when the caller dials in. You can also manage the User to User information element.
 
*announcement_tone
*call_progress_tone
*ring_tone
*max_call_duration
*call_duration_reason
*disconnect_tone
*uui
*uui_forward_enabled
 
The following sections show how to access those different parameters from inside a filter.  The 'params' hash is the sole argument passed to a filter function and contains call, nap, route and bridge parameters.  This hash is created by the base_routing.rb scripts to regroup all relevant information just before calling the filter functions.
 
=== Tone string format  ===
 
All tone strings (:announcement_tone,&nbsp;:call_progress_tone,&nbsp;:ring_tone,&nbsp;:disconnect_tone) inside bridge parameters are using this format.
<pre>"file1.wav:repeat:start_off:end_off,file2.wav:repeat:start_off:end_off,file3.wav:repeat:start_off:end_off"
</pre>
optional repeat parameter: number of times to play the file (0 and 1 have the same result) <br>optional start_off parameter&nbsp;: Start offset in milliseconds <br>optional end_off parameter: End offset in milliseconds <br> <br>Example: "file1.wav,file2.wav:-1" will play file1.wav one time and then play file2.wav in loop. <br>Example: "file1.wav:0:1000:3000,file2.wav:2:5000:10000" will play file1.wav from second 1 to second 3 then file2.wav from second 5 to second 10 two times. <br>Example: "file1.wav:0:0:30000" will play file1.wav one time for a max duration of 30 seconds.
 
=== announcement_tone  ===
 
params[:bridge][:announcement_tone] = "announcement.wav"
 
Prompt played on the incoming leg with the stream_server before any outgoing call is placed. The outgoing call occurs when the wav file is completed or when the "profile:Busy Tone max duration" is reached.
 
=== call_progress_tone  ===
 
params[:bridge][:call_progress_tone] = "no_route.wav"
 
Prompt played after "announcement_tone" when reason is not "ok" or when outgoing call disconnect before answer state. <br>"none" value is used to bypass "profile:Generate Busy (Congestion) Tone" and to play no audio prompt.
 
=== ring_tone  ===
 
params[:bridge][:ring_tone] = "ringing.wav"
 
Prompt played between alerting state and answer state. Bypass any other ring back tone (RBT) configured in profile.  
 
=== max_call_duration  ===
 
params[:bridge][:max_call_duration] = "60000"
 
Maximum call duration in millisecond for the current bridge. This timer is started when entering answer state.
 
=== call_duration_reason  ===
 
params[:bridge][:call_duration_reason] =&nbsp;:resource_unavailable
 
Drop both legs with this reason when call duration (:max_call_duration) is reached.
 
=== disconnect_tone  ===
 
params[:bridge][:disconnect_tone] = "max_duration.wav"
 
Prompt played (on the incoming leg only) when call duration (:max_call_duration) is reached before terminating the leg with call duration reason (:call_duration_reason).
 
=== UUI (user-to-user indication) values  ===
 
Byte array represented as ruby String. Use ''bridge=params[:bridge], bridge.get(:uui).each_byte'' to access the data in case the UUI contains non printable character.
 
=== 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 to outgoing call leg 1/true: UUI is forwarded to outgoing call leg 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.
 
== Reason values  ==
 
Check here for Termination Reason Cause codes:<br>
 
[http://docs.telcobridges.com/mediawiki/index.php/Termination_cause_codes Termination Reason Cause codes]
<br>
 
== Nap status  ==
 
All the status fields of the NAPs are provided for use by the routing scripts. See the nap status provider for more details on which fields are available in the CEngineStatTransNap.hpp file.


'''Notice:''' These values may change between major release.  
==Routing Script Parameter Mapping Table==
[[Routing Script Parameter Mapping Table|Learn how each Routing Script Parameter maps to varying protocols.]]


  #define NAP_STATS_FIELDS \
==Script Parameters Definition==
    /* Field,                                szName,                            szDescription,                                        szOptions */ \
[[Routing Script Tutorial: Script Parameters Definition|Learn about the definition of each script parameter.]]
    ( SIGNALING_TYPE,                        "signaling_type",                  "Signaling type.",                                    "" ) \
    ( INCOMING_CALL_CNT,                      "inst_incoming_call_cnt",          "Instantaneous Count of incoming calls.",            "" ) \
    ( OUTGOING_CALL_CNT,                      "inst_outgoing_call_cnt",          "Instantaneous Count of outgoing calls.",            "" ) \
    ( AVAILABLE_CNT,                          "available_cnt",                  "Number of available circuits or channels.",          "" ) \
    ( UNAVAILABLE_CNT,                        "unavailable_cnt",                "Number of unavailable circuits or channels.",        "" ) \
    ( AVAILABILITY_PCT,                      "availability_percent",            "Percentage of available circuits or channels.",      "" ) \
    ( USAGE_PCT,                              "usage_percent",                  "Percentage of used circuits or channels.",          "" ) \
    ( TOTAL_INCOMING_CALL_CNT,                "total_incoming_call_cnt",        "Total Count of incoming calls.",                    "" ) \
    ( ASR_STRUCT,                            "asr_statistics_struct",          "Detailed Answer-Seizure Rate Statistics.",          "" ) \
      ( GLOBAL_ASR_PCT,                      "global_asr_percent",              "Global calculated ASR percentage.",                  "" ) \
      ( TOTAL_OUTGOING_CALL_CNT,              "total_outgoing_call_cnt",        "Total Count of outgoing calls.",                    "" ) \
      ( LAST_24H_ASR_PCT,                    "last_24h_asr_percent",            "Last 24 hours calculated ASR percentage.",          "" ) \
      ( LAST_24H_OUTGOING_CALL_CNT,          "last_24h_outgoing_call_cnt",      "Last 24 hours outgoing calls.",                      "" ) \
      ( HOUR_ASR_PCT,                        "current_hour_asr_percent",        "Current hour calculated ASR percentage.",            "" ) \
      ( HOUR_OUTGOING_CALL_CNT,              "current_hour_outgoing_call_cnt",  "Current hour outgoing calls.",                      "" ) \
      ( LAST_HOUR_ASR_PCT,                    "last_hour_asr_percent",          "Last hour calculated ASR percentage.",              "" ) \
      ( LAST_HOUR_OUTGOING_CALL_CNT,        "last_hour_outgoing_call_cnt",    "Last hour outgoing calls.",                          "" ) \
    ( AVAILABILITY_DETECTION_STRUCT,          "availability_detection_struct",  "Detailed availibility detection Statistics",        "" ) \
      ( POLL_REMOTE_PROXY,                    "poll_remote_proxy",              "Remote proxy polling enabled",                      "" ) \
      ( IS_AVAILABLE,                        "is_available",                    "Remote proxy actually available or not",            "" ) \
      ( TIME_SINCE_POLLING,                  "time_since_polling",              "Time since the last availibility polling",          "" ) \
      ( TIME_AVAILABLE_SECONDS,              "time_available_seconds",          "Number of seconds since the NAP is available",      "x" ) \
      ( TIME_UNAVAILABLE_SECONDS,            "time_unavailable_seconds",        "Number of seconds since the NAP is unavailable",    "x" ) \
    ( REGISTRATION_STRUCT,                    "registration_struct",            "Detailed registration Statistics",                  "" ) \
      ( REGISTER_TO_PROXY,                    "register_to_proxy",              "Register to proxy enabled",                          "" ) \
      ( IS_REGISTERED,                        "registered",                      "Actually registered or not",                        "" ) \
      ( TIME_SINCE_REFRESH,                  "time_since_refresh",              "Time since the last refresh",                        "" ) \
      ( TIME_REGISTERED_SECONDS,              "time_registered_seconds",        "Number of seconds since the NAP is registered",      "x" ) \
      ( TIME_NOT_REGISTERED_SECONDS,          "time_not_registered_seconds",    "Number of seconds since the NAP is not registered",  "x" ) \
    /*!&lt; Nap Status Fields */


<br> 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.  
==Script Parameters Definition for SIP==
[[Routing Script Tutorial: Script Parameters Definition for SIP|Learn about the definition of each script parameter for SIP.]]


For example the name to use for the global [[ASR]] percentage is:
==Registered Users Information==
[[Routing Script Tutorial: Registered Users Information|Learn how routing scripts access information about registered users.]]


  asr_statistics_struct_global_asr_percent
==Route Parameters and Call Routing==
[[Routing Script Tutorial: Route Parameters and Call Routing|Learn about the standard parameters used in a call and how they route to registered users.]]


<br> It is also possible to add dynamic nap attributes in the web portal. These can be referenced by their name.  
==Playing prompts announcements or tones==
[[Routing Script Tutorial: Playing prompts announcements and tones|Learn how to play all sorts of media files for call prompts, announcements, and tones.]]


== Test parameters  ==
==Recording==
[[Routing Script Tutorial: Recording|Learn how  to use routing scripts to record incoming and/or outgoing call legs.]]


=== @call_params ===
==User-to-User Information==
[[Routing Script Tutorial: User-to-User Information|Learn how to use User-to-User Information (UUI) in routing scripts.]]


That variable should contain a hash of call parameters that will passed to the routing script. This is equivalent to the incoming call parameters.  
==Radius Autorization==
[[Routing Script Tutorial: Radius Authorization|Learn how to send RADIUS authorization requests in routing scripts.]]


<br>
==ENUM Query==
[[Routing Script Tutorial: ENUM Query|Learn how to send ENUM Query requests to DNS servers in routing scripts.]]


=== @nap_list  ===
== DNS Query ==
[[Routing Script Tutorial: DNS Query|Learn how to send DNS Query requests to DNS servers in routing scripts.]]


A list of hash containing the nap statuses. This is equivalent to the nap statuses at the time the call is to be routed.  
== Call Diversion Options ==
[[Routing Script Tutorial: Call Diversion Options|Learn how control a call flow with diversion options.]]


'''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.  
== Call Transfer Requests ==
[[Routing Script Tutorial: Call Transfer Requests|Learn how to route call transfer requests.]]


<br>
== Redirection ==
[[Routing Script Tutorial: Redirection|Learn how to get redirection contacts.]]


=== @params  ===
== Connected Number ==
[[Routing Script Tutorial: Connected Number|Connected Number]]


A hash of hashes containing parameters. This hash contains bridge parameters and other kind of parameter groups may be added in the future.  
== Terminating Calls ==
[[Routing Script Tutorial: Terminating Calls|Learn how to terminate calls with routing scripts.]]


Example: @params = {:bridge => {:announcement_tone, "announcement.wav"}}
== NAP status and other NAP information ==
[[Routing Script Tutorial: NAP Status and other NAP Information|Learn how to use NAP status field in routing scripts.]]


<br>
== Telephony Services (CNAM Request over SS7)==
[[Routing Script Tutorial: CNAM Request|Learn how to manage CNAM requests over SS7.]]


----
== Custom User Context ==
[[Routing Script Tutorial: Custom User Context|Custom User Context]]


<br> Back to [[Routing script tutorial|Routing Script Tutorial]].
== Routing Script Tests ==
[[Routing Script Tutorial: Routing Script Tests|Learn how to use the Web Portal to test your routing scripts.]]

Latest revision as of 09:58, 9 May 2024


Hide TOC

Introduction

This Routing Script Tutorial provides you with essential information in managing the routing of your calls. Consult the sections below to learn more.

An alternate version of this guide for routing scripts is available. Consult it to enhance your learning.

Accessing Routing Script Parameters

Learn how to access routing script parameters.

Routing Script Parameter Mapping Table

Learn how each Routing Script Parameter maps to varying protocols.

Script Parameters Definition

Learn about the definition of each script parameter.

Script Parameters Definition for SIP

Learn about the definition of each script parameter for SIP.

Registered Users Information

Learn how routing scripts access information about registered users.

Route Parameters and Call Routing

Learn about the standard parameters used in a call and how they route to registered users.

Playing prompts announcements or tones

Learn how to play all sorts of media files for call prompts, announcements, and tones.

Recording

Learn how to use routing scripts to record incoming and/or outgoing call legs.

User-to-User Information

Learn how to use User-to-User Information (UUI) in routing scripts.

Radius Autorization

Learn how to send RADIUS authorization requests in routing scripts.

ENUM Query

Learn how to send ENUM Query requests to DNS servers in routing scripts.

DNS Query

Learn how to send DNS Query requests to DNS servers in routing scripts.

Call Diversion Options

Learn how control a call flow with diversion options.

Call Transfer Requests

Learn how to route call transfer requests.

Redirection

Learn how to get redirection contacts.

Connected Number

Connected Number

Terminating Calls

Learn how to terminate calls with routing scripts.

NAP status and other NAP information

Learn how to use NAP status field in routing scripts.

Telephony Services (CNAM Request over SS7)

Learn how to manage CNAM requests over SS7.

Custom User Context

Custom User Context

Routing Script Tests

Learn how to use the Web Portal to test your routing scripts.