Dynamic Routes FAQ: Difference between revisions
No edit summary |
|||
Line 1: | Line 1: | ||
==General FAQ== | ==General FAQ== | ||
1. Q. What are the prerequisites for Dynamic Routes? | <strong>1. Q. What are the prerequisites for Dynamic Routes?</strong> | ||
The module itself does not introduce additional prerequisites, so if your system is set up for Asterisk and Freepbx this module can be installed without adding any additional software. However, the lookup method you choose can introduce additional prerequisites. | A. The Dynamic Route module itself does not introduce additional prerequisites, so if your system is set up for Asterisk and Freepbx this module can be installed without adding any additional software. However, the lookup method you choose can introduce additional prerequisites. | ||
If you are using Dynamic Routes to connect to a MySQL database directly (without ODBC) then an additional Asterisk module is required (app_mysql). Please note that the app_mysql is not built by default. Please see this link for information. Although app_mysql is still widely used, it is no longer the recommended way to connect to the MySQL database from Asterisk. | If you are using Dynamic Routes to connect to a MySQL database directly (without ODBC) then an additional Asterisk module is required (app_mysql). Please note that the app_mysql is not built by default. Please see this link for information. Although app_mysql is still widely used, it is no longer the recommended way to connect to the MySQL database from Asterisk. | ||
Line 9: | Line 9: | ||
If you are using Dynamic Routes with ODBC you will need to install the ODBC software and driver for your database and configure it. Please see this link for information. | If you are using Dynamic Routes with ODBC you will need to install the ODBC software and driver for your database and configure it. Please see this link for information. | ||
2. Q. Does Dynamic Routes effect performance? | <strong>2. Q. Does Dynamic Routes effect performance?</strong> | ||
3. Q. Does Dynamic Routes effect system availability? | <strong>3. Q. Does Dynamic Routes effect system availability?</strong> | ||
4. Q. What are the security implications of using Dynamic Routes? | <strong>4. Q. What are the security implications of using Dynamic Routes?</strong> | ||
==Configuration FAQ== | ==Configuration FAQ== | ||
1. Q. How can I avoid matching short caller ids? | <strong>1. Q. How can I avoid matching short caller ids?</strong> | ||
A. You can use a condition in the WHERE clause to ensure that only caller ids of sufficient length are matched. This is useful if your database contains company phone numbers with similar prefixes, but when receiving calls the caller id is set to the shorter main phone number of the company. | A. You can use a condition in the WHERE clause to ensure that only caller ids of sufficient length are matched. This is useful if your database contains company phone numbers with similar prefixes, but when receiving calls the caller id is set to the shorter main phone number of the company. | ||
Line 23: | Line 23: | ||
<pre>select destination from callerid_table where calleridnum like '%[NUMBER]' and length('[NUMBER]') > 4</pre> | <pre>select destination from callerid_table where calleridnum like '%[NUMBER]' and length('[NUMBER]') > 4</pre> | ||
2. Q. How can I match data in my database when sometimes the caller id arrives with an international prefix of + country codes, other times 00 country code and other times just as a national number? | <strong>2. Q. How can I match data in my database when sometimes the caller id arrives with an international prefix of + country codes, other times 00 country code and other times just as a national number?</strong> | ||
A. You may use the MySQL TRIM function to adjust the presented caller id to match the type of data in your database. For example: | A. You may use the MySQL TRIM function to adjust the presented caller id to match the type of data in your database. For example: | ||
Line 31: | Line 31: | ||
==Trouble shooting FAQ== | ==Trouble shooting FAQ== | ||
1. Q. Why do I get strange errors when using asterisk MYSQL module? | <strong>1. Q. Why do I get strange errors when using asterisk MYSQL module?</strong> | ||
<pre>[2015-04-24 21:52:59] WARNING[14294][C-000020b6] pbx.c: Error in extension logic (missing '}') | <pre>[2015-04-24 21:52:59] WARNING[14294][C-000020b6] pbx.c: Error in extension logic (missing '}') | ||
[2015-04-24 21:52:59] WARNING[14294][C-000020b6] pbx.c: Can't find trailing parenthesis for function 'CALLERID(nu'? | [2015-04-24 21:52:59] WARNING[14294][C-000020b6] pbx.c: Can't find trailing parenthesis for function 'CALLERID(nu'? |
Revision as of 20:18, 11 June 2016
General FAQ
1. Q. What are the prerequisites for Dynamic Routes?
A. The Dynamic Route module itself does not introduce additional prerequisites, so if your system is set up for Asterisk and Freepbx this module can be installed without adding any additional software. However, the lookup method you choose can introduce additional prerequisites.
If you are using Dynamic Routes to connect to a MySQL database directly (without ODBC) then an additional Asterisk module is required (app_mysql). Please note that the app_mysql is not built by default. Please see this link for information. Although app_mysql is still widely used, it is no longer the recommended way to connect to the MySQL database from Asterisk.
If you are using Dynamic Routes with ODBC you will need to install the ODBC software and driver for your database and configure it. Please see this link for information.
2. Q. Does Dynamic Routes effect performance?
3. Q. Does Dynamic Routes effect system availability?
4. Q. What are the security implications of using Dynamic Routes?
Configuration FAQ
1. Q. How can I avoid matching short caller ids?
A. You can use a condition in the WHERE clause to ensure that only caller ids of sufficient length are matched. This is useful if your database contains company phone numbers with similar prefixes, but when receiving calls the caller id is set to the shorter main phone number of the company.
select destination from callerid_table where calleridnum like '%[NUMBER]' and length('[NUMBER]') > 4
2. Q. How can I match data in my database when sometimes the caller id arrives with an international prefix of + country codes, other times 00 country code and other times just as a national number?
A. You may use the MySQL TRIM function to adjust the presented caller id to match the type of data in your database. For example:
select destination from callerid_table where calleridnum like concat('%',TRIM(LEADING '+' FROM TRIM(LEADING '0' FROM '[NUMBER]')))
Trouble shooting FAQ
1. Q. Why do I get strange errors when using asterisk MYSQL module?
[2015-04-24 21:52:59] WARNING[14294][C-000020b6] pbx.c: Error in extension logic (missing '}') [2015-04-24 21:52:59] WARNING[14294][C-000020b6] pbx.c: Can't find trailing parenthesis for function 'CALLERID(nu'? [2015-04-24 21:52:59] ERROR[14294][C-000020b6] func_callerid.c: Unknown callerid data type 'nu'. [2015-04-24 21:52:59] VERBOSE[14294][C-000020b6] pbx.c: -- Executing [s@dynroute-21:4] MYSQL("SIP/215-00000087", "Query resultid 1 select callerid_firstname from calleridlookup where owner='john' and '") in new stack [2015-04-24 21:52:59] WARNING[14294][C-000020b6] app_mysql.c: aMYSQL_query: mysql_query failed. Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''' at line 1 [2015-04-24 21:52:59] VERBOSE[14294][C-000020b6] pbx.c: -- Executing [s@dynroute-21:5] MYSQL("SIP/215-00000087", "Fetch fetchid dynroute") in new stack [2015-04-24 21:52:59] WARNING[14294][C-000020b6] app_mysql.c: aMYSQL_fetch: missing some arguments [2015-04-24 21:52:59] VERBOSE[14294][C-000020b6] pbx.c: -- Executing [s@dynroute-21:6] MYSQL("SIP/215-00000087", "Clear ") in new stack [2015-04-24 21:52:59] WARNING[14294][C-000020b6] app_mysql.c: Identifier 0, identifier_type 2 not found in identifier list [2015-04-24 21:52:59] WARNING[14294][C-000020b6] app_mysql.c: Invalid result identifier 0 passed in aMYSQL_clear [2015-04-24 21:52:59] VERBOSE[14294][C-000020b6] pbx.c: -- Executing [s@dynroute-21:7] MYSQL("SIP/215-00000087", "Disconnect 1") in new stack [2015-04-24 21:52:59] VERBOSE[14294][C-000020b6] pbx.c: -- Executing [s@dynroute-21:8] Set("SIP/215-00000087", "__DYNROUTE_TEST=") in new stack [2015-04-24 21:52:59] WARNING[14294][C-000020b6] ast_expr2.fl: ast_yyerror(): syntax error: syntax error, unexpected '=', expecting $end; Input:>
A. Do not use a semicolon at the end of the query. This syntax is not supported by asterisk MYSQL module.