Asterisk + creating a conference call
Понадобилось создать такую схему: абонент звонит на определенный номер – создается конференция – происходит дозвон из астериска к определенным абонентам(заранее прописанным).
Первым делом, ставим систему и сам астериск. Я выбрал CentOS и чистый астериск (без готовых TrixBox, FreePBX).
Вот, здесь описано как установить астериск: http://www.asterisk.org/downloads/yum
The first step is to add the Asterisk yum repositories to your CentOS or RedHat system. This is done by creating an entry in the yum configuration directory (/etc/yum.repos.d by default).
Use the text editor of your choice to create a new file named “centos-asterisk.repo” in the “/etc/yum.repos.d” folder. Add the following text to the file:
[asterisk-tested] name=CentOS-$releasever - Asterisk - Tested baseurl=http://packages.asterisk.org/centos/$releasever/tested/$basearch/ enabled=0 gpgcheck=0 #gpgkey=http://packages.asterisk.org/RPM-GPG-KEY-Digium [asterisk-current] name=CentOS-$releasever - Asterisk - Current baseurl=http://packages.asterisk.org/centos/$releasever/current/$basearch/ enabled=1 gpgcheck=0 #gpgkey=http://packages.asterisk.org/RPM-GPG-KEY-DigiumSave the new file and create another named “centos-digium.repo” and insert the following text:
[digium-tested] name=CentOS-$releasever - Digium - Tested baseurl=http://packages.digium.com/centos/$releasever/tested/$basearch/ enabled=0 gpgcheck=0 #gpgkey=http://packages.digium.com/RPM-GPG-KEY-Digium [digium-current] name=CentOS-$releasever - Digium - Current baseurl=http://packages.digium.com/centos/$releasever/current/$basearch/ enabled=1 gpgcheck=0 #gpgkey=http://packages.digium.com/RPM-GPG-KEY-DigiumAt this point your system has been updated to use the Asterisk and Digium repositories in addition to the base CentOS repositories. You are now ready to install Asterisk. To start the installation, execute the following at the Linux command line:
[root@localhost~]# yum install asterisk18 asterisk18-configs asterisk18-voicemail dahdi-linux dahdi-tools libpriCongratulations, you now have a CentOS or RedHat system with a complete version of Asterisk installed. Test out your new install by starting Asterisk:
[root@localhost yum.repos.d]# asterisk -vvvgci
Что хочется отметить на данном этапе: у меня нет платы digium, – поэтому мне нужен dahdi_dummy псевдо-устройство для работы meetme.
Без этого работать не будет – сразу кладет трубку.
Есть ли это устройство в системе можно проверить либо зайдя в /dev либо набрать dahdi_test – должны появиться циферки измерения времени.
У меня его, почему-то, не установило, хотя ошибок установки не было.
После долгих изыканий был найден работоспособный рецепт здесь: http://fonality.com/trixbox/devblog/dahdi-221-update
wget http://yum.trixbox.org/fix/fix-dahdi.sh
sh ./fix-dahdi.sh
yum clean all
yum update
Девайс появился – все заработало.
extensions.conf
[default]
;exten => 3000,1,Playback(demo-congrats)
exten => 3000,1,GotoIf($[“${CALLERID(NUM)}” != “2000”]?meetme) ; если номер звонящего не 2000, то сразу вызывается конференция
exten => 3000,n,System(cp /var/spool/asterisk/call-list1/*.call /var/spool/asterisk/outgoing) ; если вызывающий был 2000, то копируем подготовленные файлы для дозвона
exten => 3000,n(meetme),MeetMe(3000,qrX)
exten => 3000,n,Hangup()
2001.call – пример (sip/2001 – вызываем номер 2001 от имени extension: 3000)
Channel: sip/2001
MaxRetries: 1
RetryTime: 60
WaitTime: 30
Context: default
Extension: 3000
Priority: 2
Callerid: 3000
В meetme.conf все понятно – просто прописываем саму конференцию: conf => 3000.
Сам скрипт fixdahdi на всякий случай:
#!/bin/sh
clear
echo “Fix DAHDI 1.0”
echo “————————————————–”
echo “Becasue of the way modules work in the Linux kernel there can be problems with”
echo “modules RPMs. If you are getting errors when you try to update DAHDI modules”
echo “this script should resolve your problems.”
echo -n “Upgrade DAHDI RPMs?[n]”
read ANSWER
case “$ANSWER” in
“y” | “Y” )
echo “————————————————–”yum clean all
for rpm in `rpm -qa | grep kmod-dahdi`
do
echo “removing $rpm”
rpm -e –nodeps $rpm
donefor rpm in `rpm -qa | grep kmod-mISDN`
do
echo “removing $rpm”
rpm -e –nodeps $rpm
doneyum -y install dahdi-linux kmod-dahdi-linux kmod-mISDN
echo “————————————————–”
echo “Your DAHDI problems should be resolved”
echo “You may need to upadte the rest of your packages using yum update.”
echo “You should reboot your system now.” ;;* )
;;
esac
echo
exit 0
CentOS + restoring from a dump Midnight Commander – my colors