userdoc:tt_asterisk-odbc

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
userdoc:tt_asterisk-odbc [2014/07/03 13:20]
abelbeck
userdoc:tt_asterisk-odbc [2014/07/03 13:58]
droemel [Mass Deployment SQL Table]
Line 99: Line 99:
 ===== Mass Deployment SQL Table ===== ===== Mass Deployment SQL Table =====
  
-When using the PhoneProv tab in the web interface, by default the templates (sql_enable=yes) automatically generate a 'phoneprov' table in the Asterisk ODBC SQLite3 database.+When using the **[[userdoc:tt_ip_phoneprov_howto|PhoneProv tab]]** in the web interface, by default the template'(sql_enable=yes) automatically generate a 'phoneprov' table in the Asterisk ODBC SQLite3 database.
  
 !!Note: AstLinux 1.1.7 or later is required!! !!Note: AstLinux 1.1.7 or later is required!!
  
 +Using the SQL-Data tab in the web interface, view an example 'phoneprov' table generated by the PhoneProv tab:
  
-Mass Deployment detailed documentation found here: +{{:userdoc:odbc-phoneprov-table.jpg?nolink|}}
-**[[userdoc:tt_ip_phone_provisioning|IP Phone Mass Deployment]]**+
  
 +The SQL schema is of the form:
 +
 +  CREATE TABLE 'phoneprov' (
 +    'id' INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
 +    'ext' TEXT DEFAULT '',
 +    'cid_name' TEXT DEFAULT '',
 +    'account' TEXT DEFAULT '',
 +    'line' INTEGER DEFAULT 1,
 +    'mac_addr' TEXT DEFAULT '',
 +    'template' TEXT DEFAULT '',
 +    'model' TEXT DEFAULT '',
 +    'vendor' TEXT DEFAULT ''
 +  );
 +
 +Following the examples above, adding a context to ''/etc/asterisk/func_odbc.conf'' to define a new function, the dialplan can use the PhoneProv data. Here is an example which fits the new 'phoneprov' table:
 +
 +  [SIPACCOUNT]
 +  dsn=asterisk
 +  readsql=SELECT ${ARG1} FROM phoneprov WHERE ${ARG2}='${SQL_ESC(${ARG3})}'
 +
 +In the dialplan you could then use something like this:
 +
 +  same => n,Set(val=${ODBC_SIPACCOUNT(account,ext,100)})
 +
 +to get the SIP account (peer) from a given extension (100) via SQL.
 +
 +Detailed Mass Deployment documentation can be found here:
 +**[[userdoc:tt_ip_phone_provisioning|IP Phone Mass Deployment]]**
  
 ===== CDR Call Logging with SQL ===== ===== CDR Call Logging with SQL =====
  • userdoc/tt_asterisk-odbc.txt
  • Last modified: 2014/07/03 14:02
  • by droemel