Asterisk and IBSng Integration
(صفحهای جدید حاوی 'Category:VoIP <div dir=rtl lang=en> __TOC__ </div> <div dir=ltr lang=en> == Asterisk Configuration == === Checking Modules === Make sure th...' ایجاد کرد) |
|||
سطر ۳۷: | سطر ۳۷: | ||
dbhost=x.x.x.x <= IBSng IP Address | dbhost=x.x.x.x <= IBSng IP Address | ||
dbport=5432 | dbport=5432 | ||
− | dbname= | + | dbname=IBSng |
dbuser=asteriskuser | dbuser=asteriskuser | ||
dbpass=xxxx | dbpass=xxxx |
نسخهٔ کنونی تا ۱۴ اکتبر ۲۰۱۲، ساعت ۱۳:۰۸
محتویات |
[ویرایش] Asterisk Configuration
[ویرایش] Checking Modules
Make sure the modules "cdr_pgsql.so" and "res_config_pgsql.so" exist in /usr/lib/asterisk/modules/
- If not so, follow this document to compile them:
http://www.voip-info.org/tiki-index.php?page=Asterisk+cdr+pgsql
[ویرایش] Make asterisk to load pgsql modules
Edit the file /etc/asterisk/modules.conf, and the state of these modules (cdr_pgsql.so and res_config_pgsql.so) to "load". (The default is "noload")
[ویرایش] Set the config files to integrate with IBSng
Now we should make asterisk to join IBSng.
First configure asterisk to load some tables in IBS dynamically.
Append these lines to "/etc/asterisk/extconfig.conf":
sipusers => pgsql,IBSng,asterisk.sip_buddies sippeers => pgsql,IBSng,asterisk.sip_buddies iaxusers => pgsql,IBSng,asterisk.iax_buddies iaxpeers => pgsql,IBSng,asterisk.iax_buddies extensions => pgsql,IBSng,asterisk.extensions
Note: sip and iax are used when we want to add these users via IBSng.
Then, edit the file "/etc/asterisk/res_pgsql.conf" to define the database parameters:
[general] dbhost=x.x.x.x <= IBSng IP Address dbport=5432 dbname=IBSng dbuser=asteriskuser dbpass=xxxx
We'll create the user (asterisk) in database later.
[ویرایش] Restart Asterisk
Finally you have to restart Asterisk service to apply the changes.
[ویرایش] Database Configuration
First we'd better to define a new user in database for asterisk (we set it as dbuser in res_pgsql.conf before):
# su - postgres createuser asteriskuser -P Enter password for new role: Enter it again: Shall the new role be a superuser? (y/n) <= y
Note: You can also limit this user to access "asterisk" table only.
Now, we should edit the file "postgresql.conf" to make postgresql (normally on IBSng server) to accept foreign requests.
Edit /etc/postgresql/XXX/main/postgresql.conf, and set "listen_addresses" to '*'.
Then, let the asterisk connect to database by adding the following line to /etc/postgresql/XXX/main/pg_hba.conf:
host IBSng asteriskuser x.x.x.x/32 md5
And, we should create asterisk table in database:
cd /usr/local/IBSng/db psql -U ibs IBSng < asterisk.sql
Finally restart postgresql service to apply our changes. (Please make sure the IBSng service is stop during restarting postgresql.)
[ویرایش] Adding Asterisk as a RAS in IBSng
You can find the document here.