Dynamic Routes Reference documentation: Difference between revisions

From voipsupport
Jump to navigation Jump to search
Line 82: Line 82:
|-  
|-  
| URL
| URL
|A lookup is done to an ODBC datasource. The parameters used are:
| A lookup is done to a URL. The parameters used are:
* ODBC function
* URL Looup
|-
|-
| AGI
| AGI
|
| A lookup is done by launching an Asterisk AGI script. The parameters used are:
* AGI Lookup
* AGI Result Variable
|-
|-
| Asterisk Variable
| Asterisk Variable
|
| The lookup value is read from an Asterisk Variable. The parameters used are:
* Asterisk Variable
|}
|}



Revision as of 18:07, 11 June 2016

Dynamic Route

The following information documents how to fill in the fields of a Dynamic Route. This documentation refers to the V13 functionality. Not all options are available in previous versions.

Field name Comment
Dynamic Route Name The name of the dynamic route. This can be chosen at will. It is used to identify the route when selecting it as a destination from other applications or inbound routes.
Dynamic Route Description Optional description text for the Dynamic Route. This is for documentation purposes only
Enable DTMF Input Setting: Yes or No. Default: No. If set to yes the call waits for input on the touch tone keypad. This can be used to capture caller input (for example a customer number).
Announcement The system recording to be played back. If Enable DTMF input is set to Yes then playback takes palce before waiting for DTMF input.
Timeout Timeout in seconds to wait for DTMF input. This value is only used if Enable DTMF Input is set to Yes. If no value is given for timeout, the default for the channel is used. It is best to set an explicit value to avoid doubts.
Validation Validation rules using a Asterisk regular expression (see Asterisk REGEX). For example to ensure the input is between 3 and 4 digits long you could use ^[0-9]\{3,4\}$
Invalid Retries Number of times to retry if DTMF input does not match validation rules.
Invalid Retry Recording Recording to play if DTMF input does not match validation rules.
Invalid Recording Recording to play if DTMF input does not match validation rules and Invalid Retries have been exhausted.
Invalid Destination The destination to send the call to if DTMF input does not match the validation rules and Invalid Retries ahve been exhausted. The call is sent to this destination after playing the Invalid Recording if it is defined.
Saved input varibale name Name of variable in which to save DTMF input for future use in the dialplan or further dynamic routes. This is available as [name] in the query/lookup where name is the name of the variable you specify here. To use the variable in the dialplan (e.g. custom applicaitons) it is necessary to prefix it with DYNROUTE_ e.g. DYNROUTE_name
Saved result variable name Name of variable in which to save lookup result for future use in the dialplan or further dynamic routes. This is available as [name] in the query/lookup where name is the name of the variable you specify here. To use the variable in the dialplan (e.g. custom applicaitons) it is necessary to prefix it with DYNROUTE_ e.g. DYNROUTE_name
Source Type The type of lookup (see under Source types below for further information
Default Destination Destination to send the call to if the lookup results does not match one of the match values in the Dynamic Route Entries section or if the lookup fails.
Dynamic Route Entries Zero or more entries to be matched by the lookup result. If the lookup matches, then the call is routed to the chosen destination. Each match is tried in the order given until one matches. If no match is found then the call is sent to the Default Destination. Additional rows may be added by clicking the + symbol. Entries may be deleted by cancelling the value in the Match field.

Source Type

The following are the currently available source types for lookups. Each source type has its own specific fields for defining the lookup parameters.

Source Type Comment
none No lookup is carried out. The call is sent to the default destination
MySQL A lookup is done to a MySQL database. The parameters used are:
  • MySQL hostname
  • MySQL database
  • MySQL username
  • MySQL password
  • MySQL query
ODBC A lookup is done to an ODBC datasource. The parameters used are:
  • ODBC function
  • ODBC query

For information about setting up ODBC see this article

URL A lookup is done to a URL. The parameters used are:
  • URL Looup
AGI A lookup is done by launching an Asterisk AGI script. The parameters used are:
  • AGI Lookup
  • AGI Result Variable
Asterisk Variable The lookup value is read from an Asterisk Variable. The parameters used are:
  • Asterisk Variable

Substitutions

In the lookup

When defining the query field for the lookup, the following Variable Names will be substituted by the corresponding value at the time of the call routing.

Vairable Name Substituted by
[INPUT] The DTMF input by the caller on the touchtone keypad
[NUMBER] The callerid of the incoming call
[DID] The called number
[name] Where "name" is the value of one of these two fields: Saved input varibale name or Saved result varibale name. In the case of Saved input variable name, the DTMF input is saved under this name. This is useful if you are using two levels of Dynamic Route so that you can save the DTMF from the previous Dynamic Route in a uniquely named variable and use that variable in the lookup of the second Dynamic Route. In the case of Saved result variable name, the result returned from the lookup is saved to the variable name and can be used in a later Dynamic Route.

In custom dial plan or other Freepbx modules

Vairable Name Substituted by
DYNROUTE_name Where "name" is the value of one of these two fields: Saved input varibale name or Saved result varibale name. In the case of Saved input variable name, the DTMF input is saved under this name. This is useful if you need to use the value in a custom dial plan application or another Freepbx module. In the case of Saved result variable name, the result returned from the lookup is saved to the variable name and can be used in a custom dial plan application or another Freepbx module.

Screenshot of adding a Dynamic Route

Dynamic route add.png