Проверено на телефонах Yealink.
exten => 330,1,Set(TIMEOUT(absolute)=60)
same => n,SIPAddHeader(Call-info: answer-after=0)
same => n,Page(SIP/101&SIP/102&SIP/107&SIP/126&SIP/133&SIP/134&SIP/143&
SIP/148&SIP/155&SIP/156&SIP/165&SIP/166&SIP/173&SIP/210&SIP/223)
same => n,Hangup
В настройках телефона должен быть разрешен автоответ. По умолчанию разрешен, но мало ли.
25 июл. 2019 г.
24 июл. 2019 г.
Asterisk - Zabbix
Мониторим - количество подключенных аппаратов, задержка до городского транка, количество ожидающих в очереди, количество обслуживающих в очереди.
Ставим агент (debian - прямо из репозитария), разрешаем ему выполнять 'asterisk -x'
(sudoers, groups и.т.п.)
В параметрах агента (/etc/zabbix/zabbix_agent.conf) добавляем
UserParameter=asterisk.trunkdelay,sudo /usr/sbin/asterisk -x 'sip show peers'| awk '$0~/^trunkname/ {print substr($8,2,3)}'
UserParameter=asterisk.trunkstatus,sudo /usr/sbin/asterisk -x 'sip show peers'| awk '$0~/^trunkname/ {print $7}'|grep OK|wc -l
UserParameter=asterisk.activepeers,sudo /usr/sbin/asterisk -x 'sip show peers'| awk '$8~/OK/ {print $0}' |wc -l
UserParameter=asterisk.queuecalls,sudo /usr/sbin/asterisk -x 'queue show callcenter'| grep 'in call' |wc -l
UserParameter=asterisk.queuequeue,sudo /usr/sbin/asterisk -x 'queue show callcenter'| grep 'callcenter has' |awk '{ print $3 }'
Шаблон:
<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export>
Ставим агент (debian - прямо из репозитария), разрешаем ему выполнять 'asterisk -x'
(sudoers, groups и.т.п.)
В параметрах агента (/etc/zabbix/zabbix_agent.conf) добавляем
UserParameter=asterisk.trunkdelay,sudo /usr/sbin/asterisk -x 'sip show peers'| awk '$0~/^trunkname/ {print substr($8,2,3)}'
UserParameter=asterisk.trunkstatus,sudo /usr/sbin/asterisk -x 'sip show peers'| awk '$0~/^trunkname/ {print $7}'|grep OK|wc -l
UserParameter=asterisk.activepeers,sudo /usr/sbin/asterisk -x 'sip show peers'| awk '$8~/OK/ {print $0}' |wc -l
UserParameter=asterisk.queuecalls,sudo /usr/sbin/asterisk -x 'queue show callcenter'| grep 'in call' |wc -l
UserParameter=asterisk.queuequeue,sudo /usr/sbin/asterisk -x 'queue show callcenter'| grep 'callcenter has' |awk '{ print $3 }'
Шаблон:
<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export>
8 июл. 2019 г.
Set outbound CallerID Asterisk
Before Dial() command call the macro
You can use REGEX for extensions list or just compare one number.
[macro-SetOutCID]
You can use REGEX for extensions list or just compare one number.
[macro-SetOutCID]
exten
=> s,1,Verbose("External Caller ID setting for internal
${CALLERID(num)}...")
same
=> n,ExecIf($[${REGEX("^(1011|1012|1013|1014)"
${CALLERID(num)})}]?Set(CALLERID(num)=4953229131))
same
=> n,ExecIf($["${CALLERID(num)}" =
"1040"]?Set(CALLERID(num)=4953229146))
same
=> n,ExecIf($["${CALLERID(num)}" =
"1041"]?Set(CALLERID(num)=4953229141))
same
=> n,ExecIf($[${REGEX("^(1042|1043)"
${CALLERID(num)})}]?Set(CALLERID(num)=4953229156))
same
=> n,ExecIf($["${CALLERID(num)}" =
"1050"]?Set(CALLERID(num)=4953229151))
same
=> n,ExecIf($["${CALLERID(num)}" =
"2002"]?Set(CALLERID(num)=4953229120))
; and so on
same
=> n,ExecIf($["${CALLERID(num)}" =
"5014"]?Set(CALLERID(num)=4953229198))
; last chance - if no other options, set 4953229141 !!!
same
=> n,ExecIf($[${LEN(${CALLERID(num)})} =
4]?Set(CALLERID(num)=4953229141))
same
=> n,ExecIf($[${LEN(${CALLERID(num)})} =
0]?Set(CALLERID(num)=4953229141))
same
=> n,Verbose("Outbound CallerID Set to ${CALLERID(num)}")
5 июл. 2019 г.
Asterisk - nightmode (ночной режим)
Если ночной режим включается и выключается автоматически, то используем функцию GotoIfTime:
exten => 3000,1,Answer
same => n,GotoIfTime(8:00-19:00,mon-fri,*,*?open)
same => n,Playback(announce/weekend)
same => n,Hangup()
same => n(open),Playback(announce/hello)
same => n,Queue(callcenter,t,,,300)
Если ночной режим включаем вручную, то делаем так:
; toggle night mode variable
=================================================
exten => 999,1,Answer()
same => n,Verbose(1,"NIGHT=${GLOBAL(NIGHT)}")
same => n,GotoIf(${GLOBAL(NIGHT)}?no)
same => n,Set(GLOBAL(NIGHT)=1)
same => n,Playback(announce/nighton)
same => n,Hangup()
same => n(no),Set(GLOBAL(NIGHT)=0)
same => n,Playback(announce/nightoff)
same => n,Hangup()
А потом проверяем значение переменной:
exten => _X.,1,Answer
same => n,GotoIf(${GLOBAL(NIGHT)}?night)
same => n,Background(announce/hello)
same => n,Queue(callcenter,t,,,300)
same => n,Hangup()
same => n(night),Background(announce/weekend)
same => n,Hangup()
exten => 3000,1,Answer
same => n,GotoIfTime(8:00-19:00,mon-fri,*,*?open)
same => n,Playback(announce/weekend)
same => n,Hangup()
same => n(open),Playback(announce/hello)
same => n,Queue(callcenter,t,,,300)
Если ночной режим включаем вручную, то делаем так:
; toggle night mode variable
=================================================
exten => 999,1,Answer()
same => n,Verbose(1,"NIGHT=${GLOBAL(NIGHT)}")
same => n,GotoIf(${GLOBAL(NIGHT)}?no)
same => n,Set(GLOBAL(NIGHT)=1)
same => n,Playback(announce/nighton)
same => n,Hangup()
same => n(no),Set(GLOBAL(NIGHT)=0)
same => n,Playback(announce/nightoff)
same => n,Hangup()
А потом проверяем значение переменной:
exten => _X.,1,Answer
same => n,GotoIf(${GLOBAL(NIGHT)}?night)
same => n,Background(announce/hello)
same => n,Queue(callcenter,t,,,300)
same => n,Hangup()
same => n(night),Background(announce/weekend)
same => n,Hangup()
13 июн. 2019 г.
Asterisk - отправить звонок в разные очереди, в зависимости от номера звонящего
How to send incoming call to certain queue, depending on CallerID?
Use mysql table with clients phones - filter clients and advertisement calls.
; main callcenter queue entry from outside
exten => 4100,1,Answer
same => n,Playback(announce/announce)
; Check - is it special user?
; get target queue name by callerID - for certain callers
same => n,Macro(MySQLConnect,${connid})
same => n,MySQL(Query resultid ${connid} SELECT ID,NUMBER,INCOMING_ID,QUEUE_NAME,COMMENT from queue_target where NUMBER=${CALLERID(num)})
same => n,MYSQL(Fetch foundRow ${resultid} id number incoming_id queue_name comment) ; fetch row
same => n,MYSQL(Disconnect ${connid})
same => n,Verbose("Skilltagging checking number - ${id} ${number} ${incoming_id} ${queue_name} ${comment}")
same => n,GotoIf($[${foundRow}]?:qcallc)
same => n,Verbose(1,"Caller ${CALLERID(num)} ${foundRow} was found as ${comment} and sent to queue ${queue_name} ")
same => n,GotoIf($[${foundRow}&$[${queue_name}=insurance]]?qins:)
same => n,GotoIf($[${foundRow}&$[${queue_name}=advertisement]]?qadvert:)
; usual call
same => n(qcallc),Queue(callcenter,t,,,60)
same => n,Hangup()
; insurance company
same => n(qins),Queue(insurance,t,,,120)
; not serviced (no members or not answered)- goto common queue
same => n,Goto(qcallc)
same => n,Hangup()
same => n(qadvert),Queue(advertisement,t,,,120)
; not serviced (no members or not answered)- goto common queue
same => n,Goto(qcallc)
same => n,Hangup()
Use mysql table with clients phones - filter clients and advertisement calls.
; main callcenter queue entry from outside
exten => 4100,1,Answer
same => n,Playback(announce/announce)
; Check - is it special user?
; get target queue name by callerID - for certain callers
same => n,Macro(MySQLConnect,${connid})
same => n,MySQL(Query resultid ${connid} SELECT ID,NUMBER,INCOMING_ID,QUEUE_NAME,COMMENT from queue_target where NUMBER=${CALLERID(num)})
same => n,MYSQL(Fetch foundRow ${resultid} id number incoming_id queue_name comment) ; fetch row
same => n,MYSQL(Disconnect ${connid})
same => n,Verbose("Skilltagging checking number - ${id} ${number} ${incoming_id} ${queue_name} ${comment}")
same => n,GotoIf($[${foundRow}]?:qcallc)
same => n,Verbose(1,"Caller ${CALLERID(num)} ${foundRow} was found as ${comment} and sent to queue ${queue_name} ")
same => n,GotoIf($[${foundRow}&$[${queue_name}=insurance]]?qins:)
same => n,GotoIf($[${foundRow}&$[${queue_name}=advertisement]]?qadvert:)
; usual call
same => n(qcallc),Queue(callcenter,t,,,60)
same => n,Hangup()
; insurance company
same => n(qins),Queue(insurance,t,,,120)
; not serviced (no members or not answered)- goto common queue
same => n,Goto(qcallc)
same => n,Hangup()
same => n(qadvert),Queue(advertisement,t,,,120)
; not serviced (no members or not answered)- goto common queue
same => n,Goto(qcallc)
same => n,Hangup()
Asterisk - поставить звонок в начало очереди
All animals are equal, but some animals are more equal than others.
; Вызовы от важных клиентов
same => n(bigdick),Playback(welcome)
same => n,SetVar(QUEUE_PRIO=10)
same => n,Queue(support)
; Вызовы от менее важных клиентов
same => n(others),Playback(welcome)
same => n,SetVar(QUEUE_PRIO=5)
same => n,Queue(support)
17 мая 2017 г.
Настройка apache2 на selfsigned certificates debian/ubuntu
Коротко, выжимка из (c) сайта любителей UBUNTU.
1. Создаем самоподписанный сертификат и снимаем пароль:
openssl req -new -x509 -days 366 -keyout server.key.orig -out server.pem
openssl rsa -in server.key.orig -out server.key
2. Копируем ключ и сертификат в каталоги ssl.
cp server.pem /etc/ssl/certs/
cp server.key /etc/ssl/private/
chmod 0600 /etc/ssl/private/server.key
3. Разрешаем mod_ssl, включаем сайт на 443 порту.
a2enmod ssl
a2ensite default-ssl
4. Правим ссылки на созданные ключ/сертификат в файле /etc/apache2/sites-enabled/default-ssl.conf
SSLCertificateFile /etc/ssl/certs/server.pem
SSLCertificateKeyFile /etc/ssl/private/server.key
5. Перезагружаем apache и радуемся.
service apache2 restart
Для убунты все это, конечно, через sudo )).
1. Создаем самоподписанный сертификат и снимаем пароль:
openssl req -new -x509 -days 366 -keyout server.key.orig -out server.pem
openssl rsa -in server.key.orig -out server.key
2. Копируем ключ и сертификат в каталоги ssl.
cp server.pem /etc/ssl/certs/
cp server.key /etc/ssl/private/
chmod 0600 /etc/ssl/private/server.key
3. Разрешаем mod_ssl, включаем сайт на 443 порту.
a2enmod ssl
a2ensite default-ssl
4. Правим ссылки на созданные ключ/сертификат в файле /etc/apache2/sites-enabled/default-ssl.conf
SSLCertificateFile /etc/ssl/certs/server.pem
SSLCertificateKeyFile /etc/ssl/private/server.key
5. Перезагружаем apache и радуемся.
service apache2 restart
Для убунты все это, конечно, через sudo )).
19 апр. 2017 г.
RaspberryPi 4G Megafon M100-3 (MFG823) and M150-2 (Huawei e3372h) vlan transparent openvpn tap bridge
Установка
raspbian и соединение его с Интернетом.
2.
Запускаем raspi-config, включаем ssh и расширяем
систему на весь объем карточки.
3.
Там же уменьшаем объем, выделенный под
видео.
4. Настраиваем 4G модем - Для MFG823
4.1. Ставим usb-modeswitch и переключаем модем в режим сетевой карточки.
=================================
4.1. Ставим usb-modeswitch и переключаем модем в режим сетевой карточки.
=================================
#apt-get
install usb-modeswitch
#usb_modeswitch
-v 0x19d2 -p 0x1405 -d
=================================
Asterisk: call web-based CRM when queue agent pick up the call
Asterisk: call web-based CRM when queue agent pick up the call.
We have a realtime queue.
We have to call URL when the agent of the queue pick up the call from it
URL looks like a:
http://mycrm/socket/call.php?call_id=1492593880.162&operator_id=01&call_number=+73223223232"
We have a realtime queue.
We have to call URL when the agent of the queue pick up the call from it
URL looks like a:
http://mycrm/socket/call.php?call_id=1492593880.162&operator_id=01&call_number=+73223223232"
6 мар. 2017 г.
Music on hold - Asterisk realtime queue
1. Create directory with moh music. For example - /var/lib/asterisk/moh/queuemoh. Move new music there.
2. Create section in /etc/musiconhold.conf :
[queuemoh]
mode=files
directory=/var/lib/asterisk/moh/queuemoh
3. Add musiconhold parameter to queue or set in the database (realtime queue):
musiconhold=queuemoh
2. Create section in /etc/musiconhold.conf :
[queuemoh]
mode=files
directory=/var/lib/asterisk/moh/queuemoh
3. Add musiconhold parameter to queue or set in the database (realtime queue):
musiconhold=queuemoh
Подписаться на:
Сообщения (Atom)