Installation et configuration d'Asterisk » Historique » Version 1
Robin Gerzaguet, 08/09/2014 15:51
| 1 | 1 | Robin Gerzaguet | h1. Installation et configuration d'Asterisk |
|---|---|---|---|
| 2 | |||
| 3 | h2. Installation |
||
| 4 | |||
| 5 | <pre><code>sudo apt-get install asterisk</code></pre> |
||
| 6 | |||
| 7 | h2. Configuration |
||
| 8 | |||
| 9 | Configurer Asterisk de tel sorte que le nouveaux utlisateurs arrivant sur notre réseau GSM soient automatiquement prise en compte avec leur numéro d'extension correspondant. |
||
| 10 | |||
| 11 | Rendre la lecture des database SQLite possible avec ODBC |
||
| 12 | <pre><code>sudo apt-get install libsqliteodbc</code></pre> |
||
| 13 | |||
| 14 | Ajouter et modifer dans les fichiers suivant |
||
| 15 | <pre><code>### /etc/odbcinst.ini ### |
||
| 16 | |||
| 17 | [SQLite3] |
||
| 18 | Description=SQLite3 ODBC Driver |
||
| 19 | Driver=/usr/lib/odbc/libsqlite3odbc.so |
||
| 20 | Setup=/usr/lib/odbc/libsqlite3odbc.so |
||
| 21 | Threading=2 |
||
| 22 | |||
| 23 | ### /etc/odbc.ini ### |
||
| 24 | |||
| 25 | [asterisk] |
||
| 26 | Description=SQLite3 database |
||
| 27 | Driver=SQLite3 |
||
| 28 | Database=/var/lib/asterisk/sqlite3dir/sqlite3.db |
||
| 29 | Timeout=2000 |
||
| 30 | </code></pre> |
||
| 31 | |||
| 32 | Configurer Asterisk en modifiant les fichiers suivant |
||
| 33 | <pre><code>### modules.conf ### |
||
| 34 | |||
| 35 | [modules] |
||
| 36 | autoload=yes |
||
| 37 | preload => res_odbc.so |
||
| 38 | preload => res_config_odbc.so |
||
| 39 | ; noload => res_config_odbc.so |
||
| 40 | |||
| 41 | ### extconfig.conf ### |
||
| 42 | |||
| 43 | [settings] |
||
| 44 | sipusers => odbc,asterisk,sip_buddies |
||
| 45 | sippeers => odbc,asterisk,sip_buddies |
||
| 46 | |||
| 47 | ### res_odbc.conf ### |
||
| 48 | |||
| 49 | [asterisk] |
||
| 50 | enabled => yes |
||
| 51 | dsn => asterisk |
||
| 52 | pre-connect => yes |
||
| 53 | |||
| 54 | ### func_odbc.conf ### |
||
| 55 | |||
| 56 | [SQL] |
||
| 57 | dsn=asterisk |
||
| 58 | readsql=${ARG1} |
||
| 59 | |||
| 60 | ### extensions.conf ### |
||
| 61 | |||
| 62 | [phones] |
||
| 63 | exten => _N.,1,Set(Name=${ODBC_SQL(select dial from dialdata_table where exten=\"${EXTEN}\")}) |
||
| 64 | exten => _N.,n,GotoIf($["${Name}"=""] ?other-lines,${EXTEN},1) |
||
| 65 | exten => _N.,n,Dial(SIP/${Name}@127.0.0.1:5062) |
||
| 66 | exten => 12345,1,Answer() |
||
| 67 | same => n,Playback(hello-world) |
||
| 68 | same => n,Hangup() |
||
| 69 | </code></pre> |