Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| userdoc:tt_asterisk-odbc [2013/03/14 21:41] – abelbeck | userdoc:tt_asterisk-odbc [2014/07/03 19:02] (current) – [Mass Deployment SQL Table] droemel | ||
|---|---|---|---|
| Line 38: | Line 38: | ||
| The first step in using func_odbc dialplan functions is to create a database with some SQL schema, for example when the AstLinux **SQL-Data** tab in the web interface is first accessed it automatically creates the following schema in file ''/ | The first step in using func_odbc dialplan functions is to create a database with some SQL schema, for example when the AstLinux **SQL-Data** tab in the web interface is first accessed it automatically creates the following schema in file ''/ | ||
| - | CREATE TABLE ' | + | CREATE TABLE IF NOT EXISTS |
| ' | ' | ||
| ' | ' | ||
| - | ' | + | ' |
| - | ' | + | ' |
| ' | ' | ||
| ' | ' | ||
| - | ' | + | ' |
| - | ' | + | ' |
| - | ' | + | ' |
| - | ' | + | ' |
| - | ' | + | ' |
| - | ' | + | ' |
| - | ' | + | ' |
| ); | ); | ||
| | | ||
| - | CREATE TABLE ' | + | CREATE TABLE IF NOT EXISTS |
| ' | ' | ||
| ' | ' | ||
| - | ' | + | ' |
| ); | ); | ||
| | | ||
| - | CREATE TABLE ' | + | CREATE TABLE IF NOT EXISTS |
| ' | ' | ||
| - | ' | + | ' |
| - | ' | + | ' |
| - | ' | + | ' |
| - | ' | + | ' |
| - | ' | + | ' |
| - | ' | + | ' |
| ' | ' | ||
| ); | ); | ||
| Line 73: | Line 73: | ||
| !!Note ->!! The out_context table is automatically populated with id's from 0-7. | !!Note ->!! The out_context table is automatically populated with id's from 0-7. | ||
| - | A simple example is the best way to demonstrate how this works. | + | A simple example is the best way to demonstrate how this works. |
| - | {{: | + | {{: |
| Example ''/ | Example ''/ | ||
| Line 95: | Line 95: | ||
| It is very simple and very powerful! | It is very simple and very powerful! | ||
| - | !!Tip ->!! Teach yourself some basic SQL commands. | + | !!Tip ->!! Teach yourself some basic SQL commands. |
| + | ===== Mass Deployment SQL Table ===== | ||
| + | When using the **[[userdoc: | ||
| + | |||
| + | !!Note: AstLinux 1.1.7 or later is required!! | ||
| + | |||
| + | Using the SQL-Data tab in the web interface, view an example ' | ||
| + | |||
| + | {{: | ||
| + | |||
| + | The SQL schema is of the form: | ||
| + | |||
| + | CREATE TABLE ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ); | ||
| + | |||
| + | Following the examples above, adding a context to ''/ | ||
| + | |||
| + | [SIPACCOUNT] | ||
| + | dsn=asterisk | ||
| + | readsql=SELECT ${ARG1} FROM phoneprov WHERE ${ARG2}=' | ||
| + | |||
| + | In the dialplan you could then use something like this: | ||
| + | |||
| + | same => n, | ||
| + | |||
| + | to get the SIP account (peer-name) from a given extension (100) via SQL. | ||
| + | |||
| + | Detailed Mass Deployment documentation can be found here: | ||
| + | **[[userdoc: | ||
| ===== CDR Call Logging with SQL ===== | ===== CDR Call Logging with SQL ===== | ||