Adding capture dtmf script: Difference between revisions
(Update) |
m (format and typo) |
||
| Line 1: | Line 1: | ||
=== '''''Applies to version(s): v2.9, v2.10, v3.0, v3.1''''' === | === '''''Applies to version(s): v2.9, v2.10, v3.0, v3.1''''' === | ||
{{DISPLAYTITLE:Adding Capture DTMF Script}} | {{DISPLAYTITLE:Adding Capture DTMF Script}} | ||
== Script | {| class="wikitable" | ||
|- | |||
|rowspan="3"|This article applies to: | |||
|'''Product''' | |||
|'''Version''' | |||
|- | |||
|Tmedia | |||
|2.9, 2.10, 3.0, 3.1 | |||
|} | |||
This arcticle describes how to add a '''Capture DTMF''' script to any Routing scripts. | |||
'''Script Description''' <br> | |||
If the called number is a specific value, it will play an announcement and | If the called number is a specific value, it will play an announcement and wait to capture digits. | ||
# Call 1-800-999-4444 | # Call 1-800-999-4444 | ||
# Hear tone | # Hear tone | ||
| Line 13: | Line 24: | ||
# Hear tone | # Hear tone | ||
# Enter destination number | # Enter destination number | ||
The call then routes to a TG (NAP) based on the 2 digit switch number and the INVITE contains the TG number in the TGRP= parameter. | |||
The call then routes to a TG (NAP) based on the 2-digit switch number, and the INVITE contains the TG number in the TGRP= parameter. | |||
Sample INVITE with TGRP= | Sample INVITE with TGRP= | ||
INVITE sip:18003608022@192.168.101.180;tgrp=98741 SIP/2.0 | INVITE sip:18003608022@192.168.101.180;tgrp=98741 SIP/2.0 | ||
| Line 19: | Line 32: | ||
<br> | <br> | ||
'''Add '''Capture DTMF''' Scripts in system'''<br> | |||
Download this file: | Download this file: | ||
{| cellpadding="5" border="1" class="wikitable" | {| cellpadding="5" border="1" class="wikitable" | ||
| Line 31: | Line 45: | ||
[[Import_Customized_Routing_Script_C]] | [[Import_Customized_Routing_Script_C]] | ||
To | '''Setting up '''Capture DTMF''' Scripts'''<br> | ||
To set up a Filter, the main script needs to be modified. The main script can be either simple_routing.rb, simple_routing_sbc.rb, or any other script.<br> | |||
First, go to the routing script section of the Web portal | First, go to the routing script section of the Web portal | ||
<pre>Gateway -> Routing scripts -> Example Scripts -> simple_routing.rb [Edit] | <pre>Gateway -> Routing scripts -> Example Scripts -> simple_routing.rb [Edit] | ||
</pre> | </pre> | ||
Three things need to be added. At the start of the script:<br> | Three things need to be added. At the start of the script:<br> | ||
<pre>require 'capture_dtmf' | <pre>require 'capture_dtmf' | ||
</pre> | </pre> | ||
In the main class:<br> | In the main class:<br> | ||
<pre>include CaptureDTMF | <pre>include CaptureDTMF | ||
</pre> | </pre> | ||
<pre>after_filter :method => :capture_dtmf | <pre>after_filter :method => :capture_dtmf | ||
</pre> | </pre> | ||
<br> | <br> | ||
The final script will look like this: | The final script will look like this: | ||
<pre> | <pre> | ||
| Line 65: | Line 88: | ||
end | end | ||
</pre> | </pre> | ||
'''Upload audio file'''<br> | |||
The script will play a tone for the user to ask them to enter a dtmf string. This show how to add the default one which can be downloaded here: | The script will play a tone for the user to ask them to enter a dtmf string. This show how to add the default one which can be downloaded here: | ||
{| cellpadding="5" border="1" class="wikitable" | {| cellpadding="5" border="1" class="wikitable" | ||
| Line 78: | Line 103: | ||
# Click '''Browse''' and select 'fen-tone-400hz-300ms.wav' | # Click '''Browse''' and select 'fen-tone-400hz-300ms.wav' | ||
# Click '''Upload''' | # Click '''Upload''' | ||
See instructions here: [[Toolpack:Configuring_Audio_Prompts_C]] <br> | See instructions here: [[Toolpack:Configuring_Audio_Prompts_C]] <br> | ||
However any G.711 alaw or G.711 ulaw wav file can be added to the system to be played: you need to edit the capture_dtmf.rb script with the appropriate wav file. | However any G.711 alaw or G.711 ulaw wav file can be added to the system to be played: you need to edit the capture_dtmf.rb script with the appropriate wav file. | ||
Revision as of 11:26, 13 June 2022
Applies to version(s): v2.9, v2.10, v3.0, v3.1
| This article applies to: | Product | Version |
| Tmedia | 2.9, 2.10, 3.0, 3.1 |
This arcticle describes how to add a Capture DTMF script to any Routing scripts.
Script Description
If the called number is a specific value, it will play an announcement and wait to capture digits.
- Call 1-800-999-4444
- Hear tone
- Enter 2 digit switch number optionally followed by #
- Hear tone
- Enter TG number – can be 4 or 5 digits depending on which switch the call goes to
- Hear tone
- Enter destination number
The call then routes to a TG (NAP) based on the 2-digit switch number, and the INVITE contains the TG number in the TGRP= parameter.
Sample INVITE with TGRP=
INVITE sip:18003608022@192.168.101.180;tgrp=98741 SIP/2.0
This will work with any TMG device with a license to play files. For ProSBC, it requires transcoding devices.
Add Capture DTMF Scripts in system
Download this file:
| Capture DTMF Script |
|---|
Then upload it in the system with these instructions: Import_Customized_Routing_Script_C
Setting up Capture DTMF Scripts
To set up a Filter, the main script needs to be modified. The main script can be either simple_routing.rb, simple_routing_sbc.rb, or any other script.
First, go to the routing script section of the Web portal
Gateway -> Routing scripts -> Example Scripts -> simple_routing.rb [Edit]
Three things need to be added. At the start of the script:
require 'capture_dtmf'
In the main class:
include CaptureDTMF
after_filter :method => :capture_dtmf
The final script will look like this:
require 'base_routing' require 'capture_dtmf' class SimpleRouting < BaseRouting include CaptureDTMF route_match :call_field_name => :called route_match :call_field_name => :calling route_match :call_field_name => :nap route_remap :call_field_name => :called, :route_field_name => :remapped_called route_remap :call_field_name => :calling, :route_field_name => :remapped_calling route_remap :call_field_name => :nap, :route_field_name => :remapped_nap after_filter :method => :capture_dtmf end
Upload audio file
The script will play a tone for the user to ask them to enter a dtmf string. This show how to add the default one which can be downloaded here:
| Sample Tone File |
|---|
- Click Audio Prompts in the navigation panel
- Click Browse and select 'fen-tone-400hz-300ms.wav'
- Click Upload
See instructions here: Toolpack:Configuring_Audio_Prompts_C
However any G.711 alaw or G.711 ulaw wav file can be added to the system to be played: you need to edit the capture_dtmf.rb script with the appropriate wav file.