Asterisk Wholesale Service
سطر ۱۷: | سطر ۱۷: | ||
== AGI files setting == | == AGI files setting == | ||
− | Make the path "/var/lib/asterisk/agi-bin" | + | Make the path "/var/lib/asterisk/agi-bin" : |
# mkdir /var/lib/asterisk/agi-bin/ | # mkdir /var/lib/asterisk/agi-bin/ | ||
+ | |||
+ | If you use AGI file | ||
+ | copy dial directory from IBSng addons there | ||
+ | |||
# cp -r /usr/local/IBSng/addons/asterisk/dial /var/lib/asterisk/agi-bin/ | # cp -r /usr/local/IBSng/addons/asterisk/dial /var/lib/asterisk/agi-bin/ | ||
+ | |||
+ | And if you use FastAGI | ||
+ | copy dial directory from Pars Pooyesh Server , /home/ISP | ||
+ | # scp /home/ISP/VOIP/asterisk/Fastagi/dial.tar.gz root@ ip asterisk:/var/lib/asterisk/agi-bin/ | ||
+ | After transfer files check in asterisk server | ||
+ | # cd /var/lib/asterisk/agi-bin/ | ||
+ | And extract files, there | ||
+ | # tar -zxvf dial.tar | ||
+ | |||
Create a link from "/var/lib/asterisk/agi-bin" to "/usr/share/asterisk/agi-bin": | Create a link from "/var/lib/asterisk/agi-bin" to "/usr/share/asterisk/agi-bin": | ||
− | # ln -s /var/lib/asterisk/agi-bin /usr/share/asterisk/ | + | # ln -s /var/lib/asterisk/agi-bin /usr/share/asterisk/ |
==== What does dial directory do? ==== | ==== What does dial directory do? ==== | ||
Actually, Dial directory is a python module. It includes an configuration file, defs.py, that we should set some fields in it based on the service we want to use. | Actually, Dial directory is a python module. It includes an configuration file, defs.py, that we should set some fields in it based on the service we want to use. | ||
− | ==== Editing | + | ==== Editing ibs_agi.py ==== |
For Wholesale Service, we should edit the following fields: | For Wholesale Service, we should edit the following fields: | ||
سطر ۴۴: | سطر ۵۷: | ||
switch => Realtime/ibs_users | switch => Realtime/ibs_users | ||
<br> | <br> | ||
+ | ====Editing sip.conf==== | ||
+ | Edit "/etc/asterisk/sip.conf" and append these contexts: | ||
+ | [general] | ||
+ | context=incoming | ||
+ | allow=g729 | ||
+ | allow=ulaw | ||
+ | dtmfmode = rfc2833 | ||
+ | ====Edit Manager.conf==== | ||
+ | Edit "/etc/asterisk/manager.conf": | ||
+ | [asterisk] | ||
+ | secret=asterisk | ||
+ | deny=0.0.0.0/0.0.0.0 | ||
+ | permit=127.0.0.1/255.255.255.255 | ||
+ | permit=<IBSng Ip Address>/255.255.255.255 | ||
+ | read = system,call,log,verbose,command,agent,user,config,originate,all | ||
+ | write = system,call,log,verbose,command,agent,user,config,originate,all | ||
====Important Note:==== | ====Important Note:==== | ||
− | If you use Asterisk 1.6.x, you should set "AGI" instead of "DeadAGI" | + | 1-If you use Asterisk 1.6.x, you should set "AGI" instead of "DeadAGI" |
<br> | <br> | ||
− | + | 2- Run this command manually and put it in rc.local | |
+ | screen -dm /usr/bin/python2.6 /usr/share/asterisk/agi-bin/dial/ibs_agi_starter.py | ||
=== Restart Asterisk === | === Restart Asterisk === | ||
نسخهٔ ۱ دسامبر ۲۰۱۲، ساعت ۱۳:۲۸
محتویات |
This service is designed for wholesale providers.
Main steps to install this service are:
- Integrating Asterisk and IBSng
- To copy AGI files in appropriate path
- Configuring asterisk to route calls using IBSng routing profile
- Defining customer's user in IBSng
Integrating Asterisk and IBSng
You can find the document here.
AGI files setting
Make the path "/var/lib/asterisk/agi-bin" :
# mkdir /var/lib/asterisk/agi-bin/
If you use AGI file copy dial directory from IBSng addons there
# cp -r /usr/local/IBSng/addons/asterisk/dial /var/lib/asterisk/agi-bin/
And if you use FastAGI copy dial directory from Pars Pooyesh Server , /home/ISP
# scp /home/ISP/VOIP/asterisk/Fastagi/dial.tar.gz root@ ip asterisk:/var/lib/asterisk/agi-bin/
After transfer files check in asterisk server
# cd /var/lib/asterisk/agi-bin/
And extract files, there
# tar -zxvf dial.tar
Create a link from "/var/lib/asterisk/agi-bin" to "/usr/share/asterisk/agi-bin":
# ln -s /var/lib/asterisk/agi-bin /usr/share/asterisk/
What does dial directory do?
Actually, Dial directory is a python module. It includes an configuration file, defs.py, that we should set some fields in it based on the service we want to use.
Editing ibs_agi.py
For Wholesale Service, we should edit the following fields:
IBSNG_SERVER=("IBSng IP Address",1235)
Config Asterisk to establish calls, collaborating with IBSng
Edit "/etc/asterisk/extensions.conf" and append these contexts:
[incoming] exten => _XXXXXXX.*,1,DeadAGI(dial/ibs_agi_starter.py|SIP/${EXTEN}) include => ibs_users
[ibs_users] switch => Realtime/ibs_users
Editing sip.conf
Edit "/etc/asterisk/sip.conf" and append these contexts:
[general] context=incoming allow=g729 allow=ulaw dtmfmode = rfc2833
Edit Manager.conf
Edit "/etc/asterisk/manager.conf":
[asterisk] secret=asterisk deny=0.0.0.0/0.0.0.0 permit=127.0.0.1/255.255.255.255 permit=<IBSng Ip Address>/255.255.255.255 read = system,call,log,verbose,command,agent,user,config,originate,all write = system,call,log,verbose,command,agent,user,config,originate,all
Important Note:
1-If you use Asterisk 1.6.x, you should set "AGI" instead of "DeadAGI"
2- Run this command manually and put it in rc.local
screen -dm /usr/bin/python2.6 /usr/share/asterisk/agi-bin/dial/ibs_agi_starter.py
Restart Asterisk
Finally you have to restart Asterisk service to apply the changes.