Browse Source

Version do webrtc no version_1.8.2

master
rodgger 2 months ago
parent
commit
2612addc31
  1. 102
      version_1.8.2/README.md
  2. 66
      version_1.8.2/docker-compose.yml
  3. 26
      version_1.8.2/env_example
  4. 83
      version_1.8.2/pabx/Dockerfile
  5. BIN
      version_1.8.2/pabx/asterisk/var_lib_asterisk/astdb.sqlite3
  6. 238
      version_1.8.2/pabx/build-asterisk_php.sh
  7. 20
      version_1.8.2/pabx/certificados/RootCA.crt
  8. 28
      version_1.8.2/pabx/certificados/RootCA.key
  9. 20
      version_1.8.2/pabx/certificados/RootCA.pem
  10. 1
      version_1.8.2/pabx/certificados/RootCA.srl
  11. 7
      version_1.8.2/pabx/certificados/domains.ext
  12. 21
      version_1.8.2/pabx/certificados/localhost.crt
  13. 17
      version_1.8.2/pabx/certificados/localhost.csr
  14. 28
      version_1.8.2/pabx/certificados/localhost.key
  15. 18
      version_1.8.2/pabx/config-docker.php
  16. 40
      version_1.8.2/pabx/config_network
  17. 40
      version_1.8.2/pabx/crontab.sh
  18. 31
      version_1.8.2/pabx/docker-entrypoint.sh
  19. 100
      version_1.8.2/pabx/etc/apache2/sites-available/pabx_simples.conf
  20. BIN
      version_1.8.2/pabx/etc/asterisk/-R
  21. 80
      version_1.8.2/pabx/etc/asterisk/acl.conf
  22. 8
      version_1.8.2/pabx/etc/asterisk/adsi.conf
  23. 39
      version_1.8.2/pabx/etc/asterisk/adtranvofr.conf
  24. 6
      version_1.8.2/pabx/etc/asterisk/agents.conf
  25. 16
      version_1.8.2/pabx/etc/asterisk/agents_adicional.conf
  26. 2
      version_1.8.2/pabx/etc/asterisk/agents_general.conf
  27. 1
      version_1.8.2/pabx/etc/asterisk/agents_general_customizado.conf
  28. 4
      version_1.8.2/pabx/etc/asterisk/agents_usuarios.conf
  29. 1
      version_1.8.2/pabx/etc/asterisk/agents_usuarios_customizado.conf
  30. 91
      version_1.8.2/pabx/etc/asterisk/alarmreceiver.conf
  31. 77
      version_1.8.2/pabx/etc/asterisk/alsa.conf
  32. 31
      version_1.8.2/pabx/etc/asterisk/amd.conf
  33. 24
      version_1.8.2/pabx/etc/asterisk/app_mysql.conf
  34. 27
      version_1.8.2/pabx/etc/asterisk/app_skel.conf
  35. 0
      version_1.8.2/pabx/etc/asterisk/applyzap.conf
  36. 30
      version_1.8.2/pabx/etc/asterisk/ari.conf
  37. 57
      version_1.8.2/pabx/etc/asterisk/ast_debug_tools.conf
  38. 158
      version_1.8.2/pabx/etc/asterisk/asterisk.adsi
  39. 114
      version_1.8.2/pabx/etc/asterisk/asterisk.conf
  40. 109
      version_1.8.2/pabx/etc/asterisk/calendar.conf
  41. 205
      version_1.8.2/pabx/etc/asterisk/ccss.conf
  42. 167
      version_1.8.2/pabx/etc/asterisk/cdr.conf
  43. 59
      version_1.8.2/pabx/etc/asterisk/cdr_adaptive_odbc.conf
  44. 16
      version_1.8.2/pabx/etc/asterisk/cdr_custom.conf
  45. 6
      version_1.8.2/pabx/etc/asterisk/cdr_manager.conf
  46. 62
      version_1.8.2/pabx/etc/asterisk/cdr_mysql.conf
  47. 12
      version_1.8.2/pabx/etc/asterisk/cdr_odbc.conf
  48. 8
      version_1.8.2/pabx/etc/asterisk/cdr_pgsql.conf
  49. 10
      version_1.8.2/pabx/etc/asterisk/cdr_sqlite3_custom.conf
  50. 83
      version_1.8.2/pabx/etc/asterisk/cdr_syslog.conf
  51. 77
      version_1.8.2/pabx/etc/asterisk/cdr_tds.conf
  52. 116
      version_1.8.2/pabx/etc/asterisk/cel.conf
  53. 39
      version_1.8.2/pabx/etc/asterisk/cel_custom.conf
  54. 108
      version_1.8.2/pabx/etc/asterisk/cel_odbc.conf
  55. 93
      version_1.8.2/pabx/etc/asterisk/cel_pgsql.conf
  56. 24
      version_1.8.2/pabx/etc/asterisk/cel_sqlite3_custom.conf
  57. 69
      version_1.8.2/pabx/etc/asterisk/cel_tds.conf
  58. 7
      version_1.8.2/pabx/etc/asterisk/chan_dahdi.conf
  59. 0
      version_1.8.2/pabx/etc/asterisk/chan_dahdi_ramais.conf
  60. 21
      version_1.8.2/pabx/etc/asterisk/chan_dahdi_ramais_general.conf
  61. 0
      version_1.8.2/pabx/etc/asterisk/chan_dahdi_troncos.conf
  62. 15
      version_1.8.2/pabx/etc/asterisk/chan_dahdi_troncos_general.conf
  63. 69
      version_1.8.2/pabx/etc/asterisk/chan_mobile.conf
  64. 12
      version_1.8.2/pabx/etc/asterisk/cli.conf
  65. 203
      version_1.8.2/pabx/etc/asterisk/cli_aliases.conf
  66. 82
      version_1.8.2/pabx/etc/asterisk/cli_permissions.conf
  67. 206
      version_1.8.2/pabx/etc/asterisk/codecs.conf
  68. 12
      version_1.8.2/pabx/etc/asterisk/confbridge.conf
  69. 46
      version_1.8.2/pabx/etc/asterisk/config_test.conf
  70. 97
      version_1.8.2/pabx/etc/asterisk/console.conf
  71. 5
      version_1.8.2/pabx/etc/asterisk/dahdi_guiread.conf
  72. 11
      version_1.8.2/pabx/etc/asterisk/dahdi_scan.conf
  73. 34
      version_1.8.2/pabx/etc/asterisk/dbsep.conf
  74. 27
      version_1.8.2/pabx/etc/asterisk/digivoice.conf
  75. 5
      version_1.8.2/pabx/etc/asterisk/dnsmgr.conf
  76. 42
      version_1.8.2/pabx/etc/asterisk/dsp.conf
  77. 268
      version_1.8.2/pabx/etc/asterisk/dundi.conf
  78. 22
      version_1.8.2/pabx/etc/asterisk/enum.conf
  79. 111
      version_1.8.2/pabx/etc/asterisk/extconfig.conf
  80. 456
      version_1.8.2/pabx/etc/asterisk/extensions.ael
  81. 27
      version_1.8.2/pabx/etc/asterisk/extensions.conf
  82. 240
      version_1.8.2/pabx/etc/asterisk/extensions.lua
  83. 3
      version_1.8.2/pabx/etc/asterisk/extensions_anuncios.conf
  84. 2
      version_1.8.2/pabx/etc/asterisk/extensions_callback.conf
  85. 1
      version_1.8.2/pabx/etc/asterisk/extensions_campanha.conf
  86. 2
      version_1.8.2/pabx/etc/asterisk/extensions_conferencia.conf
  87. 0
      version_1.8.2/pabx/etc/asterisk/extensions_contextos.conf
  88. 0
      version_1.8.2/pabx/etc/asterisk/extensions_contextos_custom.conf
  89. 33
      version_1.8.2/pabx/etc/asterisk/extensions_contextos_personalizados.conf
  90. 2
      version_1.8.2/pabx/etc/asterisk/extensions_disa.conf
  91. 0
      version_1.8.2/pabx/etc/asterisk/extensions_discador.conf
  92. 369
      version_1.8.2/pabx/etc/asterisk/extensions_facilidades.conf
  93. 1
      version_1.8.2/pabx/etc/asterisk/extensions_fila.conf
  94. 1
      version_1.8.2/pabx/etc/asterisk/extensions_fila_login.conf
  95. 23
      version_1.8.2/pabx/etc/asterisk/extensions_general.conf
  96. 2
      version_1.8.2/pabx/etc/asterisk/extensions_grupos.conf
  97. 0
      version_1.8.2/pabx/etc/asterisk/extensions_grv.conf
  98. 3
      version_1.8.2/pabx/etc/asterisk/extensions_horarios.conf
  99. 158
      version_1.8.2/pabx/etc/asterisk/extensions_minivm.conf
  100. 1830
      version_1.8.2/pabx/etc/asterisk/extensions_padrao.conf
  101. Some files were not shown because too many files have changed in this diff Show More

102
version_1.8.2/README.md

@ -0,0 +1,102 @@
# Configuração do PABX versão 1.8 no docker
Inicie a aplicação PABX de maneira fácil e sincronizada.
## Preparando o ambiente no Windows
### Configurando o WSL
- Certifique-se de que o WSL2 está instalado no Windows. Caso não esteja, siga a documentação para realizar a instalação: [Instalação do WSL2](https://learn.microsoft.com/pt-br/windows/wsl/install).
Após a instalação do WSL2, instale uma distribuição Linux.
* Recomendamos a utilização do Debian. Para isso, execute o seguinte comando no PowerShell:
```bash
wsl --install -d Debian
```
* Em seguida, digite o seguinte comando no PowerShell para entrar em uma instância do Debian:
```bash
wsl -d Debian
```
### Desabilite o Firewall e o Defender do Windows
Para conseguir realizar o download de alguns repositórios.
## Clonando o repositório
* Clone o projeto: docker-pabx-app.
```bash
git clone http://192.168.115.233:3000/SimplesIP/docker-pabx-app.git
```
## Deploy
* Entre no diretório que contém os arquivos de inicialização do container.
```bash
cd docker-pabx-app/debian
```
Crie uma cópia do arquivo 'env-example' com o nome de '.env'.
```bash
cp env-example .env
```
Defina as variáveis dentro do arquivo .env:
- pasta_do_projeto - a pasta onde se encontra o projeto PABX.
- pasta_do_postgresql11 - onde deverá sincronizar o banco de dados.
- postgresql_version - por agora, não deve mudar o valor.
### Execute o container com o docker-compose:
```bash
sudo docker-compose up -d
```
Esse comando tentará compilar e levantar container.
## FAQ
* ### Configurar rota do endereço SIP?
Acesse a página `<ip>:8080/config-docker.php`. Essa página vai configurar o IP no arquivo `/etc/sip_generera.conf` e carregá-lo no Asterisk. Não deve usar "localhost", pois o endereço será do container. É necessário usar o endereço do host para acessar esta página config-docker.php.
* ### Para que serve o arquivo `.env` ?
Serve para definir variáveis a serem usadas no compose. Leia o arquivo '.env-example' para mais informações.
* ### Quais arquivos estão sicronizados ?
Grande parte dos arquivos do projeto estão sincronizados, porém existe os arquivos que não estão sincronizados. Os arquivos não sincronizados serão apagados quando seu container for encerrado e reescritos pelos arquivos da imagem quando o container for iniciado.
Não sincronizados:
- `/etc/asterisk` - Sem sincronização na pasta
- `/etc/init.d/cnvrtd` - sem sincronização no arquivo
- `/etc/init.d/rtabd` - sem sincronização no arquivo
- `/etc/init.d/supervisor` - sem sincronização no arquivo
Sincronizados:
- `/var/lib/postgresql/data` - Sincronizado os arquivo do banco de dados
- `/var/www/html/aplicativo` - Sincronizado
- `/var/www/html/include` - sincronizado
- `/var/lib/asterisk/` - sincronizado
- `/hdaux/utilitarios/scripts` - sincronizado
Obs:
- `/projeto/base` será replicado no container postgres `/base` para poder puxar o banco de dados.
### É necessário executar algo depois da build?
Não, todo o processo é automático. Porém, é preciso acessar `<ip>:8080/config-docker.php`, que fará o reconhecimento do IP e irá defini-lo para o protocolo SIP.
* ### Qual as portas ?
- `8080` - apache (web)
- `5432` - postgresql
- `5038` - asterisk (ami)
- `5060` - asterisk (sip)
- `10000-10030` - asterisk (RTP)
* ### Se o pabx criar arquivos que não estão no projeto gitea?
Coloque em `.gitignore` e mande a correção.

66
version_1.8.2/docker-compose.yml

@ -0,0 +1,66 @@
version: '3.7'
networks:
working:
driver: bridge
services:
postgres:
build:
context: postgres-13
args:
# definir o id do usuário para ter acesso ao volume
- ID_USER_VOLUME=${id_user}
container_name: v1.8.1-webrtc-pg
restart: always
environment:
- POSTGRES_USER=contacte
- POSTGRES_PASSWORD=ctepgSQL
- POSTGRES_DB=pbx
ports:
- 5432:5432
networks:
- working
volumes:
# copiar a pasta /projeto/base do pabx
- ${pasta_do_projeto}/projeto/base:/base
# copiar a pasta /var/lib/pgsql/data
- ${pasta_do_postgresql}:/var/lib/postgresql/data
aplicativo:
build:
context: pabx
args:
# usar para compilar dockerfile
# DB_HOST DB_PORT DB_BASE - necessário para colocar no crontab
# environment compose é para depois do dockerfile
- DB_HOST=postgres
- DB_PORT=5432
- DB_BASE=pbx
- ID_USER_VOLUME=${id_user}
restart: always
container_name: v1.8.1-webrtc
working_dir: /var/www/html/
ports:
- 8080:80
- 5038:5038
- "5060:5060/tcp"
- "5060:5060/udp"
- "5061:5061/tcp"
- "5061:5061/udp"
- "8088:8088/tcp"
- "10000-10030:10000-10030/udp"
- 4443:443
- 8089:8089
privileged: true
depends_on:
- postgres
networks:
- working
links:
- postgres
volumes:
- ./pabx/etc/asterisk/:/etc/asterisk
- ./pabx/certificados/:/usr/src/certificates
- ${pasta_do_projeto}:/var/www/html/aplicativo
- ${pasta_do_projeto}/include:/var/www/html/include
- ${pasta_do_projeto}/asterisk/var_lib_asterisk/:/var/lib/asterisk/
- ${pasta_do_projeto}/asterisk/hdaux_utilitarios_scripts/:/hdaux/utilitarios/scripts

26
version_1.8.2/env_example

@ -0,0 +1,26 @@
# Pasta aonde está o projeto pabx para ser sincronizado no container
#
# Exemplo:
#pasta_do_projeto=/home/user/source_pabx
#pasta_do_projeto=c://Usuario/User/source_pabx
pasta_do_projeto=""
# Pasta do host para sincronizar a pasta /var/lib/pgsql/data (versão 13)
# Isso será usada para manter o banco de dados caso queira levantar
# outra instância.
#
# Essa pasta pode ser enviado ao repositório caso queira compartilhar
# o banco
pasta_do_postgresql=""
# ID do usuário para ter acesso ao volume
# Esse id_user é para poder ter acesso ao volume sem a necessidade de se tornar root
# Será modificado o id dos usuários postgres e pbx
# Para saber seu id é o comando 'id -u'.
id_user="1000"

83
version_1.8.2/pabx/Dockerfile

@ -0,0 +1,83 @@
FROM debian:bullseye-slim
# Compose manda os valores para conectar ao banco de dados
# Esses valores são usado para crontab
# crontab não limpa variáveis de ambiente para chamar script
# Logo printenv | sed 's/^\(.*\)$/export \1/g' > /env_to_crontab.sh
# defini as variáveis que vão ser chamado em cada script crontab
ARG DB_HOST
ARG DB_PORT
ARG DB_BASE
ARG ID_USER_VOLUME
ENV ASTERISK_VERSION 13.38-cert3
ENV ASTERISK_ADDONS_VERSION 13.18-cert3
ENV ASTERISK_USER pbx
ENV ASTERISK_GID pbx
ENV VERSION_SIMPLESIP v1.8
ENV APACHE_RUN_USER pbx
ENV APACHE_RUN_GROUP pbx
ENV DB_HOST $DB_HOST
ENV DB_PORT $DB_PORT
ENV DB_BASE $DB_BASE
ENV ID_USER_VOLUME $ID_USER_VOLUME
RUN mkdir -p /var/lock/subsys/
# Instalação do asterisk e do PHP 8.2 e asterisk 13.38
COPY build-asterisk_php.sh /
RUN chmod 755 /build-asterisk_php.sh
RUN /build-asterisk_php.sh $ID_USER_VOLUME
COPY etc/asterisk/* /etc/asterisk
# definir as variáveis de ambiente para o cron
RUN printenv | sed 's/^\(.*\)$/\1/g' > /etc/environment
COPY crontab.sh /
RUN bash /crontab.sh
RUN crontab /etc/crontab
# Script chamado quando acessar a página web ip:8080/config-docker.php
COPY /config_network /
RUN chmod 755 /config_network
RUN chown pbx:pbx /config_network
# apache
COPY etc/apache2/sites-available/pabx_simples.conf /etc/apache2/sites-available/pabx_simples.conf
RUN rm -rf /etc/apache2/sites-enabled/*
RUN ln -s /etc/apache2/sites-available/pabx_simples.conf /etc/apache2/sites-enabled/pabx_simples.conf
# colocar os arquivos include_pat do php
RUN sed -i '745 s/^[;]\? *include_path = .*/include_path = \".:\/var\/www\/html\/include\"/g' /etc/php/8.2/cli/php.ini
RUN sed -i '745 s/^[;]\? *include_path = .*/include_path = \".:\/var\/www\/html\/include\"/g' /etc/php/8.2/apache2/php.ini
# Executar o apache no usuário pbx
RUN sed -i 's/APACHE_RUN_USER=.*/APACHE_RUN_USER=pbx/g' /etc/apache2/envvars
RUN sed -i 's/APACHE_RUN_GROUP=.*/APACHE_RUN_GROUP=pbx/g' /etc/apache2/envvars
COPY docker-entrypoint.sh /
COPY supervisord.conf /etc/supervisor/supervisord.conf
#RUN sed -i "s/rtpend=.*/rtpend=10030/g" /etc/asterisk/rtp.conf
#RUN sed -i "s/hostname=.*/hostname=postgres/g" /etc/asterisk/cdr_pgsql.conf
#RUN sed -i "s/;nocolor = .*/nocolor = yes/g" /etc/asterisk/asterisk.conf
COPY etc/init.d/cnvrtd /etc/init.d/
COPY etc/init.d/rtabd /etc/init.d/
COPY etc/init.d/supervisor /etc/init.d/
COPY etc/init.d/functions /etc/init.d/
COPY config-docker.php /var/www/html/
RUN chmod 755 /etc/init.d/rtabd
RUN chmod 755 /etc/init.d/cnvrtd
RUN chmod 755 /etc/init.d/supervisor
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["supervisord","-n","-c","/etc/supervisor/supervisord.conf"]
#docker run -it -d --name v1712 -p 8080:80/tcp -p 5038:5038/tcp -p 5060:5060/udp -p 10000-10050:10000-10050/udp aplicativo

BIN
version_1.8.2/pabx/asterisk/var_lib_asterisk/astdb.sqlite3

Binary file not shown.

238
version_1.8.2/pabx/build-asterisk_php.sh

@ -0,0 +1,238 @@
#!/bin/bash
PROGNAME=$(basename $0)
if test -z ${ASTERISK_VERSION}; then
echo "${PROGNAME}: ASTERISK_VERSION required" >&2
exit 1
fi
set -ex
/usr/sbin/groupadd "pbx"
/usr/sbin/useradd -u $1 -s "/bin/bash" -d '/var/lib/asterisk/' 'pbx' -g 'pbx'
/usr/sbin/groupadd "aplicacao"
/usr/sbin/useradd -s "/bin/bash" -d '/tmp' 'aplicacao' -g 'aplicacao'
/usr/sbin/groupadd "simples"
/usr/sbin/useradd -s "/bin/bash" -m 'simples' -g 'simples'
#Remover o source.list e colocar o padrão
[ -f /etc/apt/sources.list ] && /bin/rm -f /etc/apt/sources.list
#[ -d /etc/apt/sources.list.d ] && /bin/rm -rf /etc/apt/souces.list.d/*
echo "#Principal repositório de Debian" > /etc/apt/sources.list
echo "deb http://deb.debian.org/debian/ bullseye main contrib non-free" >> /etc/apt/sources.list
echo "deb-src http://deb.debian.org/debian/ bullseye main contrib non-free" >> /etc/apt/sources.list
echo "" >> /etc/apt/sources.list
echo "deb http://deb.debian.org/debian/ bullseye-updates main contrib non-free" >> /etc/apt/sources.list
echo "deb-src http://deb.debian.org/debian/ bullseye-updates main contrib non-free" >> /etc/apt/sources.list
echo "" >> /etc/apt/sources.list
echo "# bullseye-updates, to get updates before a point release is made" >> /etc/apt/sources.list
echo "# see https://www.debian.org/doc/manuals/debian-reference/ch02.en.html#_updates_and_backports" >> /etc/apt/sources.list
echo "deb http://deb.debian.org/debian-security bullseye-security main" >> /etc/apt/sources.list
echo "deb-src http://deb.debian.org/debian-security bullseye-security main" >> /etc/apt/sources.list
apt-get -y update
apt-get install lsb-release apt-transport-https ca-certificates software-properties-common -y
apt-get install wget
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
apt-get -y update
apt-get install -y \
supervisor \
cron \
curl \
daemon \
libcurl4-openssl-dev \
libncurses-dev \
libssl-dev \
tar \
curl \
bison \
git \
vim \
apache2 \
libjansson-dev \
ffmpeg \
build-essential \
libedit-dev \
libsqlite3-dev \
uuid-dev \
libxml2-dev \
libspeex-dev \
libspeexdsp-dev \
libogg-dev \
libvorbis-dev \
libasound2-dev \
portaudio19-dev \
libcurl4-openssl-dev \
xmlstarlet \
bison \
flex \
libpq-dev \
unixodbc-dev \
libneon27-dev \
libgmime-3.0-dev \
liblua5.2-dev \
liburiparser-dev \
libxslt1-dev \
libssl-dev \
libmariadb-dev-compat \
libmariadb-dev \
libbluetooth-dev \
libradcli-dev \
freetds-dev \
libosptk-dev \
libjack-jackd2-dev \
libcap-dev \
libsnmp-dev \
libiksemel-dev \
libcorosync-common-dev \
libcpg-dev \
libcfg-dev \
libnewt-dev \
libpopt-dev \
libical-dev \
libspandsp-dev \
libresample1-dev \
libc-client2007e-dev \
binutils-dev \
libsrtp2-dev \
libgsm1-dev \
graphviz \
sudo \
zlib1g-dev \
libldap2-dev \
bzip2 \
libsrtp2-dev \
libopus-dev \
libvpx-dev \
patch \
php8.2 \
php8.2-cli \
php8.2-common \
php8.2-dev \
php8.2-gd \
php8.2-mbstring \
php8.2-mysql \
php8.2-common \
php8.2-snmp \
php8.2-soap \
php8.2-xml \
php8.2-xmlrpc \
php8.2-pgsql \
php8.2-curl
a2enmod proxy
a2enmod proxy_wstunnel
a2enmod ssl
a2enmod rewrite
### INSTALL CENTRAL SIMPLES IP ###
mkdir -p /usr/src/asterisk
cd /usr/src/asterisk
curl -vsL https://downloads.asterisk.org/pub/telephony/asterisk/old-releases/asterisk-13.38.3.tar.gz | tar --strip-components 1 -xz
# 1.5 jobs per core works out okay
: ${JOBS:=$(( $(nproc) + $(nproc) / 2 ))}
mkdir -p /etc/asterisk/ \
/var/spool/asterisk/fax
./configure --libdir=/usr/lib64 --with-pjproject-bundled --with-srtp=/usr/include/srtp2
make menuselect/menuselect menuselect-tree menuselect.makeopts
menuselect/menuselect --disable chan_pjsip menuselect.makeopts
menuselect/menuselect --enable chan_sip menuselect.makeopts
menuselect/menuselect --enable cdr_csv menuselect.makeopts
menuselect/menuselect --enable func_cdr menuselect.makeopts
menuselect/menuselect --enable cdr_pgsql menuselect.makeopts
menuselect/menuselect --enable codec_opus menuselect.makeopts
menuselect/menuselect --enable res_format_attr_opus menuselect.makeopts
menuselect/menuselect --enable res_crypto menuselect.makeopts
menuselect/menuselect --enable res_http_websocket menuselect.makeopts
menuselect/menuselect --enable res_ari menuselect.makeopts
menuselect/menuselect --enable res_stasis menuselect.makeopts
menuselect/menuselect --enable res_stun_monitor menuselect.makeopts
menuselect/menuselect --enable res_phoneprov menuselect.makeopts
menuselect/menuselect --enable res_odbc menuselect.makeopts
menuselect/menuselect --enable res_srtp menuselect.makeopts
# we don't need any sounds in docker, they will be mounted as volume
menuselect/menuselect --disable-category MENUSELECT_CORE_SOUNDS menuselect.makeopts
menuselect/menuselect --disable-category MENUSELECT_MOH menuselect.makeopts
menuselect/menuselect --disable-category MENUSELECT_EXTRA_SOUNDS menuselect.makeopts
make -j ${JOBS} all
make install
# copy default configs
# cp /usr/src/asterisk/configs/basic-pbx/*.conf /etc/asterisk/
make dist-clean
chown -R pbx:pbx /var/*/asterisk \
/usr/*/asterisk \
/usr/lib64/asterisk
chmod -R 750 /var/spool/asterisk
cd /
#sed -i 's/;nocolor = yes/nocolor = yes/g' /etc/asterisk/asterisk.conf
echo "/usr/lib64/" > /etc/ld.so.conf.d/local.conf
ldconfig
apt-get clean
apt-get autoremove -y
### CONFIGURANDO O PHP ###
sed -i 's/^error_reporting = .*/error_reporting = E_ALL | E_STRICT/g' /etc/php/8.2/cli/php.ini
sed -i 's/^error_reporting = .*/error_reporting = E_ALL | E_STRICT/g' /etc/php/8.2/apache2/php.ini
sed -i 's/display_errors = .*/display_errors = Off/g' /etc/php/8.2/cli/php.ini
sed -i 's/display_errors = .*/display_errors = Off/g' /etc/php/8.2/apache2/php.ini
sed -i 's/^display_startup_errors = .*/display_startup_errors = Off/g' /etc/php/8.2/cli/php.ini
sed -i 's/^display_startup_errors = .*/display_startup_errors = Off/g' /etc/php/8.2/apache2/php.ini
sed -i 's/^upload_max_filesize = .*/upload_max_filesize = 100M/g' /etc/php/8.2/cli/php.ini
sed -i 's/^upload_max_filesize = .*/upload_max_filesize = 100M/g' /etc/php/8.2/apache2/php.ini
sed -i 's/memory_limit = .*/memory_limit = -1/g' /etc/php/8.2/cli/php.ini
sed -i 's/memory_limit = .*/memory_limit = 256M/g' /etc/php/8.2/apache2/php.ini
sed -i 's/;error_log = php_errors.*/error_log = \/var\/log\/aplsimples.log/g' /etc/php/8.2/cli/php.ini
sed -i 's/;error_log = php_errors.*/error_log = \/var\/log\/aplsimples.log/g' /etc/php/8.2/apache2/php.ini
sed -i 's/^default_charset = .*/default_charset = "iso-8859-1"/g' /etc/php/8.2/cli/php.ini
sed -i 's/^default_charset = .*/default_charset = "iso-8859-1"/g' /etc/php/8.2/apache2/php.ini
sed -i '745s/^;include_path = .*/include_path = \".:\/var\/www\/html\/include::\/usr\/share\/pear:\/var\/www\/html\/include\/core\"/g' /etc/php/8.2/cli/php.ini
sed -i '745 s/^;include_path = .*/include_path = \".:\/var\/www\/html\/include::\/usr\/share\/pear:\/var\/www\/html\/include\/core\"/g' /etc/php/8.2/apache2/php.ini
sed -i 's/^;date.timezone =.*/date.timezone = "America\/Cuiaba"/g' /etc/php/8.2/cli/php.ini
sed -i 's/^;date.timezone =.*/date.timezone = "America\/Cuiaba"/g' /etc/php/8.2/apache2/php.ini
sed -i 's/^;openssl.cafile=.*/openssl.cafile = \/usr\/src\/certificates\/RootCA.pem/g' /etc/php/8.2/cli/php.ini
sed -i 's/^;openssl.capath=.*/openssl.capath = \/usr\/src\/certificates/g' /etc/php/8.2/cli/php.ini
sed -i 's/^;openssl.cafile=.*/openssl.cafile = \/usr\/src\/certificates\/RootCA.pem/g' /etc/php/8.2/apache2/php.ini
sed -i 's/^;openssl.capath=.*/openssl.capath = \/usr\/src\/certificates/g' /etc/php/8.2/apache2/php.ini
sed -i 's/^export APACHE_RUN_USER=.*/export APACHE_RUN_USER=pbx/g' /etc/apache2/envvars
sed -i 's/^export APACHE_RUN_GROUP=.*/export APACHE_RUN_GROUP=pbx/g' /etc/apache2/envvars
echo "export DB_HOST=${DB_HOST}" >> /etc/apache2/envvars
cd /var/www/html/
exec rm -f /build-asterisk.sh

20
version_1.8.2/pabx/certificados/RootCA.crt

@ -0,0 +1,20 @@
-----BEGIN CERTIFICATE-----
MIIDMTCCAhmgAwIBAgIUfwDYeruX8TSBfeO3MBY7/p6MuKEwDQYJKoZIhvcNAQEL
BQAwKDELMAkGA1UEBhMCQlIxGTAXBgNVBAMMEFNpbXBsZXNpcC1XZWJydGMwHhcN
MjQwNTI0MTU1NjUzWhcNMjcwMzE0MTU1NjUzWjAoMQswCQYDVQQGEwJCUjEZMBcG
A1UEAwwQU2ltcGxlc2lwLVdlYnJ0YzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC
AQoCggEBAO7PBUAHkpEz14HuK5WqtPVi+7YALsUQbalU1RGJ4MtSBC/OZCl+VuuG
rs4mTxil4XNcdSUjlCDxEoP078lwodMRmdyRA7mcyqjSt51AORnoMca7LYVCNSjw
hu7S8iBIGXRtaIFRnMmBz7IerdSpnxIDTnN0/VxBrTAH1V6U/8TT7Eb+rIQoQizP
CrOR4HnnTYgKpLKw97dsPA55tk3zLrDNU4lzXTK8E8ZVnx5B1meBa039R1kdhEWO
yYAJmyMOqh6Vw8BmjY8b6g25TRbbWTeAEWXkXqR/MZ6m4h1Xx/ff65dJm+POWQjr
YBXNfXfH5vUaM6QX7dlJngKMTCecya8CAwEAAaNTMFEwHQYDVR0OBBYEFG0L3bmP
JQd9PjReRfsSkpBWrqbTMB8GA1UdIwQYMBaAFG0L3bmPJQd9PjReRfsSkpBWrqbT
MA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAHqhBMDZHeb8lRDR
7+XNNLopBfCxQMTwNYjjz3w+kySrAkNOZdctgnhPvTXWnjuoe8fWQZKtp7Y627U1
bn0zYNJTF0Er53XD+20gyLecD1SSZyyGSUUZBe9dOCI7QVDKNsAIr2ldMZXIl8Fk
iWJ2wfa0CHvrnlcEDIySXpPMzj+QCr/hPFFovDTSEFVgeWoEyUZTCPex0xpnDbde
Zg4I462fg9drKLDSGkNS/dLlGXI2TRPpjBTnI03KlSZBSR4oT/N1On/NDf9P9NNb
yaKD/l5z2DOa0wfN9MXKaFY1mMWG2a35SYTZRvo5lsgpOe1oo+2PPlQPXdZsFHBG
QmN8i9g=
-----END CERTIFICATE-----

28
version_1.8.2/pabx/certificados/RootCA.key

@ -0,0 +1,28 @@
-----BEGIN PRIVATE KEY-----
MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDuzwVAB5KRM9eB
7iuVqrT1Yvu2AC7FEG2pVNURieDLUgQvzmQpflbrhq7OJk8YpeFzXHUlI5Qg8RKD
9O/JcKHTEZnckQO5nMqo0redQDkZ6DHGuy2FQjUo8Ibu0vIgSBl0bWiBUZzJgc+y
Hq3UqZ8SA05zdP1cQa0wB9VelP/E0+xG/qyEKEIszwqzkeB5502ICqSysPe3bDwO
ebZN8y6wzVOJc10yvBPGVZ8eQdZngWtN/UdZHYRFjsmACZsjDqoelcPAZo2PG+oN
uU0W21k3gBFl5F6kfzGepuIdV8f33+uXSZvjzlkI62AVzX13x+b1GjOkF+3ZSZ4C
jEwnnMmvAgMBAAECggEBAI7FS+E85b5TnRr71ijTdv5hoBTuRQfhy335zqx+nttP
fFtMbAt2keabjbSHqLAWtBOxCgQbIjsThTtI23a2FLlIg5EfTXfRqkOGPuoPdFPt
wpyKWSubKocATdtIWCM+l6FIq7rsnOzH4/EccFZ81jIBsgxKvBJE3ZKijEjQkZ0M
4kDmLXOHxmYaLcwViQREs/JMABkzFAtwZPVu3ipjeICKx1hLf4/BDGeVRwVDb6W+
AnKhs7CDkm8MBfrhFt1/vvahL6mVkysZ0qY0Moy9h2SE2K0u28Z0iD0OcrOG2CKI
ez3eVlxTFJ/nzRWKRPN3UR+zfoF2QdSnTrEAhwFp1kECgYEA+oUk+DWwAUwO6AcR
HAhU0RdwTr7o9Zn4mBtj+NNeJuuO0Ppy1/L5Qdp9tYmNTOyrkdXLlRyOwqsalyw+
JzvcZqhQQSeasOZIcEvb7qN67ZEgPx5TO4+zKrbYxYOKoF3Su/neS1XC1I6gd+Nm
13XwiKEVU3TcywcfpHWJ+R2Ajw8CgYEA9AhLd9ufwCZ0pRLC0RF0o21KZHMNNmNw
TjvpW9sgrXKLV2i3EZYiMvaeo9DxlSyTc7VPY+HO6xa62/bnTtOcURohleSCGo5b
mHCSi7Q8qQclAMe/6aJbF7TerSrXV9M7KmloEonXRGapj9ui+L1YjpmCHtFNjYZR
pvY6RegwG2ECgYEAo6MEmvy2kqJTukujaWQnwsxEl6ssEAEa2IBLtOSbw2BqUSbG
jTgwiEtngYTvvyd4ijHUYPneZlnNbKGBl68KMCQRB/4OlS5WcsOaTS6LxVHedlwg
ke8zYNs+jQV3L3kZhZ+ZDCxgruba+nSXYHWxQA24GGNlNVjZ2lrMXORgbRECgYEA
nboqxSp/45s3c2Zf4u+MWwENv0UZuhilgvt4RjWotlK9u15kTQqjyhrayHkJXGi2
WWhMCvvtWMeVOQ0pzio587WXFaHfcbinfSztmzyApKOIiCuTYDfe9sCh2H1DOHG/
4RbF/I15RK2yVNgaSvlfHrQbhT21CY9SgT7OxVZgmaECgYBD7N5Qan7sHa5erbbG
BRhoyTUieKHpPZik3EXWwhhJPkc5+hsJLLJvhH2By2FwOn0kCN21SkLgcvruFS4K
EGa6CuNA5oCEGqoiIVnbz1oqByaYRv3YDxxNDZMH+DNpmvbmKNOvaUBX1HEbMJtG
PSbAALwrxsh7o6bLnyfK4fcgIQ==
-----END PRIVATE KEY-----

20
version_1.8.2/pabx/certificados/RootCA.pem

@ -0,0 +1,20 @@
-----BEGIN CERTIFICATE-----
MIIDMTCCAhmgAwIBAgIUfwDYeruX8TSBfeO3MBY7/p6MuKEwDQYJKoZIhvcNAQEL
BQAwKDELMAkGA1UEBhMCQlIxGTAXBgNVBAMMEFNpbXBsZXNpcC1XZWJydGMwHhcN
MjQwNTI0MTU1NjUzWhcNMjcwMzE0MTU1NjUzWjAoMQswCQYDVQQGEwJCUjEZMBcG
A1UEAwwQU2ltcGxlc2lwLVdlYnJ0YzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC
AQoCggEBAO7PBUAHkpEz14HuK5WqtPVi+7YALsUQbalU1RGJ4MtSBC/OZCl+VuuG
rs4mTxil4XNcdSUjlCDxEoP078lwodMRmdyRA7mcyqjSt51AORnoMca7LYVCNSjw
hu7S8iBIGXRtaIFRnMmBz7IerdSpnxIDTnN0/VxBrTAH1V6U/8TT7Eb+rIQoQizP
CrOR4HnnTYgKpLKw97dsPA55tk3zLrDNU4lzXTK8E8ZVnx5B1meBa039R1kdhEWO
yYAJmyMOqh6Vw8BmjY8b6g25TRbbWTeAEWXkXqR/MZ6m4h1Xx/ff65dJm+POWQjr
YBXNfXfH5vUaM6QX7dlJngKMTCecya8CAwEAAaNTMFEwHQYDVR0OBBYEFG0L3bmP
JQd9PjReRfsSkpBWrqbTMB8GA1UdIwQYMBaAFG0L3bmPJQd9PjReRfsSkpBWrqbT
MA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAHqhBMDZHeb8lRDR
7+XNNLopBfCxQMTwNYjjz3w+kySrAkNOZdctgnhPvTXWnjuoe8fWQZKtp7Y627U1
bn0zYNJTF0Er53XD+20gyLecD1SSZyyGSUUZBe9dOCI7QVDKNsAIr2ldMZXIl8Fk
iWJ2wfa0CHvrnlcEDIySXpPMzj+QCr/hPFFovDTSEFVgeWoEyUZTCPex0xpnDbde
Zg4I462fg9drKLDSGkNS/dLlGXI2TRPpjBTnI03KlSZBSR4oT/N1On/NDf9P9NNb
yaKD/l5z2DOa0wfN9MXKaFY1mMWG2a35SYTZRvo5lsgpOe1oo+2PPlQPXdZsFHBG
QmN8i9g=
-----END CERTIFICATE-----

1
version_1.8.2/pabx/certificados/RootCA.srl

@ -0,0 +1 @@
346E4E2447EF354E42823606159D8A94EEC09982

7
version_1.8.2/pabx/certificados/domains.ext

@ -0,0 +1,7 @@
authorityKeyIdentifier=keyid,issuer
basicConstraints=CA:FALSE
keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment
subjectAltName = @alt_names
[alt_names]
DNS.1 = localhost
DNS.2 = 192.168.115.179

21
version_1.8.2/pabx/certificados/localhost.crt

@ -0,0 +1,21 @@
-----BEGIN CERTIFICATE-----
MIIDjDCCAnSgAwIBAgIUNG5OJEfvNU5CgjYGFZ2KlO7AmYIwDQYJKoZIhvcNAQEL
BQAwKDELMAkGA1UEBhMCQlIxGTAXBgNVBAMMEFNpbXBsZXNpcC1XZWJydGMwHhcN
MjQwNTI0MTU1OTI3WhcNMjcwMzE0MTU1OTI3WjB0MQswCQYDVQQGEwJCUjETMBEG
A1UECAwKTWF0b0dyb3NzbzEPMA0GA1UEBwwGQ3VpYWJhMSUwIwYDVQQKDBxTaW1w
bGVzaXAtd2VicnRjLWNlcnRpZmljYXRlMRgwFgYDVQQDDA9sb2NhbGhvc3QubG9j
YWwwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCdzuMBCNHuBNR9jcT1
ZFzXUKc/q1kGe/yJ25SBBgpfgRtgLoM1GV8LONIF2gVeS7amzp7Lxzhcm+G2EJBY
e9G+NotQhpE3t07nTp4tSp/sbwp159tkhqJwD4nouic4vwiNXpSsbIkVhVQRdSdw
sS0nG2hPUw9aM5PWSe29hCuGRMmaspmoXRInLZ1QgyRmI42oFxJ8bc6mNp7uBMF6
NbNfLLItiq9Zj65777zXjjtDL3wpmN/x8eaN0jqaGPHQyjMjrbEyrfOeZ71VCa2I
vI+qehrgAAXM583Krc5c/0SurEXWG5xIV+ysjUKBsw5AKeWg/T8rTvI0Hc1pFARt
28n7AgMBAAGjYjBgMB8GA1UdIwQYMBaAFG0L3bmPJQd9PjReRfsSkpBWrqbTMAkG
A1UdEwQCMAAwCwYDVR0PBAQDAgTwMCUGA1UdEQQeMByCCWxvY2FsaG9zdIIPMTky
LjE2OC4xMTUuMTc5MA0GCSqGSIb3DQEBCwUAA4IBAQCDiGyLu4e+gFVdSx2+pcdU
EgjCqoulBfeLhEi0s/N7ewWQGsTf7h5Ay6jhQGWcbJaMW2MV3UhfmrREWGLhWBD9
gJ9zqU2hTlD0ImXnsz4WEdltzWdP8VNhnWiXOH6lHIQaSHnMw+18JShuCIajBico
71ZWxnu0g3yTuTGEYnI4Ataqgn7JQzt+xSFXjjOfFdgYLRIn9gRjoA3W1tPYgfU0
hLF/ZCqY3DxmROvy1pUKS23CkwAcdg+EP5Vmpk1piCn0e/n+kRuGV4uqpqyoODtw
lN2Fw5aFEgCC79LnSbaGYFCvWY+OLzwtj8BD5UhE/LNDT765mPQFUETPgRYWLSzn
-----END CERTIFICATE-----

17
version_1.8.2/pabx/certificados/localhost.csr

@ -0,0 +1,17 @@
-----BEGIN CERTIFICATE REQUEST-----
MIICuTCCAaECAQAwdDELMAkGA1UEBhMCQlIxEzARBgNVBAgMCk1hdG9Hcm9zc28x
DzANBgNVBAcMBkN1aWFiYTElMCMGA1UECgwcU2ltcGxlc2lwLXdlYnJ0Yy1jZXJ0
aWZpY2F0ZTEYMBYGA1UEAwwPbG9jYWxob3N0LmxvY2FsMIIBIjANBgkqhkiG9w0B
AQEFAAOCAQ8AMIIBCgKCAQEAnc7jAQjR7gTUfY3E9WRc11CnP6tZBnv8iduUgQYK
X4EbYC6DNRlfCzjSBdoFXku2ps6ey8c4XJvhthCQWHvRvjaLUIaRN7dO506eLUqf
7G8KdefbZIaicA+J6LonOL8IjV6UrGyJFYVUEXUncLEtJxtoT1MPWjOT1kntvYQr
hkTJmrKZqF0SJy2dUIMkZiONqBcSfG3Opjae7gTBejWzXyyyLYqvWY+ue++81447
Qy98KZjf8fHmjdI6mhjx0MozI62xMq3znme9VQmtiLyPqnoa4AAFzOfNyq3OXP9E
rqxF1hucSFfsrI1CgbMOQCnloP0/K07yNB3NaRQEbdvJ+wIDAQABoAAwDQYJKoZI
hvcNAQELBQADggEBAEc7RJzFLFr/S/k7XV2CRaH4vRyrD3eo41EhkJtOkvle82bB
A4zrGnmg5ss2jgyv4RPTPxc/6+FXD1sFD8PH0H9aBqrOD2HWEHV+AhBhD3/nY9P/
PRcqcO0TS+6Xdft8GC9KHHGnwKROkrrgOAHj1JFdnmUVSi7kU0qkrqoNivXeqMry
kvgJf6+arSxNJBTDzuAdjA/BmJs6ocIpnLXMo4T7zN02mt92cFDkqQZbS89EBSiD
heyREeZZgauh04TbCgVf2nf98mBAupgBXFMAvT3i4+pa5S+brBZQNKQ1oDPC77at
hhwyV8AksnlBk8rBX83TCxNGTqE1Q1ljfFgSpvQ=
-----END CERTIFICATE REQUEST-----

28
version_1.8.2/pabx/certificados/localhost.key

@ -0,0 +1,28 @@
-----BEGIN PRIVATE KEY-----
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCdzuMBCNHuBNR9
jcT1ZFzXUKc/q1kGe/yJ25SBBgpfgRtgLoM1GV8LONIF2gVeS7amzp7Lxzhcm+G2
EJBYe9G+NotQhpE3t07nTp4tSp/sbwp159tkhqJwD4nouic4vwiNXpSsbIkVhVQR
dSdwsS0nG2hPUw9aM5PWSe29hCuGRMmaspmoXRInLZ1QgyRmI42oFxJ8bc6mNp7u
BMF6NbNfLLItiq9Zj65777zXjjtDL3wpmN/x8eaN0jqaGPHQyjMjrbEyrfOeZ71V
Ca2IvI+qehrgAAXM583Krc5c/0SurEXWG5xIV+ysjUKBsw5AKeWg/T8rTvI0Hc1p
FARt28n7AgMBAAECggEABGCq12qBOFMV+e2m2w/Pq4FnQlLkg1OJK+HVesbKHuAb
/E0OArkTc+I9oT/tCjKbfIEa0phSLe99EWngNzQoG1i0AKXa/WquW6hIpwT87rgd
2Ct4YI+DjgxATR5s3BwghptrEGVqYBh0vo87atrfX8hY2mp5cI0hur4OREWYV38h
18rILsATZHRSB4+h9oLHOPIcGpUV2Vr0mCUXU/OUdDLcCXBakB1U+npeacy1MKzL
5sb+hK5W2Xu2qWwYMSmFzbpmxNuUPDES7LSD8mL7jiBcKWO4pnh7EMwqO8Sf1BfO
B1smTSDymAd6QduvzhJPCzUOy3px/ZuSL/rNFLExAQKBgQDQtuM96Yh0OQX0lMbY
i2TJVaR08DkmpDMKsxOFgyTh4mR+LWhpaBmOLD/0prwcFZl/ZMkwCdeMEUoAo5x2
PFTaKXWSYgq632XQiojtQESICW/nKWhx0X0+MYsTmjjN0ZtBqPDPcr2id6wE+0T9
hbr9UbnxxynrFBZ8umtC+ImROwKBgQDBj4PithBNT1tpGiDnkxt1yWOKlMTKBdfv
CovsHhWMhQvCvnWiiG3OGkTrXtmWHLCpL2wXBz4vtDcY2jeJxBf+HfUF2ropSfKP
UlOZSpdMeMdqYmbZzIG4QRgqA23O6YJ+zYeBCYctn+Nz+Q98WCEFYq5SGncOcKLN
gb26fSseQQKBgQCe3IXMyyNkqz6gMlnD2x3ErV42793gTpzXKQTT28VH9YTeEXvm
tyi0cXPgqMSHb91c/P6xhNw+ra4xHFdsG3HOeD4YRG28XWvmtnuQchl3ng9B2N+5
umVk4Frmeb2A02kkKg3ZKJG0xvf09rhFa/Ou+vTYVerPFoQjPdWErR4wnwKBgQCA
WSrp7TIYIZQKuHGzPP/LdfQUk5t+HqvV7VdlBXniiOKIiwSz9uVg8lha/rUnbfTS
6wgwqPPabBTQ3PpQ1v/V2IV+EVC6SjeWQ8/9aNG0uq345DExIQOvazKbwVRSDNMk
RCMjNG83mLsZTsCvAj07NflDphrmL1g1D2AAxjkOQQKBgCDXz/EXXMDpEU02kYpV
ovVGQ0qUH2oZ+ATax34hNvsLEuzENkcUFzIqQjXxoxwylddFvaIhK0KWACy3WJDe
rhp89NJjvycKrzlYbs8sd5BdGfeqAKhXQxF8H4w+BBShRKzMA1iBr07hsn2gA1H7
tU9hcLllm+PQpHOHb5T9gR8P
-----END PRIVATE KEY-----

18
version_1.8.2/pabx/config-docker.php

@ -0,0 +1,18 @@
<?php
# Poderá ser acessado para configurar as informações de rede para
# o asterisk. Isso é feito para definir as redes
# definir tags no asterisk:
# externaddr
# localnet
# media_address
#
# Deve ser acessado com o ip (não 127.0.0.1)
# <ip>:8080/config-docker.php
$ip = explode(":", $_SERVER['HTTP_HOST'])[0];
$result_system=system("/config_network $ip", $qwe);
//echo "$result_system";
?>

40
version_1.8.2/pabx/config_network

@ -0,0 +1,40 @@
#!/bin/bash
IP_HOST="$1"
if [[ -z $IP_HOST ]];then
echo "Sem argumento IP. ERROR"
exit;
fi
if [[ -n "$(grep "externaddr=" /etc/asterisk/sip_general_customizado.conf )" ]]
then
sed -i "s/;\?externaddr=.*/externaddr=${IP_HOST}/g" /etc/asterisk/sip_general_customizado.conf
else
echo -e "\nexternaddr=${IP_HOST}" >> /etc/asterisk/sip_general_customizado.conf
fi
[[ $? -eq 0 ]] && echo "<h2>[ok] - definido externaddr=${IP_HOST}<br></h2>" || echo "<h2>[false] - externaddr nao definido</h2>"
if [[ -n "$(grep "localnet=" /etc/asterisk/sip_general_customizado.conf )" ]]
then
sed -i "s/;\?localnet=.*/localnet=0.0.0.0\/32/g" /etc/asterisk/sip_general_customizado.conf
else
echo "localnet=0.0.0.0/32" >> /etc/asterisk/sip_general_customizado.conf
fi
[[ $? -eq 0 ]] && echo "<h2>[ok] - definido localnet=0.0.0.0/32<br></h2>" || echo "<h2>[false] - localnet nao definido</h2>"
if [[ -n "$(grep "media_address=" /etc/asterisk/sip_general_customizado.conf)" ]]
then
sed -i "s/;\?media_address=.*/media_address=${IP_HOST}/g" /etc/asterisk/sip_general_customizado.conf
else
echo "media_address=${IP_HOST}" >> /etc/asterisk/sip_general_customizado.conf
fi
[[ $? -eq 0 ]] && echo "<h2>[ok] - definido media_address=${IP_HOST}<br></h2>" || echo "<h2>[false] - media_address nao definido</h2>"
asterisk -rx "sip reload"
[[ $? -eq 0 ]] && echo "<h2>[ok] - asterisk atualizado<br></h2>" || echo "<h2>[false] - nao carregado no asterisk</h2>"
echo "<h1>Concluido</h1>"

40
version_1.8.2/pabx/crontab.sh

@ -0,0 +1,40 @@
#!/bin/bash
echo "#Servicos Auxiliares" >> /etc/crontab
echo "0 0 * * * root /var/lib/asterisk/scripts/callcenter/reload.sh" >> /etc/crontab
echo "0 1 * * * root /hdaux/utilitarios/scripts/hd.sh " >> /etc/crontab
echo "*/1 * * * * root /var/lib/asterisk/scripts/callcenter/queue_log.php" >> /etc/crontab
echo "*/1 * * * * root /var/lib/asterisk/scripts/callcenter/monitora_agentes.php" >> /etc/crontab
echo "*/1 * * * * root /var/lib/asterisk/scripts/manutencaoDB/importaBilhetes.php" >> /etc/crontab
echo "*/30 * * * * root /var/lib/asterisk/scripts/portabilidade/atualiza_cliente.php" >> /etc/crontab
echo "*/1 * * * * root /var/lib/asterisk/scripts/workflow/workflowSender.php" >> /etc/crontab
echo "0 2 * * * root /var/lib/asterisk/scripts/manutencaoDB/manutencaodb.php" >> /etc/crontab
echo "#*/1 * * * * root /var/lib/asterisk/scripts/integracao/encerraChamada.php" >> /etc/crontab
echo "*/1 * * * * root /var/lib/asterisk/scripts/callcenter/atualizar-dacs.php" >> /etc/crontab
echo "*/1 * * * * root sleep 15 && /var/lib/asterisk/scripts/callcenter/atualizar-dacs.php" >> /etc/crontab
echo "*/1 * * * * root sleep 30 && /var/lib/asterisk/scripts/callcenter/atualizar-dacs.php" >> /etc/crontab
echo "*/1 * * * * root sleep 45 && /var/lib/asterisk/scripts/callcenter/atualizar-dacs.php" >> /etc/crontab
echo "#Transbordo Assistido" >> /etc/crontab
echo "*/1 * * * * root /var/lib/asterisk/scripts/callcenter/transbordo.php" >> /etc/crontab
echo "*/1 * * * * root sleep 15 && /var/lib/asterisk/scripts/callcenter/transbordo.php" >> /etc/crontab
echo "*/1 * * * * root sleep 30 && /var/lib/asterisk/scripts/callcenter/transbordo.php" >> /etc/crontab
echo "*/1 * * * * root sleep 45 && /var/lib/asterisk/scripts/callcenter/transbordo.php" >> /etc/crontab
echo "#Backup" >> /etc/crontab
echo "*/10 * * * * root /var/lib/asterisk/scripts/backup/backup.php" >> /etc/crontab
echo "#Backup - Shell" >> /etc/crontab
echo "0 1 * * * root /hdaux/utilitarios/scripts/backup.sh config,bd" >> /etc/crontab
echo "#VPN" >> /etc/crontab
echo "*/1 * * * * root /bin/sip_teste_vpn.sh" >> /etc/crontab
echo "#Remove Caixa Postal" >> /etc/crontab
echo "0 1 * * * root find /var/spool/asterisk/voicemail/default/ -iname *.WAV -mtime +10 -exec rm -rf {} \\;" >> /etc/crontab
echo "0 1 * * * root find /var/spool/asterisk/voicemail/default/ -iname *.txt -mtime +10 -exec rm -rf {} \\;" >> /etc/crontab
echo "#Limpa Maildrop" >> /etc/crontab
echo "0 6 * * * root for i in \$(ls -1 /var/spool/postfix/maildrop/) ; do /bin/rm -rf /var/spool/postfix/maildrop/\$i ; done" >> /etc/crontab
echo "#Bloqueio - SIP" >> /etc/crontab
echo "*/1 * * * * root /hdaux/utilitarios/scripts/bloqueia_autenticacao.sh" >> /etc/crontab
echo "#NTP" >> /etc/crontab
echo "*/15 * * * * root /hdaux/utilitarios/scripts/ntp.sh" >> /etc/crontab
echo "#Logrotate" >> /etc/crontab
echo "59 23 * * * root /hdaux/utilitarios/scripts/logrotate.sh --force" >> /etc/crontab
echo "57 23 * * * root /hdaux/utilitarios/scripts/temporizador_de_dados.sh" >> /etc/crontab

31
version_1.8.2/pabx/docker-entrypoint.sh

@ -0,0 +1,31 @@
#!/bin/sh
# run as user asterisk by default
ASTERISK_USER=${ASTERISK_USER:-asterisk}
if [ "$1" = "" ]; then
COMMAND="/usr/sbin/asterisk -T -W -U ${ASTERISK_USER} -p -vvvdddf"
else
COMMAND="$@"
fi
if [ "${ASTERISK_UID}" != "" ] && [ "${ASTERISK_GID}" != "" ]; then
# recreate user and group for asterisk
# if they've sent as env variables (i.e. to macth with host user to fix permissions for mounted folders
deluser asterisk && \
adduser --gecos "" --no-create-home --uid ${ASTERISK_UID} --disabled-password ${ASTERISK_USER} \
|| exit
fi
mkdir -p /var/run/asterisk
chown -R ${ASTERISK_USER}: /var/log/asterisk \
/var/lib/asterisk \
/var/run/asterisk \
/var/spool/asterisk; \
cp /var/www/html/config-docker.php /var/www/html/aplicativo/
/hdaux/utilitarios/scripts/permissoes_atualizacao.sh
exec ${COMMAND}

100
version_1.8.2/pabx/etc/apache2/sites-available/pabx_simples.conf

@ -0,0 +1,100 @@
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/aplicativo
SSLEngine on
SSLCertificateFile /usr/src/certificates/localhost.crt
SSLCertificateKeyFile /usr/src/certificates/localhost.key
#SSLCertificateFile /etc/asterisk/keys/asterisk.crt
#SSLCertificateKeyFile /etc/asterisk/keys/asterisk.key
Alias /gravacoes "/var/spool/asterisk/monitor"
<Directory "/var/spool/asterisk/monitor">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Require all granted
Allow from 127.0.0.1
</Directory>
Alias /agenda "/var/www/html/agenda"
<Directory "/var/www/html/agenda/">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Require all granted
Allow from all
</Directory>
Alias /downloads "/hdaux/downloads"
<Directory "/hdaux/downloads/">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Require all granted
Allow from all
</Directory>
Alias /ferramentas "/hdaux/utilitarios/ferramentas"
<Directory "/hdaux/utilitarios/ferramentas/">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Require all granted
Allow from all
</Directory>
Alias /manuais "/hdaux/utilitarios/manuais"
<Directory "/hdaux/utilitarios/manuais/">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Require all granted
Allow from all
</Directory>
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>
<VirtualHost *:8089>
ServerAdmin webmaster@localhost
ServerName localhost
DocumentRoot /var/www/html
SSLEngine on
SSLCertificateFile /usr/src/certificates/localhost.crt
SSLCertificateKeyFile /usr/src/certificates/localhost.key
#SSLCertificateFile /etc/asterisk/keys/asterisk.crt
#SSLCertificateKeyFile /etc/asterisk/keys/asterisk.key
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

BIN
version_1.8.2/pabx/etc/asterisk/-R

Binary file not shown.

80
version_1.8.2/pabx/etc/asterisk/acl.conf

@ -0,0 +1,80 @@
;
; Named Access Control Lists (ACLs)
;
; A convenient way to share acl definitions
;
; This configuration file is read on startup
;
; CLI Commands
; -----------------------------------------------------------
; acl show Show all named ACLs configured
; acl show <name> Show contents of a particular named ACL
; reload acl Reload configuration file
;
; Any configuration that uses ACLs which has been made to be able to use named
; ACLs will specify a named ACL with the 'acl' option in its configuration in
; a similar fashion to the usual 'permit' and 'deny' options. Example:
; acl=my_named_acl
;
; Multiple named ACLs can be applied by either comma separating the arguments or
; just by adding additional ACL lines. Example:
; acl=my_named_acl
; acl=my_named_acl2
;
; or
;
; acl=my_named_acl,my_named_acl2
;
; ACLs specified by name are evaluated independently from the ACL specified via
; permit/deny. In order for an address to pass a given ACL, it must pass both
; the ACL specified by permit/deny for a given item as well as any named ACLs
; that were specified.
;
;[example_named_acl1]
;deny=0.0.0.0/0.0.0.0
;permit=209.16.236.0
;permit=209.16.236.1
;
;[example_named_acl2]
;permit=0.0.0.0/0.0.0.0
;deny=10.24.20.171
;deny=10.24.20.103
;deny=209.16.236.1
;
; example_named_acl1 above shows an example of whitelisting. When whitelisting, the
; named ACLs should follow a deny that blocks everything (like deny=0.0.0.0/0.0.0.0)
; The following example explains how combining the ACLs works:
; <in another configuration>
; [example_item_with_acl]
; acl=example_named_acl1
; acl=example_named_acl2
;
; Suppose 209.16.236.0 tries to communicate and the ACL for that example is applied to it...
; First, example_named_acl1 is evaluated. The address is allowed by that ACL.
; Next, example_named_acl2 is evaluated. The address isn't blocked by example_named_acl2
; either, so it passes.
;
; Suppose instead 209.16.236.1 tries to communicate and the same ACL is applied.
; First, example_named_acl1 is evaluated and the address is allowed.
; However, it is blocked by example_named_acl2, so the address is blocked from the combined
; ACL.
;
; Similarly, the permits/denies in specific configurations that make up an ACL definition
; are also treated as a separate ACL for evaluation. So if we change the example above to:
; <in another configuration>
; [example_item_with_acl]
; acl=example_named_acl1
; acl=example_named_acl2
; deny=209.16.236.0
;
; Then 209.16.236.0 will be rejected by the non-named component of the combined ACL even
; though it passes the two named components.
;
;
; Named ACLs can use ipv6 addresses just like normal ACLs.
;[ipv6_example_1]
;deny = ::
;permit = ::1/128
;
;[ipv6_example_2]
;permit = fe80::21d:bad:fad:2323

8
version_1.8.2/pabx/etc/asterisk/adsi.conf

@ -0,0 +1,8 @@
;
; Sample ADSI Configuration file
;
[intro]
alignment = center
greeting => Welcome to the
greeting => Asterisk
greeting => Open Source PBX

39
version_1.8.2/pabx/etc/asterisk/adtranvofr.conf

@ -0,0 +1,39 @@
;
; Voice over Frame Relay (Adtran style)
;
; Configuration file
[interfaces]
;
; Default language
;
;language=en
;
; Lines for which we are the user termination. They accept incoming
; and outgoing calls. We use the default context on the first 8 lines
; used by internal phones.
;
context=default
;user => voice00
;user => voice01
;user => voice02
;user => voice03
;user => voice04
;user => voice05
;user => voice06
;user => voice07
; Calls on 16 and 17 come from the outside world, so they get
; a little bit special treatment
context=remote
;user => voice16
;user => voice17
;
; Next we have lines which we only accept calls on, and typically
; do not send outgoing calls on (i.e. these are where we are the
; network termination)
;
;network => voice08
;network => voice09
;network => voice10
;network => voice11
;network => voice12

6
version_1.8.2/pabx/etc/asterisk/agents.conf

@ -0,0 +1,6 @@
[general]
#include agents_general.conf
#include agents_general_customizado.conf
#include agents_adicional.conf
#include agents_usuarios.conf
#include agents_usuarios_customizado.conf

16
version_1.8.2/pabx/etc/asterisk/agents_adicional.conf

@ -0,0 +1,16 @@
[agents](!)
;maxlogintries=5
autologoff=0
;autologoffunavail=no
ackcall=no
;endcall=no
wrapuptime=0
musiconhold=agentes
;goodbye=
;updatecdr=no
;group=1
recordagentcalls=no
;recordformat=
;urlprefix=
;savecallsin=
custom_beep=beep

2
version_1.8.2/pabx/etc/asterisk/agents_general.conf

@ -0,0 +1,2 @@
;persistentagents=no
;multiplelogin=no

1
version_1.8.2/pabx/etc/asterisk/agents_general_customizado.conf

@ -0,0 +1 @@

4
version_1.8.2/pabx/etc/asterisk/agents_usuarios.conf

@ -0,0 +1,4 @@
[1000](agents)
fullname=admin
[1001](agents)
fullname=administrador

1
version_1.8.2/pabx/etc/asterisk/agents_usuarios_customizado.conf

@ -0,0 +1 @@

91
version_1.8.2/pabx/etc/asterisk/alarmreceiver.conf

@ -0,0 +1,91 @@
;
; alarmreceiver.conf
;
; Sample configuration file for the Asterisk alarm receiver application.
;
[general]
;
; Specify a timestamp format for the metadata section of the event files
; Default is %a %b %d, %Y @ %H:%M:%S %Z
timestampformat = %a %b %d, %Y @ %H:%M:%S %Z
;
; Specify a command to execute when the caller hangs up
;
; Default is none
;
;eventcmd = yourprogram -yourargs ...
;
; Specify a spool directory for the event files. This setting is required
; if you want the app to be useful. Event files written to the spool
; directory will be of the template event-XXXXXX, where XXXXXX is a random
; and unique alphanumeric string.
;
; Default is none, and the events will be dropped on the floor.
;
eventspooldir = /tmp
;
; The alarmreceiver app can either log the events one-at-a-time to individual
; files in the spool directory, or it can store them until the caller
; disconnects and write them all to one file.
;
; The default setting for logindividualevents is no.
;
logindividualevents = no
;
; The timeout for receiving the first DTMF digit is adjustable from 1000 msec.
; to 10000 msec. The default is 2000 msec. Note: if you wish to test the
; receiver by entering digits manually, set this to a reasonable time out
; like 10000 milliseconds.
fdtimeout = 2000
;
; The timeout for receiving subsequent DTMF digits is adjustable from
; 110 msec. to 4000 msec. The default is 200 msec. Note: if you wish to test
; the receiver by entering digits manually, set this to a reasonable time out
; like 4000 milliseconds.
;
sdtimeout = 200
;
; Wait for the connection to settle post-answer. Adjustable from 500 msec. to 10000 msec.
; The default is 1250 msec.
;
answait = 1250
; When logging individual events it may be desirable to skip grouping of metadata
;no_group_meta = yes
;
; The loudness of the ACK and Kissoff tones is adjustable from 100 to 8192.
; The default is 8192. This shouldn't need to be messed with, but is included
; just in case there are problems with signal levels.
;
loudness = 8192
;
; The db-family setting allows the user to capture statistics on the number of
; calls, and the errors the alarm receiver sees. The default is for no
; db-family name to be defined and the database logging to be turned off.
;
;db-family = yourfamily:
;
; End of alarmreceiver.conf
;

77
version_1.8.2/pabx/etc/asterisk/alsa.conf

@ -0,0 +1,77 @@
;
; Open Sound System Console Driver Configuration File
;
[general]
;
; Automatically answer incoming calls on the console? Choose yes if
; for example you want to use this as an intercom.
;
autoanswer=yes
;
; Default context (is overridden with @context syntax)
;
context=local
;
; Default extension to call
;
extension=s
;
; Default language
;
;language=en
;
; Default Music on Hold class to use when this channel is placed on hold in
; the case that the music class is not set on the channel with
; Set(CHANNEL(musicclass)=whatever) in the dialplan and the peer channel
; putting this one on hold did not suggest a class to use.
;
;mohinterpret=default
;
; Silence suppression can be enabled when sound is over a certain threshold.
; The value for the threshold should probably be between 500 and 2000 or so,
; but your mileage may vary. Use the echo test to evaluate the best setting.
;silencesuppression = yes
;silencethreshold = 1000
;
; To set which ALSA device to use, change this parameter
;input_device=hw:0,0
;output_device=hw:0,0
;
; Default mute state (can also be toggled via CLI)
;mute=true
;
; If enabled, no audio capture device will be opened. This is useful on
; systems where there will be no return audio path, such as overhead pagers.
;noaudiocapture=true
; ----------------------------- JITTER BUFFER CONFIGURATION --------------------------
; jbenable = yes ; Enables the use of a jitterbuffer on the receiving side of an
; ALSA channel. Defaults to "no". An enabled jitterbuffer will
; be used only if the sending side can create and the receiving
; side can not accept jitter. The ALSA channel can't accept jitter,
; thus an enabled jitterbuffer on the receive ALSA side will always
; be used if the sending side can create jitter.
; jbmaxsize = 200 ; Max length of the jitterbuffer in milliseconds.
; jbresyncthreshold = 1000 ; Jump in the frame timestamps over which the jitterbuffer is
; resynchronized. Useful to improve the quality of the voice, with
; big jumps in/broken timestamps, usually sent from exotic devices
; and programs. Defaults to 1000.
; jbimpl = fixed ; Jitterbuffer implementation, used on the receiving side of a SIP
; channel. Two implementations are currently available - "fixed"
; (with size always equals to jbmax-size) and "adaptive" (with
; variable size, actually the new jb of IAX2). Defaults to fixed.
; jbtargetextra = 40 ; This option only affects the jb when 'jbimpl = adaptive' is set.
; The option represents the number of milliseconds by which the new
; jitter buffer will pad its size. the default is 40, so without
; modification, the new jitter buffer will set its size to the jitter
; value plus 40 milliseconds. increasing this value may help if your
; network normally has low jitter, but occasionally has spikes.
; jblog = no ; Enables jitterbuffer frame logging. Defaults to "no".
; ----------------------------------------------------------------------------------

31
version_1.8.2/pabx/etc/asterisk/amd.conf

@ -0,0 +1,31 @@
;
; Answering Machine Detection Configuration
;
[general]
total_analysis_time = 5000 ; Maximum time allowed for the algorithm to decide
; on whether the audio represents a HUMAN, or a MACHINE
silence_threshold = 256 ; If the average level of noise in a sample does not reach
; this value, from a scale of 0 to 32767, then we will consider
; it to be silence.
; Greeting ;
initial_silence = 2500 ; Maximum silence duration before the greeting.
; If exceeded, then the result is detection as a MACHINE.
after_greeting_silence = 800 ; Silence after detecting a greeting.
; If exceeded, then the result is detection as a HUMAN
greeting = 1500 ; Maximum length of a greeting. If exceeded, then the
; result is detection as a MACHINE.
; Word detection ;
min_word_length = 100 ; Minimum duration of Voice to considered as a word
maximum_word_length = 5000 ; Maximum duration of a single Voice utterance allowed.
between_words_silence = 50 ; Minimum duration of silence after a word to consider
; the audio what follows as a new word
maximum_number_of_words = 3 ; Maximum number of words in the greeting
; If REACHED, then the result is detection as a MACHINE
; WARNING: Releases prior to January 1 2016 documented
; maximum_number_of_words as 'if exceeded, then MACHINE',
; which did not reflect the true functionality. In Asterisk 14,
; this functionality will change to reflect the variables' name.

24
version_1.8.2/pabx/etc/asterisk/app_mysql.conf

@ -0,0 +1,24 @@
; Configuration file for the MYSQL app addon
[general]
;
; Nullvalue governs how NULL values are returned from the database. In
; previous versions, the special NULL value was returned as the "NULL"
; string. We now provide an option for the behavior, configured globally.
; nullstring - the string "NULL"
; emptystring - the string ""
; null - unset the variable
;
; WARNING: setting nullvalue=null may have undesireable consequences, in
; particular if you use subroutines in AEL or the LOCAL() variable construct.
; You have been warned. Don't complain if you use that setting in combination
; with Gosub or AEL and get buggy behavior.
;
nullvalue = nullstring
; If set, autoclear will destroy allocated statement and connection resources
; when the channel ends. For most usage of the MYSQL app, this is what you
; want, but it's conceivable that somebody is sharing MYSQL connections across
; multiple channels, in which case, this should be set to 'no'. Defaults to
; 'no', as this was the original behavior.
autoclear=yes

27
version_1.8.2/pabx/etc/asterisk/app_skel.conf

@ -0,0 +1,27 @@
[general]
games=3
cheat=no
[sounds]
prompt=please-enter-your,number,queue-less-than
wrong_guess=vm-pls-try-again
right_guess=auth-thankyou
too_high=high
too_low=low
lose=vm-goodbye
[easy]
max_number=10
max_guesses=4
[medium]
max_number=100
max_guesses=6
[hard]
max_number=1000
max_guesses=7
[nightmare]
max_number=1000
max_guesses=1

0
version_1.8.2/pabx/etc/asterisk/applyzap.conf

30
version_1.8.2/pabx/etc/asterisk/ari.conf

@ -0,0 +1,30 @@
[general]
enabled = yes ; When set to no, ARI support is disabled.
;pretty = no ; When set to yes, responses from ARI are
; ; formatted to be human readable.
;allowed_origins = ; Comma separated list of allowed origins, for
; ; Cross-Origin Resource Sharing. May be set to * to
; ; allow all origins.
;auth_realm = ; Realm to use for authentication. Defaults to Asterisk
; ; REST Interface.
;
; Default write timeout to set on websockets. This value may need to be adjusted
; for connections where Asterisk must write a substantial amount of data and the
; receiving clients are slow to process the received information. Value is in
; milliseconds; default is 100 ms.
;websocket_write_timeout = 100
;[username]
;type = user ; Specifies user configuration
;read_only = no ; When set to yes, user is only authorized for
; ; read-only requests.
;
;password = ; Crypted or plaintext password (see password_format).
;
; password_format may be set to plain (the default) or crypt. When set to crypt,
; crypt(3) is used to validate the password. A crypted password can be generated
; using mkpasswd -m sha-512.
;
; When set to plain, the password is in plaintext.
;
;password_format = plain

57
version_1.8.2/pabx/etc/asterisk/ast_debug_tools.conf

@ -0,0 +1,57 @@
#
# This file is used by the Asterisk debug tools.
# Unlike other Asterisk config files, this one is
# "sourced" by bash and must adhere to bash semantics.
#
# A list of coredumps and/or coredump search patterns.
# Bash extended globs are enabled and any resulting files
# that aren't actually coredumps are silently ignored
# so you can be liberal with the globs.
#
# If your patterns contains spaces be sure to only quote
# the portion of the pattern that DOESN'T contain wildcard
# expressions. If you quote the whole pattern, it won't
# be expanded and the glob characters will be treated as
# literals.
#
# The exclusion of files ending ".txt" is just for
# demonstration purposes as non-coredumps will be ignored
# anyway.
COREDUMPS=(/tmp/core[-._]asterisk!(*.txt) /tmp/core[-._]$(hostname)!(*.txt))
# Date command for the "running" coredump and tarballs.
# DATEFORMAT will be executed to get the timestamp.
# Don't put quotes around the format string or they'll be
# treated as literal characters. Also be aware of colons
# in the output as you can't upload files with colons in
# the name to Jira.
#
# Unix timestamp
#DATEFORMAT='date +%s.%N'
#
# Unix timestamp on *BSD/MacOS after installing coreutils
#DATEFORMAT='gdate +%s.%N'
#
# Readable GMT
#DATEFORMAT='date -u +%FT%H-%M-%S%z'
#
# Readable Local time
DATEFORMAT='date +%FT%H-%M-%S%z'
# A list of log files and/or log file search patterns using the
# same syntax as COREDUMPS.
#
LOGFILES=(/var/log/asterisk/messages* /var/log/asterisk/queue* \
/var/log/asterisk/debug* /var/log/asterisk/security*)
# ast_loggrabber converts POSIX timestamps to readable format
# using this Python strftime format string. If not specified
# or an empty string, no format covnersion is done.
LOG_DATEFORMAT="%m/%d-%H:%M:%S.%f"
# The timezone to use when converting POSIX timestamps to
# readable format. It can be specified in "<continent>/<city>"
# format or in abbreviation format such as "CST6CDT". If not
# specified, the "local" timezone is used.
# LOG_TIMEZONE=

158
version_1.8.2/pabx/etc/asterisk/asterisk.adsi

@ -0,0 +1,158 @@
;
; Asterisk default ADSI script
;
;
; Begin with the preamble requirements
;
DESCRIPTION "Asterisk PBX" ; Name of vendor
VERSION 0x00 ; Version of stuff
;SECURITY "_AST" ; Security code
SECURITY 0X9BDBF7AC ; Security code
FDN 0x0000000F ; Descriptor number
;
; Flags
;
FLAG "nocallwaiting"
;
; Predefined strings
;
DISPLAY "titles" IS "** Asterisk PBX **"
DISPLAY "talkingto" IS "Call active." JUSTIFY LEFT
DISPLAY "callname" IS "$Call1p" JUSTIFY LEFT
DISPLAY "callnum" IS "$Call1s" JUSTIFY LEFT
DISPLAY "incoming" IS "Incoming call!" JUSTIFY LEFT
DISPLAY "ringing" IS "Calling... " JUSTIFY LEFT
DISPLAY "callended" IS "Call ended." JUSTIFY LEFT
DISPLAY "missedcall" IS "Missed call." JUSTIFY LEFT
DISPLAY "busy" IS "Busy." JUSTIFY LEFT
DISPLAY "reorder" IS "Reorder." JUSTIFY LEFT
DISPLAY "cwdisabled" IS "Callwait disabled"
DISPLAY "empty" IS "asdf"
;
; Begin soft key definitions
;
KEY "callfwd" IS "CallFwd" OR "Call Forward"
OFFHOOK
VOICEMODE
WAITDIALTONE
SENDDTMF "*60"
GOTO "offHook"
ENDKEY
KEY "vmail_OH" IS "VMail" OR "Voicemail"
OFFHOOK
VOICEMODE
WAITDIALTONE
SENDDTMF "8500"
ENDKEY
KEY "vmail" IS "VMail" OR "Voicemail"
SENDDTMF "8500"
ENDKEY
KEY "backspace" IS "BackSpc" OR "Backspace"
BACKSPACE
ENDKEY
KEY "cwdisable" IS "CWDsble" OR "Disable Call Wait"
SENDDTMF "*70"
SETFLAG "nocallwaiting"
SHOWDISPLAY "cwdisabled" AT 4
TIMERCLEAR
TIMERSTART 1
ENDKEY
KEY "cidblock" IS "CIDBlk" OR "Block Callerid"
SENDDTMF "*67"
SETFLAG "nocallwaiting"
ENDKEY
;
; Begin main subroutine
;
SUB "main" IS
IFEVENT NEARANSWER THEN
CLEAR
SHOWDISPLAY "titles" AT 1 NOUPDATE
SHOWDISPLAY "talkingto" AT 2 NOUPDATE
SHOWDISPLAY "callname" AT 3
SHOWDISPLAY "callnum" AT 4
GOTO "stableCall"
ENDIF
IFEVENT OFFHOOK THEN
CLEAR
CLEARFLAG "nocallwaiting"
CLEARDISPLAY
SHOWDISPLAY "titles" AT 1
SHOWKEYS "vmail"
SHOWKEYS "cidblock"
SHOWKEYS "cwdisable" UNLESS "nocallwaiting"
GOTO "offHook"
ENDIF
IFEVENT IDLE THEN
CLEAR
SHOWDISPLAY "titles" AT 1
SHOWKEYS "vmail_OH"
ENDIF
IFEVENT CALLERID THEN
CLEAR
; SHOWDISPLAY "titles" AT 1 NOUPDATE
; SHOWDISPLAY "incoming" AT 2 NOUPDATE
SHOWDISPLAY "callname" AT 3 NOUPDATE
SHOWDISPLAY "callnum" AT 4
ENDIF
IFEVENT RING THEN
CLEAR
SHOWDISPLAY "titles" AT 1 NOUPDATE
SHOWDISPLAY "incoming" AT 2
ENDIF
IFEVENT ENDOFRING THEN
SHOWDISPLAY "missedcall" AT 2
CLEAR
SHOWDISPLAY "titles" AT 1
SHOWKEYS "vmail_OH"
ENDIF
IFEVENT TIMER THEN
CLEAR
SHOWDISPLAY "empty" AT 4
ENDIF
ENDSUB
SUB "offHook" IS
IFEVENT FARRING THEN
CLEAR
SHOWDISPLAY "titles" AT 1 NOUPDATE
SHOWDISPLAY "ringing" AT 2 NOUPDATE
SHOWDISPLAY "callname" at 3 NOUPDATE
SHOWDISPLAY "callnum" at 4
ENDIF
IFEVENT FARANSWER THEN
CLEAR
SHOWDISPLAY "talkingto" AT 2
GOTO "stableCall"
ENDIF
IFEVENT BUSY THEN
CLEAR
SHOWDISPLAY "titles" AT 1 NOUPDATE
SHOWDISPLAY "busy" AT 2 NOUPDATE
SHOWDISPLAY "callname" at 3 NOUPDATE
SHOWDISPLAY "callnum" at 4
ENDIF
IFEVENT REORDER THEN
CLEAR
SHOWDISPLAY "titles" AT 1 NOUPDATE
SHOWDISPLAY "reorder" AT 2 NOUPDATE
SHOWDISPLAY "callname" at 3 NOUPDATE
SHOWDISPLAY "callnum" at 4
ENDIF
ENDSUB
SUB "stableCall" IS
IFEVENT REORDER THEN
SHOWDISPLAY "callended" AT 2
ENDIF
ENDSUB

114
version_1.8.2/pabx/etc/asterisk/asterisk.conf

@ -0,0 +1,114 @@
[directories](!)
astetcdir => /etc/asterisk
astmoddir => /usr/lib/asterisk/modules
astvarlibdir => /var/lib/asterisk
astdbdir => /var/lib/asterisk
astkeydir => /var/lib/asterisk
astdatadir => /var/lib/asterisk
astagidir => /var/lib/asterisk/agi-bin
astspooldir => /var/spool/asterisk
astrundir => /var/run/asterisk
astlogdir => /var/log/asterisk
astsbindir => /usr/sbin
[options]
verbose = 45
;debug = 3
;alwaysfork = yes ; Same as -F at startup.
;nofork = yes ; Same as -f at startup.
;quiet = yes ; Same as -q at startup.
;timestamp = yes ; Same as -T at startup.
;execincludes = yes ; Support #exec in config files.
;console = yes ; Run as console (same as -c at startup).
;highpriority = yes ; Run realtime priority (same as -p at
; startup).
;initcrypto = yes ; Initialize crypto keys (same as -i at
; startup).
nocolor = yes ; Disable console colors.
;dontwarn = yes ; Disable some warnings.
;dumpcore = yes ; Dump core on crash (same as -g at startup).
;languageprefix = yes ; Use the new sound prefix path syntax.
;systemname = my_system_name ; Prefix uniqueid with a system name for
; Global uniqueness issues.
;autosystemname = yes ; Automatically set systemname to hostname,
; uses 'localhost' on failure, or systemname if
; set.
;mindtmfduration = 80 ; Set minimum DTMF duration in ms (default 80 ms)
; If we get shorter DTMF messages, these will be
; changed to the minimum duration
;maxcalls = 10 ; Maximum amount of calls allowed.
;maxload = 0.9 ; Asterisk stops accepting new calls if the
; load average exceed this limit.
;maxfiles = 1000 ; Maximum amount of openfiles.
;minmemfree = 1 ; In MBs, Asterisk stops accepting new calls if
; the amount of free memory falls below this
; watermark.
;cache_record_files = yes ; Cache recorded sound files to another
; directory during recording.
;record_cache_dir = /tmp ; Specify cache directory (used in conjunction
; with cache_record_files).
;transmit_silence = yes ; Transmit silence while a channel is in a
; waiting state, a recording only state, or
; when DTMF is being generated. Note that the
; silence internally is generated in raw signed
; linear format. This means that it must be
; transcoded into the native format of the
; channel before it can be sent to the device.
; It is for this reason that this is optional,
; as it may result in requiring a temporary
; codec translation path for a channel that may
; not otherwise require one.
;transcode_via_sln = yes ; Build transcode paths via SLINEAR, instead of
; directly.
runuser = pbx ; The user to run as.
rungroup = pbx ; The group to run as.
;lightbackground = yes ; If your terminal is set for a light-colored
; background.
;forceblackbackground = yes ; Force the background of the terminal to be
; black, in order for terminal colors to show
; up properly.
;defaultlanguage = en ; Default language
documentation_language = en_US ; Set the language you want documentation
; displayed in. Value is in the same format as
; locale names.
;hideconnect = yes ; Hide messages displayed when a remote console
; connects and disconnects.
;lockconfdir = no ; Protect the directory containing the
; configuration files (/etc/asterisk) with a
; lock.
;stdexten = gosub ; How to invoke the extensions.conf stdexten.
; macro - Invoke the stdexten using a macro as
; done by legacy Asterisk versions.
; gosub - Invoke the stdexten using a gosub as
; documented in extensions.conf.sample.
; Default gosub.
;live_dangerously = no ; Enable the execution of 'dangerous' dialplan
; functions from external sources (AMI,
; etc.) These functions (such as SHELL) are
; considered dangerous because they can allow
; privilege escalation.
; Default no
;entityid=00:11:22:33:44:55 ; Entity ID.
; This is in the form of a MAC address.
; It should be universally unique.
; It must be unique between servers communicating
; with a protocol that uses this value.
; This is currently is used by DUNDi and
; Exchanging Device and Mailbox State
; using protocols: XMPP, Corosync and PJSIP.
;rtp_pt_dynamic = 96 ; Normally the Dynamic RTP Payload Type numbers
; are 96-127, which allow 32 formats. When you
; use more and receive the message "No Dynamic
; RTP mapping available", extend the dynamic
; range by going for 35 (or 0) instead of 96.
; This allows 29 (or 64) more formats. 96 is the
; default because any number below might be
; rejected by a remote implementation; although
; no such broken implementation is known, yet.
; Changing the following lines may compromise your security.
;[files]
;astctlpermissions = 0660
;astctlowner = root
;astctlgroup = apache
;astctl = asterisk.ctl

109
version_1.8.2/pabx/etc/asterisk/calendar.conf

@ -0,0 +1,109 @@
;[calendar1]
;type = ical ; type of calendar--currently supported: ical, caldav, exchange, or ews
;url = https://example.com/home/jdoe/Calendar/ ; URL to shared calendar (Zimbra example)
;user = jdoe ; web username
;secret = supersecret ; web password
;refresh = 15 ; refresh calendar every n minutes
;timeframe = 60 ; number of minutes of calendar data to pull for each refresh period
; ; should always be >= refresh
;
; You can set up res_calendar to execute a call upon an upcoming busy status
; The following fields are available from the ${CALENDAR_EVENT(<field>)} dialplan function:
;
; summary : The VEVENT Summary property or Exchange subject
; description : The text description of the vent
; organizer : The organizer of the event
; location : The location field of the event
; calendar : The name of the calendar tied to the event
; uid : The unique ID for this event
; start : Start time of the event
; end : The end time of the event
; busystate : 0=FREE, 1=TENTATIVE, 2=BUSY
;
;autoreminder = 10 ; Override event-defined reminder before each busy status (in mins)
;
;channel = SIP/60001 ; Channel to dial
;context = default ; Context to connect to on answer
;extension = 123 ; Extension to connect to on answer
;
; or
;
;app = Playback ; Application to execute on answer (instead of context/extension)
;appdata = tt-weasels ; Data part of application to execute on answer
;
;waittime = 30 ; How long to wait for an answer, defaults to 30 seconds
;
; Channel variables can be set on the notification channel. The format is
; setvar=name=value. Variable subsitution is done on the value to allow the use of dialplan
; functions like CALENDAR_EVENT. The variables are set in order, so one can use the value
; of earlier variables in the definition of later ones.
;
;setvar = CALLERID(name)=${CALENDAR_EVENT(summary)}
;[calendar2]
; Note: Support for Exchange Server 2003
;
;type = exchange ; type of calendar--currently supported: ical, caldav, exchange, or ews
;url = https://example.com/exchange/jdoe ; URL to MS Exchange OWA for user (usually includes exchange/user)
;user = jdoe ; Exchange username
;secret = mysecret ; Exchange password
;refresh = 15 ; refresh calendar every n minutes
;timeframe = 60 ; number of minutes of calendar data to pull for each refresh period
; ; should always be >= refresh
;
; You can set up res_calendar to execute a call upon an upcoming busy status
;autoreminder = 10 ; Override event-defined reminder before each busy status (in mins)
;
;channel = SIP/1234 ; Channel to dial
;context = default ; Context to connect to on answer
;extension = 1234 ; Extension to connect to on answer
;
; or
;
;[calendar3]
; Note: Support for Exchange Server 2007+
;
;type = ews ; type of calendar--currently supported: ical, caldav, exchange, or ews
;url = https://example.com/ews/Exchange.asmx ; URL to MS Exchange EWS
;user = jdoe ; Exchange username
;secret = mysecret ; Exchange password
;refresh = 15 ; refresh calendar every n minutes
;timeframe = 60 ; number of minutes of calendar data to pull for each refresh period
; ; should always be >= refresh
;
; You can set up res_calendar to execute a call upon an upcoming busy status
;autoreminder = 10 ; Override event-defined reminder before each busy status (in mins)
;
;channel = SIP/1234 ; Channel to dial
;context = default ; Context to connect to on answer
;extension = 1234 ; Extension to connect to on answer
;
; or
;
;app = Playback ; Application to execute on answer (instead of context/extension)
;appdata = tt-weasels ; Data part of application to execute on answer
;
;waittime = 30 ; How long to wait for an answer, defaults to 30 seconds
;[calendar4]
;type = caldav ; type of calendar--currently supported: ical, caldav, exchange, or ews
;url = https://www.google.com/calendar/dav/username@gmail.com/events/ ; Main GMail calendar (the trailing slash is significant!)
;user = jdoe@gmail.com ; username
;secret = mysecret ; password
;refresh = 15 ; refresh calendar every n minutes
;timeframe = 60 ; number of minutes of calendar data to pull for each refresh period
; ; should always be >= refresh
;
; You can set up res_calendar to execute a call upon an upcoming busy status
;autoreminder = 10 ; Override event-defined reminder before each busy status (in mins)
;
;channel = SIP/1234 ; Channel to dial
;context = default ; Context to connect to on answer
;extension = 1234 ; Extension to connect to on answer
;
; or
;
;app = Playback ; Application to execute on answer (instead of context/extension)
;appdata = tt-weasels ; Data part of application to execute on answer
;
;waittime = 30 ; How long to wait for an answer, defaults to 30 seconds

205
version_1.8.2/pabx/etc/asterisk/ccss.conf

@ -0,0 +1,205 @@
;
; --- Call Completion Supplementary Services ---
;
; For more information about CCSS, see the CCSS user documentation
; https://wiki.asterisk.org/wiki/display/AST/Call+Completion+Supplementary+Services+(CCSS)
;
[general]
; The cc_max_requests option is a global limit on the number of
; CC requests that may be in the Asterisk system at any time.
;
;cc_max_requests = 20
;
; The cc_STATE_devstate variables listed below can be used to change the
; default mapping of the internal state machine tracking the state of
; call completion to an Asterisk Device State value. The acceptable values
; that can be provided are as follows, with a description of what the
; equivalent device BLF that this maps to:
;
; UNKNOWN ; Device is valid but channel didn't know state
; NOT_INUSE ; Device is not used
; INUSE ; Device is in use
; BUSY ; Device is busy
; INVALID ; Device is invalid
; UNAVAILABLE ; Device is unavailable
; RINGING ; Device is ringing
; RINGINUSE ; Device is ringing *and* in use
; ONHOLD ; Device is on hold
;
; These states are used to generate DEVICE_STATE information that can be
; included with Asterisk hints for phones to subscribe to the state information
; or dialplan to check the state using the EXTENSION_STATE() function or
; the DEVICE_STATE() function.
;
; The states are in the format of: "ccss:TECH/ID" so an example of device
; SIP/3000 making a CallCompletionRequest() could be checked by looking at
; DEVICE_STATE(ccss:SIP/3000) or an Asterisk Hint could be generated such as
;
; [hint-context]
; exten => *843000,hint,ccss:SIP/3000
;
; and then accessed with EXTENSION_STATE(*843000@hint-context)
; or subscribed to with a BLF button on a phone.
;
; The available state mapping and default values are:
;
; cc_available_devstate = NOT_INUSE
; cc_offered_devstate = NOT_INUSE
; cc_caller_requested_devstate = NOT_INUSE
; cc_active_devstate = INUSE
; cc_callee_ready_devstate = INUSE
; cc_caller_busy_devstate = ONHOLD
; cc_recalling_devstate = RINGING
; cc_complete_devstate = NOT_INUSE
; cc_failed_devstate = NOT_INUSE
;
;============================================
; PLEASE READ THIS!!!
; The options described below should NOT be
; set in this file. Rather, they should be
; set per-device in a channel driver
; configuration file.
; PLEASE READ THIS!!!
;===========================================
;
; --------------------------------------------------------------------
; Timers
; --------------------------------------------------------------------
;There are three configurable timers for all types of CC: the
;cc_offer_timer, the ccbs_available_timer, and the ccnr_available_timer.
;In addition, when using a generic agent, there is a fourth timer,
;the cc_recall_timer. All timers are configured in seconds, and the
;values shown below are the defaults.
;
;When a caller is offered CCBS or CCNR, the cc_offer_timer will
;be started. If the caller does not request CC before the
;cc_offer_timer expires, then the caller will be unable to request
;CC for this call.
;
;cc_offer_timer = 20
;
;Once a caller has requested CC, then either the ccbs_available_timer
;or the ccnr_available_timer will run, depending on the service
;requested. The reason why there are two separate timers for CCBS
;and CCNR is that it is reasonable to want to have a shorter timeout
;configured for CCBS than for CCNR. If the available timer expires
;before the called party becomes available, then the CC attempt
;will have failed and monitoring of the called party will stop.
;
;ccbs_available_timer = 4800
;ccnr_available_timer = 7200
;
; When using a generic agent, the original caller is called back
; when one of the original called parties becomes available. The
; cc_recall_timer tells Asterisk how long it should let the original
; caller's phone ring before giving up. Please note that this parameter
; only affects operation when using a generic agent.
;
;cc_recall_timer = 20
; --------------------------------------------------------------------
; Policies
; --------------------------------------------------------------------
; Policy settings tell Asterisk how to behave and what sort of
; resources to allocate in order to facilitate CC. There are two
; settings to control the actions Asterisk will take.
;
; The cc_agent_policy describes the behavior that Asterisk will
; take when communicating with the caller during CC. There are
; three possible options.
;
;never: Never offer CC to the caller. Setting the cc_agent_policy
; to this value is the way to disable CC for a call.
;
;generic: A generic CC agent is one which uses no protocol-specific
; mechanisms to offer CC to the caller. Instead, the caller
; requests CC using a dialplan function. Due to internal
; restrictions, you should only use a generic CC agent on
; phones (i.e. not "trunks"). If you are using phones which
; do not support a protocol-specific method of using CC, then
; generic CC agents are what you should use.
;
;native: A native CC agent is one which uses protocol-specific
; signaling to offer CC to the caller and accept CC requests
; from the caller. The supported protocols for native CC
; agents are SIP, ISDN ETSI PTP, ISDN ETSI PTMP, and Q.SIG
;cc_agent_policy=never
;
; The cc_monitor_policy describes the behavior that Asterisk will
; take when communicating with the called party during CC. There
; are four possible options.
;
;never: Analogous to the cc_agent_policy setting. We will never
; attempt to request CC services on this interface.
;
;generic: Analogous to the cc_agent_policy setting. We will monitor
; the called party's progress using protocol-agnostic
; capabilities. Like with generic CC agents, generic CC
; monitors should only be used for phones.
;
;native: Analogous to the cc_agent_policy setting. We will use
; protocol-specific methods to request CC from this interface
; and to monitor the interface for availability.
;
;always: If an interface is set to "always," then we will accept
; protocol-specific CC offers from the caller and use
; a native CC monitor for the remainder of the CC transaction.
; However, if the interface does not offer protocol-specific
; CC, then we will fall back to using a generic CC monitor
; instead. This is a good setting to use for phones for which
; you do not know if they support protocol-specific CC
; methodologies.
;cc_monitor_policy=never
;
;
; --------------------------------------------------------------------
; Limits
; --------------------------------------------------------------------
;
; The use of CC requires Asterisk to potentially use more memory than
; some administrators would like. As such, it is a good idea to limit
; the number of CC requests that can be in the system at a given time.
; The values shown below are the defaults.
;
; The cc_max_agents setting limits the number of outstanding CC
; requests a caller may have at any given time. Please note that due
; to implementation restrictions, this setting is ignored when using
; generic CC agents. Generic CC agents may only have one outstanding
; CC request.
;
;cc_max_agents = 5
;
; The cc_max_monitors setting limits the number of outstanding CC
; requests can be made to a specific interface at a given time.
;
;cc_max_monitors = 5
;
; --------------------------------------------------------------------
; Other
; --------------------------------------------------------------------
;
; When using a generic CC agent, the caller who requested CC will be
; called back when a called party becomes available. When the caller
; answers his phone, the administrator may opt to have a macro run.
; What this macro does is up to the administrator. By default there
; is no callback macro configured.
;
;cc_callback_macro=
;
; Alternatively, the administrator may run a subroutine. By default
; there is no callback subroutine configured. The subroutine should
; be specified in the format: [[context,]exten,]priority
;
;cc_callback_sub=
;
; When using an ISDN phone and a generic CC agent, Asterisk is unable
; to determine the dialstring that should be used when calling back
; the original caller. Furthermore, if you desire to use any dialstring-
; specific options, such as distinctive ring, you must set this
; configuration option. For non-ISDN phones, it is not necessary to
; set this, since Asterisk can determine the dialstring to use since
; it is identical to the name of the calling device. By default, there
; is no cc_agent_dialstring set.
;
;cc_agent_dialstring=

167
version_1.8.2/pabx/etc/asterisk/cdr.conf

@ -0,0 +1,167 @@
;
; Asterisk Call Detail Record engine configuration
;
; CDR is Call Detail Record, which provides logging services via a variety of
; pluggable backend modules. Detailed call information can be recorded to
; databases, files, etc. Useful for billing, fraud prevention, compliance with
; Sarbanes-Oxley aka The Enron Act, QOS evaluations, and more.
;
[general]
; Define whether or not to use CDR logging. Setting this to "no" will override
; any loading of backend CDR modules. Default is "yes".
;enable=yes
; Define whether or not to log unanswered calls that don't involve an outgoing
; party. Setting this to "yes" will make calls to extensions that don't answer
; and don't set a B side channel (such as by using the Dial application)
; receive CDR log entries. If this option is set to "no", then those log
; entries will not be created. Unanswered Calls which get offered to an
; outgoing line will always receive log entries regardless of this option, and
; that is the intended behaviour.
;unanswered = no
unanswered = yes
; Define whether or not to log congested calls. Setting this to "yes" will
; report each call that fails to complete due to congestion conditions. Default
; is "no".
;congestion = no
; Normally, CDR's are not closed out until after all extensions are finished
; executing. By enabling this option, the CDR will be ended before executing
; the "h" extension and hangup handlers so that CDR values such as "end" and
; "billsec" may be retrieved inside of of this extension.
; The default value is "no".
;endbeforehexten=no
; Normally, the 'billsec' field logged to the backends (text files or databases)
; is simply the end time (hangup time) minus the answer time in seconds. Internally,
; asterisk stores the time in terms of microseconds and seconds. By setting
; initiatedseconds to 'yes', you can force asterisk to report any seconds
; that were initiated (a sort of round up method). Technically, this is
; when the microsecond part of the end time is greater than the microsecond
; part of the answer time, then the billsec time is incremented one second.
; The default value is "no".
;initiatedseconds=no
; Define the CDR batch mode, where instead of posting the CDR at the end of
; every call, the data will be stored in a buffer to help alleviate load on the
; asterisk server. Default is "no".
;
; WARNING WARNING WARNING
; Use of batch mode may result in data loss after unsafe asterisk termination
; ie. software crash, power failure, kill -9, etc.
; WARNING WARNING WARNING
;
;batch=no
; Define the maximum number of CDRs to accumulate in the buffer before posting
; them to the backend engines. 'batch' must be set to 'yes'. Default is 100.
;size=100
; Define the maximum time to accumulate CDRs in the buffer before posting them
; to the backend engines. If this time limit is reached, then it will post the
; records, regardless of the value defined for 'size'. 'batch' must be set to
; 'yes'. Note that time is in seconds. Default is 300 (5 minutes).
;time=300
; The CDR engine uses the internal asterisk scheduler to determine when to post
; records. Posting can either occur inside the scheduler thread, or a new
; thread can be spawned for the submission of every batch. For small batches,
; it might be acceptable to just use the scheduler thread, so set this to "yes".
; For large batches, say anything over size=10, a new thread is recommended, so
; set this to "no". Default is "no".
;scheduleronly=no
; When shutting down asterisk, you can block until the CDRs are submitted. If
; you don't, then data will likely be lost. You can always check the size of
; the CDR batch buffer with the CLI "cdr status" command. To enable blocking on
; submission of CDR data during asterisk shutdown, set this to "yes". Default
; is "yes".
;safeshutdown=yes
;
;
; CHOOSING A CDR "BACKEND" (what kind of output to generate)
;
; To choose a backend, you have to make sure either the right category is
; defined in this file, or that the appropriate config file exists, and has the
; proper definitions in it. If there are any problems, usually, the entry will
; silently ignored, and you get no output.
;
; Also, please note that you can generate CDR records in as many formats as you
; wish. If you configure 5 different CDR formats, then each event will be logged
; in 5 different places! In the example config files, all formats are commented
; out except for the cdr-csv format.
;
; Here are all the possible back ends:
;
; csv, custom, manager, odbc, pgsql, radius, sqlite, tds
; (also, mysql is available via the asterisk-addons, due to licensing
; requirements)
; (please note, also, that other backends can be created, by creating
; a new backend module in the source cdr/ directory!)
;
; Some of the modules required to provide these backends will not build or install
; unless some dependency requirements are met. Examples of this are pgsql, odbc,
; etc. If you are not getting output as you would expect, the first thing to do
; is to run the command "make menuselect", and check what modules are available,
; by looking in the "2. Call Detail Recording" option in the main menu. If your
; backend is marked with XXX, you know that the "configure" command could not find
; the required libraries for that option.
;
; To get CDRs to be logged to the plain-jane /var/log/asterisk/cdr-csv/Master.csv
; file, define the [csv] category in this file. No database necessary. The example
; config files are set up to provide this kind of output by default.
;
; To get custom csv CDR records, make sure the cdr_custom.conf file
; is present, and contains the proper [mappings] section. The advantage to
; using this backend, is that you can define which fields to output, and in
; what order. By default, the example configs are set up to mimic the cdr-csv
; output. If you don't make any changes to the mappings, you are basically generating
; the same thing as cdr-csv, but expending more CPU cycles to do so!
;
; To get manager events generated, make sure the cdr_manager.conf file exists,
; and the [general] section is defined, with the single variable 'enabled = yes'.
;
; For odbc, make sure all the proper libs are installed, that "make menuselect"
; shows that the modules are available, and the cdr_odbc.conf file exists, and
; has a [global] section with the proper variables defined.
;
; For pgsql, make sure all the proper libs are installed, that "make menuselect"
; shows that the modules are available, and the cdr_pgsql.conf file exists, and
; has a [global] section with the proper variables defined.
;
; For logging to radius databases, make sure all the proper libs are installed, that
; "make menuselect" shows that the modules are available, and the [radius]
; category is defined in this file, and in that section, make sure the 'radiuscfg'
; variable is properly pointing to an existing radiusclient.conf file.
;
; For logging to sqlite databases, make sure the 'cdr.db' file exists in the log directory,
; which is usually /var/log/asterisk. Of course, the proper libraries should be available
; during the 'configure' operation.
;
; For tds logging, make sure the proper libraries are available during the 'configure'
; phase, and that cdr_tds.conf exists and is properly set up with a [global] category.
;
; Also, remember, that if you wish to log CDR info to a database, you will have to define
; a specific table in that databse to make things work! See the doc directory for more details
; on how to create this table in each database.
;
[csv]
usegmtime=yes ; log date/time in GMT. Default is "no"
loguniqueid=yes ; log uniqueid. Default is "no"
loguserfield=yes ; log user field. Default is "no"
accountlogs=yes ; create separate log file for each account code. Default is "yes"
newcdrcolumns=yes ; Enable logging of post-1.8 CDR columns (peeraccount, linkedid, sequence).
; Default is "no".
;[radius]
;usegmtime=yes ; log date/time in GMT
;loguniqueid=yes ; log uniqueid
;loguserfield=yes ; log user field
; Set this to the location of the radiusclient-ng configuration file
; The default is /etc/radiusclient-ng/radiusclient.conf
;radiuscfg => /usr/local/etc/radiusclient-ng/radiusclient.conf

59
version_1.8.2/pabx/etc/asterisk/cdr_adaptive_odbc.conf

@ -0,0 +1,59 @@
; The point of this module is to allow you log whatever you like in terms of
; the CDR variables. Do you want to log uniqueid? Then simply ensure that
; your table has that column. If you don't want the column, ensure that it
; does not exist in the table structure. If you'd like to call uniqueid
; something else in your table, simply provide an alias in the configuration
; file that maps the standard CDR field name (uniqueid) to whatever column
; name you like. Perhaps you'd like some extra CDR values logged that aren't
; in the standard repertoire of CDR variables (some that come to mind are
; certain values used for LCR: route, per_minute_cost, and per_minute_price).
; Simply set those CDR variables in your dialplan, i.e. Set(CDR(route)=27),
; ensure that a corresponding column exists in your table, and cdr_adaptive_odbc
; will do the rest.
;
; This configuration defines the connections and tables for which CDRs may
; be populated. Each context specifies a different CDR table to be used.
;
; The columns in the tables should match up word-for-word (case-insensitive)
; to the CDR variables set in the dialplan. The natural advantage to this
; system is that beyond setting up the configuration file to tell you what
; tables to look at, there isn't anything more to do beyond creating the
; columns for the fields that you want, and populating the corresponding
; CDR variables in the dialplan. For the builtin variables only, you may
; create aliases for the real column name.
;
; Please note that after adding columns to the database, it is necessary to
; reload this module to get the new column names and types read.
;
; Warning: if you specify two contexts with exactly the same connection and
; table names, you will get duplicate records in that table. So be careful.
;
;[first]
;connection=mysql1
;table=cdr
;[second]
;connection=mysql1
;table=extracdr
;[third]
;connection=sqlserver
;table=AsteriskCDR
;schema=public ; for databases which support schemas
;usegmtime=yes ; defaults to no
;alias src => source
;alias channel => source_channel
;alias dst => dest
;alias dstchannel => dest_channel
;
; Any filter specified MUST match exactly or the CDR will be discarded
;filter accountcode => somename
;filter src => 123
; Negative filters are also now available
;filter src != 456
;
; Additionally, we now support setting static values per column. The reason
; for this is to allow different sections to specify different values for
; a certain named column, presumably separated by filters.
;static "Some Special Value" => identifier_code

16
version_1.8.2/pabx/etc/asterisk/cdr_custom.conf

@ -0,0 +1,16 @@
;
; Mappings for custom config file
;
; To get your CSV output in a format tailored to your liking, uncomment the
; following lines and look for the output in the cdr-custom directory (usually
; in /var/log/asterisk). Depending on which mapping you uncomment, you may see
; Master.csv, Simple.csv, or both.
;
[mappings]
Master.csv => ${CSV_QUOTE(${CDR(clid)})},${CSV_QUOTE(${CDR(src)})},${CSV_QUOTE(${CDR(dst)})},${CSV_QUOTE(${CDR(dcontext)})},${CSV_QUOTE(${CDR(channel)})},${CSV_QUOTE(${CDR(dstchannel)})},${CSV_QUOTE(${CDR(lastapp)})},${CSV_QUOTE(${CDR(lastdata)})},${CSV_QUOTE(${CDR(start)})},${CSV_QUOTE(${CDR(answer)})},${CSV_QUOTE(${CDR(end)})},${CSV_QUOTE(${CDR(duration)})},${CSV_QUOTE(${CDR(billsec)})},${CSV_QUOTE(${CDR(disposition)})},${CSV_QUOTE(${CDR(amaflags)})},${CSV_QUOTE(${CDR(accountcode)})},${CSV_QUOTE(${CDR(uniqueid)})},${CSV_QUOTE(${CDR(userfield)})},${CDR(sequence)},${CSV_QUOTE(${CDR(direcao)})},${CSV_QUOTE(${CDR(ramal_origem)})},${CSV_QUOTE(${CDR(fora_horario)})}
;
; High Resolution Time for billsec and duration fields
;Master.csv => ${CSV_QUOTE(${CDR(clid)})},${CSV_QUOTE(${CDR(src)})},${CSV_QUOTE(${CDR(dst)})},${CSV_QUOTE(${CDR(dcontext)})},${CSV_QUOTE(${CDR(channel)})},${CSV_QUOTE(${CDR(dstchannel)})},${CSV_QUOTE(${CDR(lastapp)})},${CSV_QUOTE(${CDR(lastdata)})},${CSV_QUOTE(${CDR(start)})},${CSV_QUOTE(${CDR(answer)})},${CSV_QUOTE(${CDR(end)})},${CSV_QUOTE(${CDR(duration,f)})},${CSV_QUOTE(${CDR(billsec,f)})},${CSV_QUOTE(${CDR(disposition)})},${CSV_QUOTE(${CDR(amaflags)})},${CSV_QUOTE(${CDR(accountcode)})},${CSV_QUOTE(${CDR(uniqueid)})},${CSV_QUOTE(${CDR(userfield)})},${CDR(sequence)}
;Simple.csv => ${CSV_QUOTE(${EPOCH})},${CSV_QUOTE(${CDR(src)})},${CSV_QUOTE(${CDR(dst)})}

6
version_1.8.2/pabx/etc/asterisk/cdr_manager.conf

@ -0,0 +1,6 @@
;
; Asterisk Call Management CDR
;
[general]
enabled = yes

62
version_1.8.2/pabx/etc/asterisk/cdr_mysql.conf

@ -0,0 +1,62 @@
;
; Note - if the database server is hosted on the same machine as the
; asterisk server, you can achieve a local Unix socket connection by
; setting hostname=localhost
;
; port and sock are both optional parameters. If hostname is specified
; and is not "localhost" (you can use address 127.0.0.1 instead), then
; cdr_mysql will attempt to connect to the port specified or use the
; default port. If hostname is not specified or if hostname is
; "localhost", then cdr_mysql will attempt to connect to the socket file
; specified by sock or otherwise use the default socket file.
;
;[global]
;hostname=database.host.name
;dbname=asteriskcdrdb
;table=cdr
;password=password
;user=asteriskcdruser
;port=3306
;sock=/tmp/mysql.sock
; By default CDRs are logged in the system's time zone
;cdrzone=UTC ; log CDRs with UTC
;usegmtime=yes ;log date/time in GMT. Default is "no"
;cdrzone=America/New_York ; or use a specific time zone
;
; If your system's locale differs from mysql database character set,
; cdr_mysql can damage non-latin characters in CDR variables. Use this
; option to protect your data.
;charset=koi8r
;
; Older versions of cdr_mysql set the calldate field to whenever the
; record was posted, rather than the start date of the call. This flag
; reverts to the old (incorrect) behavior. Note that you'll also need
; to comment out the "start=calldate" alias, below, to use this.
;compat=no
;
; ssl connections (optional)
;ssl_ca=<path to CA cert>
;ssl_cert=<path to cert>
;ssl_key=<path to keyfile>
;
; You may also configure the field names used in the CDR table.
;
[columns]
;static "<value>" => <column>
;alias <cdrvar> => <column>
alias start => calldate
;alias clid => <a_field_not_named_clid>
;alias src => <a_field_not_named_src>
;alias dst => <a_field_not_named_dst>
;alias dcontext => <a_field_not_named_dcontext>
;alias channel => <a_field_not_named_channel>
;alias dstchannel => <a_field_not_named_dstchannel>
;alias lastapp => <a_field_not_named_lastapp>
;alias lastdata => <a_field_not_named_lastdata>
;alias duration => <a_field_not_named_duration>
;alias billsec => <a_field_not_named_billsec>
;alias disposition => <a_field_not_named_disposition>
;alias amaflags => <a_field_not_named_amaflags>
;alias accountcode => <a_field_not_named_accountcode>
;alias userfield => <a_field_not_named_userfield>
;alias uniqueid => <a_field_not_named_uniqueid>

12
version_1.8.2/pabx/etc/asterisk/cdr_odbc.conf

@ -0,0 +1,12 @@
;
; cdr_odbc.conf
;
;[global]
;dsn=MySQL-test
;loguniqueid=yes
;dispositionstring=yes
;table=cdr ;"cdr" is default table name
;usegmtime=no ; set to "yes" to log in GMT
;hrtime=yes ;Enables microsecond accuracy with the billsec and duration fields
;newcdrcolumns=yes ; Enable logging of post-1.8 CDR columns (peeraccount, linkedid, sequence)

8
version_1.8.2/pabx/etc/asterisk/cdr_pgsql.conf

@ -0,0 +1,8 @@
[global]
hostname=postgres
port=5432
dbname=pbx
password=ctepgSQL
user=contacte
table=ast_bilhetes
encoding=LATIN1

10
version_1.8.2/pabx/etc/asterisk/cdr_sqlite3_custom.conf

@ -0,0 +1,10 @@
;
; Mappings for custom config file
;
[master] ; currently, only file "master.db" is supported, with only one table at a time.
;table => cdr
;columns => calldate, clid, dcontext, channel, dstchannel, lastapp, lastdata, duration, billsec, disposition, amaflags, accountcode, uniqueid, userfield, test
;values => '${CDR(start)}','${CDR(clid)}','${CDR(dcontext)}','${CDR(channel)}','${CDR(dstchannel)}','${CDR(lastapp)}','${CDR(lastdata)}','${CDR(duration)}','${CDR(billsec)}','${CDR(disposition)}','${CDR(amaflags)}','${CDR(accountcode)}','${CDR(uniqueid)}','${CDR(userfield)}','${CDR(test)}'
;Enable High Resolution Times for billsec and duration fields
;values => '${CDR(start)}','${CDR(clid)}','${CDR(dcontext)}','${CDR(channel)}','${CDR(dstchannel)}','${CDR(lastapp)}','${CDR(lastdata)}','${CDR(duration,f)}','${CDR(billsec,f)}','${CDR(disposition)}','${CDR(amaflags)}','${CDR(accountcode)}','${CDR(uniqueid)}','${CDR(userfield)}','${CDR(test)}'

83
version_1.8.2/pabx/etc/asterisk/cdr_syslog.conf

@ -0,0 +1,83 @@
;
; Asterisk Call Detail Records (CDR) - Syslog Backend
;
; The cdr_syslog module writes CDRs using the facilities provided by syslog.
;
; Not only must you configure cdr_syslog from this file (cdr_syslog.conf) but
; you will also need to make changes to your /etc/syslog.conf before CDRs will
; be written to syslog.
;
; As an example, you can add the following to /etc/syslog.conf:
;
; local4.info /var/log/asterisk-cdr.log
;
; And then instruct syslogd to re-read the configuration file by sending it a
; HUP signal. On Linux this can be done like this:
;
; kill -HUP `cat /var/run/syslogd.pid`
;
; Finally, you will need to uncomment the [cdr-simple] section below, and restart
; Asterisk. When calls are placed, you should start seeing records appear in
; /var/log/asterisk-cdr.log.
[general]
; Facility
;
; The 'facility' keyword specifies the syslog facility to use when writing out
; CDRs.
;
; Accepted values: One of the following:
; user, local0, local1, local2, local3, local4, local5, local6
; and local7.
;
; Note: Depending on your platform, the following may also be
; available:
; auth, authpriv, cron, daemon, ftp, kern, lpr, mail,
; news, syslog, and uucp.
;
; Default value: local4
;facility=local0
; Priority
;
; Use the 'priority' keyword to select which of the syslog priority levels to
; use when logging CDRs.
;
; Accepted values: One of the following:
; alert, crit, debug, emerg, err, info, notice, warning
; Default value: info
;priority=warn
; Note: The settings for 'facility' and 'priority' in the [general] section
; define the default values for all of the logging locations created
; below in separate sections.
;[cdr-master]
;facility = local5
;priority = debug
; Template
;
; The 'template' value allows you to specify a custom format for messages
; written to syslog. This is similar to how cdr_custom is configured.
;
; Allowed values: A diaplan style string.
; Default value: None, this is required field.
;
; Note: Because of the way substitution is done, the only meaningful values
; available when the record is logged are those available via the CDR()
; dialplan function. All other channel variables will be unavailable.
;template = "${CDR(clid)}","${CDR(src)}","${CDR(dst)}","${CDR(dcontext)}","${CDR(channel)}","${CDR(dstchannel)}","${CDR(lastapp)}","${CDR(lastdata)}","${CDR(start)}","${CDR(answer)}","${CDR(end)}","${CDR(duration)}","${CDR(billsec)}","${CDR(disposition)}","${CDR(amaflags)}","${CDR(accountcode)}","${CDR(uniqueid)}","${CDR(userfield)}"
; High Resolution Time for billsec and duration fields
;template = "${CDR(clid)}","${CDR(src)}","${CDR(dst)}","${CDR(dcontext)}","${CDR(channel)}","${CDR(dstchannel)}","${CDR(lastapp)}","${CDR(lastdata)}","${CDR(start)}","${CDR(answer)}","${CDR(end)}","${CDR(duration,f)}","${CDR(billsec,f)}","${CDR(disposition)}","${CDR(amaflags)}","${CDR(accountcode)}","${CDR(uniqueid)}","${CDR(userfield)}"
;[cdr-simple]
; Since we don't specify a facility or priority for this logging location, the
; records will use the defaults specified in the [general] section.
;template = "We received a call from ${CDR(src)}"

77
version_1.8.2/pabx/etc/asterisk/cdr_tds.conf

@ -0,0 +1,77 @@
;
; Asterisk Call Detail Records (CDR) - FreeTDS Backend
;
;[global]
; Connection
;
; Use the 'connection' keyword to specify one of the instance names from your
; 'freetds.conf' file. Note that 'freetds.conf' is not an Asterisk
; configuration file, but one specific to the FreeTDS library. See the FreeTDS
; documentation on 'freetds.conf' for more information:
;
; http://www.freetds.org/userguide/freetdsconf.htm
;
; Accepted values: One of the connections specified in freetds.conf
;connection=ConnectionFromFreeTDSConf
; Database Name
;
; The 'dbname' keyword specifies the database name to use when logging CDRs.
;
; Accepted values: Any valid database name
;dbname=AsteriskCDRs
; Database Table Name
;
; The 'table' keyword identifies which database table is used to log CDRs.
;
; Accepted value: Any valid table name
; Default value: If not specified, a table named 'cdr' is assumed
;table=cdr
; Credentials
;
; The 'username' and 'password' keywords specify the user credentials that
; Asterisk should use when connecting to the database.
;
; Accepted value: Any valid username and password
;username=mangUsr
;password=
; Language
;
; The 'language' keyword changes the language which are used for error and
; information messages returned by SQL Server. Each database and user has their
; own default value, and this default can be overriden here.
;
; Accepted value: Any language installed on the target SQL Server.
; Default value: us_english
;language=us_english
; Character Set
;
; The 'charset' setting is used to change the character set used when connecting
; to the database server. Each database and database user has their own
; character set setting, and this default can be overriden here.
;
; Accepted value: Any valid character set available on the target SQL server.
; Default value: iso_1
;charset=BIG5
; High Resolution Times
;
; The 'hrtime' setting is used to store high resolution (sub second) times for
; billsec and duration fields.
;
; Accepted value: true or false
; Default value: false
;hrtime=false

116
version_1.8.2/pabx/etc/asterisk/cel.conf

@ -0,0 +1,116 @@
;
; Asterisk Channel Event Logging (CEL)
;
; Channel Event Logging is a mechanism to provide fine-grained event information
; that can be used to generate billing information. Such event information can
; be recorded to various backend modules.
;
[general]
; CEL Activation
;
; Use the 'enable' keyword to turn CEL on or off.
;
; Accepted values: yes and no
; Default value: no
enable=no
; Application Tracking
;
; Use the 'apps' keyword to specify the list of applications for which you want
; to receive CEL events. This is a comma separated list of Asterisk dialplan
; applications, such as Dial, Queue, and Park.
;
; Accepted values: A comma separated list of Asterisk dialplan applications
; Default value: none
;
; Note: You may also use 'all' which will result in CEL events being reported
; for all Asterisk applications. This may affect Asterisk's performance
; significantly.
apps=dial,park
; Event Tracking
;
; Use the 'events' keyword to specify the list of events which you want to be
; raised when they occur. This is a comma separated list of the values in the
; table below.
;
; Accepted values: A comma separated list of one or more of the following:
; ALL -- Generate entries on all events
; CHAN_START -- The time a channel was created
; CHAN_END -- The time a channel was terminated
; ANSWER -- The time a channel was answered (ie, phone taken off-hook)
; HANGUP -- The time at which a hangup occurred
; BRIDGE_ENTER -- The time a channel was connected into a conference room
; BRIDGE_EXIT -- The time a channel was removed from a conference room
; APP_START -- The time a tracked application was started
; APP_END -- the time a tracked application ended
; PARK_START -- The time a call was parked
; PARK_END -- Unpark event
; BLINDTRANSFER -- When a blind transfer is initiated
; ATTENDEDTRANSFER -- When an attended transfer is initiated
; PICKUP -- This channel picked up the specified channel
; FORWARD -- This channel is being forwarded somewhere else
; LINKEDID_END -- The last channel with the given linkedid is retired
; USER_DEFINED -- Triggered from the dialplan, and has a name given by the
; user
; LOCAL_OPTIMIZE -- A local channel pair is optimizing away.
;
; Default value: none
; (Track no events)
events=APP_START,CHAN_START,CHAN_END,ANSWER,HANGUP,BRIDGE_ENTER,BRIDGE_EXIT
; Date Format
;
; Use the 'dateformat' keyword to specify the date format used when CEL events
; are raised.
;
; Accepted values: A strftime format string (see man strftime)
;
; Example: "%F %T"
; -> This gives the date and time in the format "2009-06-23 17:02:35"
;
; If this option is not specified, the default format is "<seconds>.<microseconds>"
; since epoch. The microseconds field will always be 6 digits in length, meaning it
; may have leading zeros.
;
;dateformat = %F %T
;
; Asterisk Manager Interface (AMI) CEL Backend
;
[manager]
; AMI Backend Activation
;
; Use the 'enable' keyword to turn CEL logging to the Asterisk Manager Interface
; on or off.
;
; Accepted values: yes and no
; Default value: no
;enabled=yes
; Use 'show_user_defined' to put "USER_DEFINED" in the EventName header,
; instead of (by default) just putting the user defined event name there.
; When enabled the UserDefType header is added for user defined events to
; provide the user defined event name.
;
;show_user_defined=yes
;
; RADIUS CEL Backend
;
[radius]
;
; Log date/time in GMT
;usegmtime=yes
;
; Set this to the location of the radiusclient-ng configuration file
; The default is /etc/radiusclient-ng/radiusclient.conf
;radiuscfg => /usr/local/etc/radiusclient-ng/radiusclient.conf
;

39
version_1.8.2/pabx/etc/asterisk/cel_custom.conf

@ -0,0 +1,39 @@
;
; Asterisk Channel Event Logging (CEL) - Custom CSV Backend
;
; This is the configuration file for the customizable CSV backend for CEL
; logging.
;
; In order to create custom CSV logs for CEL, uncomment the template below
; (Master.csv) and start Asterisk. Once CEL events are generated, a file will
; appear in the following location:
;
; /var/log/asterisk/cel-custom/Master.csv
;
; (Note that /var/log/asterisk is the default and may differ on your system)
;
; You can also create more than one template if desired. All logs will appear
; in the cel-custom directory under your Asterisk logs directory.
;
;
; Within a mapping, use the CALLERID() and CHANNEL() functions to retrieve
; details from the CEL event. There are also a few variables created by this
; module that can be used in a mapping:
;
; eventtype - The name of the CEL event.
; eventtime - The timestamp of the CEL event.
; eventenum - Like eventtype but is "USER_DEFINED" for a user defined event.
; userdeftype - User defined event type name from CELGenUserEvent().
; eventextra - Extra data included with this CEL event, typically along with
; an event of type USER_DEFINED from CELGenUserEvent().
; BRIDGEPEER - Bridged peer channel name at the time of the CEL event.
; CHANNEL(peer) could also be used.
;
;[mappings]
;Master.csv => ${CSV_QUOTE(${eventtype})},${CSV_QUOTE(${eventtime})},${CSV_QUOTE(${CALLERID(name)})},${CSV_QUOTE(${CALLERID(num)})},${CSV_QUOTE(${CALLERID(ANI)})},${CSV_QUOTE(${CALLERID(RDNIS)})},${CSV_QUOTE(${CALLERID(DNID)})},${CSV_QUOTE(${CHANNEL(exten)})},${CSV_QUOTE(${CHANNEL(context)})},${CSV_QUOTE(${CHANNEL(channame)})},${CSV_QUOTE(${CHANNEL(appname)})},${CSV_QUOTE(${CHANNEL(appdata)})},${CSV_QUOTE(${CHANNEL(amaflags)})},${CSV_QUOTE(${CHANNEL(accountcode)})},${CSV_QUOTE(${CHANNEL(uniqueid)})},${CSV_QUOTE(${CHANNEL(linkedid)})},${CSV_QUOTE(${BRIDGEPEER})},${CSV_QUOTE(${CHANNEL(userfield)})},${CSV_QUOTE(${userdeftype})},${CSV_QUOTE(${eventextra})}
[mappings]
Master.csv => ${CSV_QUOTE(${eventtype})},${CSV_QUOTE(${eventtime})},${CSV_QUOTE(${CALLERID(name)})},${CSV_QUOTE(${CALLERID(num)})},${CSV_QUOTE(${CALLERID(ANI)})},${CSV_QUOTE(${CALLERID(RDNIS)})},${CSV_QUOTE(${CALLERID(DNID)})},${CSV_QUOTE(${CHANNEL(exten)})},${CSV_QUOTE(${CHANNEL(context)})},${CSV_QUOTE(${CHANNEL(channame)})},${CSV_QUOTE(${CHANNEL(appname)})},${CSV_QUOTE(${CHANNEL(appdata)})},${CSV_QUOTE(${CHANNEL(amaflags)})},${CSV_QUOTE(${CHANNEL(accountcode)})},${CSV_QUOTE(${CHANNEL(uniqueid)})},${CSV_QUOTE(${CHANNEL(linkedid)})},${CSV_QUOTE(${BRIDGEPEER})},${CSV_QUOTE(${CHANNEL(userfield)})},${CSV_QUOTE(${userdeftype})},${CSV_QUOTE(${eventextra})}

108
version_1.8.2/pabx/etc/asterisk/cel_odbc.conf

@ -0,0 +1,108 @@
;
; Asterisk Channel Event Logging (CEL) - Adaptive ODBC Backend
;
; General module options category.
[general]
; Use 'show_user_defined' to put "USER_DEFINED" in the eventtype field,
; instead of (by default) just putting the user defined event name there.
;
;show_user_defined=yes
; This configuration defines the connections and tables for which CEL records
; may be populated. Each context specifies a different CEL table to be used.
;
; The columns in the tables should match up word-for-word (case-insensitive) to
; the CEL variables set in the dialplan. The natural advantage to this system
; is that beyond setting up the configuration file to tell you what tables to
; look at, there isn't anything more to do beyond creating the columns for the
; fields that you want, and populating the corresponding CEL variables in the
; dialplan.
;
; Please note that after adding columns to the database, it is necessary to
; reload this module to get the new column names and types read.
;
; Warning: if you specify two contexts with exactly the same connection and
; table names, you will get duplicate records in that table. So be careful.
;
; CEL FIELDS:
; eventtype
; CHANNEL_START = 1
; CHANNEL_END = 2
; HANGUP = 3
; ANSWER = 4
; APP_START = 5
; APP_END = 6
; BRIDGE_START = 7
; BRIDGE_END = 8
; CONF_START = 9
; CONF_END = 10
; PARK_START = 11
; PARK_END = 12
; BLINDTRANSFER = 13
; ATTENDEDTRANSFER = 14
; TRANSFER = 15
; HOOKFLASH = 16
; 3WAY_START = 17
; 3WAY_END = 18
; CONF_ENTER = 19
; CONF_EXIT = 20
; USER_DEFINED = 21
; LINKEDID_END = 22
; BRIDGE_UPDATE = 23
; PICKUP = 24
; FORWARD = 25
; eventtime (timeval, includes microseconds)
; userdeftype (set only if eventtype == USER_DEFINED)
; cid_name
; cid_num
; cid_ani
; cid_rdnis
; cid_dnid
; exten
; context
; channame
; appname
; appdata
; accountcode
; peeraccount
; uniqueid
; linkedid
; amaflags (an int)
; userfield
; peer
; extra
; The point of this module is to allow you log whatever you like in terms of the
; CEL variables. Do you want to log uniqueid? Then simply ensure that your
; table has that column. If you don't want the column, ensure that it does not
; exist in the table structure. If you'd like to call uniqueid something else
; in your table, simply provide an alias in this file that maps the standard CEL
; field name (uniqueid) to whatever column name you like.
;[first]
;connection=mysql1
;table=cel
;[second]
;connection=mysql1
;table=extracel
;[third]
;connection=sqlserver
;table=AsteriskCEL
;usegmtime=yes ; defaults to no
;allowleapsecond=no ; allow leap second in SQL column for eventtime, default yes.
;alias src => source
;alias channel => source_channel
;alias dst => dest
;alias dstchannel => dest_channel
; Any filter specified MUST match exactly or the event will be discarded
;filter accountcode => somename
;filter src => 123
; Additionally, we now support setting static values per column. Reason
; for this is to allow different sections to specify different values for
; a certain named column, presumably separated by filters.
;static "Some Special Value" => identifier_code

93
version_1.8.2/pabx/etc/asterisk/cel_pgsql.conf

@ -0,0 +1,93 @@
;
; Asterisk Channel Event Logging (CEL) - PostgreSQL Backend
;
; Sample Asterisk config file for CEL logging to PostgreSQL
;
; CEL field names:
;
; eventtype
; CHANNEL_START = 1
; CHANNEL_END = 2
; HANGUP = 3
; ANSWER = 4
; APP_START = 5
; APP_END = 6
; BRIDGE_START = 7
; BRIDGE_END = 8
; CONF_START = 9
; CONF_END = 10
; PARK_START = 11
; PARK_END = 12
; BLINDTRANSFER = 13
; ATTENDEDTRANSFER = 14
; TRANSFER = 15
; HOOKFLASH = 16
; 3WAY_START = 17
; 3WAY_END = 18
; CONF_ENTER = 19
; CONF_EXIT = 20
; USER_DEFINED = 21
; LINKEDID_END = 22
; BRIDGE_UPDATE = 23
; PICKUP = 24
; FORWARD = 25
; eventtime (timeval, includes microseconds)
; userdeftype (set only if eventtype == USER_DEFINED)
; cid_name
; cid_num
; cid_ani
; cid_rdnis
; cid_dnid
; exten
; context
; channame
; appname
; appdata
; accountcode
; peeraccount
; uniqueid
; linkedid
; amaflags (an int)
; userfield
; peer
; extra
;CREATE TABLE pbx_cel (
; id bigserial ,
; eventtype varchar (32) NOT NULL ,
; eventtime timestamp NOT NULL ,
; userdeftype varchar(256) NOT NULL ,
; cid_name varchar (128) NOT NULL ,
; cid_num varchar (128) NOT NULL ,
; cid_ani varchar (128) NOT NULL ,
; cid_rdnis varchar (128) NOT NULL ,
; cid_dnid varchar (128) NOT NULL ,
; exten varchar (128) NOT NULL ,
; context varchar (128) NOT NULL ,
; channame varchar (128) NOT NULL ,
; appname varchar (128) NOT NULL ,
; appdata varchar (128) NOT NULL ,
; amaflags int NOT NULL ,
; accountcode varchar (32) NOT NULL ,
; peeraccount varchar (32) NOT NULL ,
; uniqueid varchar (160) NOT NULL ,
; linkedid varchar (160) NOT NULL ,
; userfield varchar (256) NOT NULL ,
; peer varchar (128) NOT NULL
;);
[global]
; Use 'show_user_defined' to put "USER_DEFINED" in the eventtype field,
; instead of (by default) just putting the user defined event name there.
;
;show_user_defined=yes
hostname=127.0.0.1
port=5432
dbname=pbx
password=ctepgSQL
user=contacte
table=pbx_cel ;SQL table where CEL's will be inserted
;appname=asterisk ; Postgres application_name support (optional). Whitespace not allowed.

24
version_1.8.2/pabx/etc/asterisk/cel_sqlite3_custom.conf

@ -0,0 +1,24 @@
;
; Asterisk Channel Event Logging (CEL) - SQLite 3 Backend
;
;
; Mappings for sqlite3 config file
;
; Within a mapping, use the CALLERID() and CHANNEL() functions to retrieve
; details from the CEL event. There are also a few variables created by this
; module that can be used in a mapping:
;
; eventtype - The name of the CEL event.
; eventtime - The timestamp of the CEL event.
; eventenum - Like eventtype but is "USER_DEFINED" for a user defined event.
; userdeftype - User defined event type name from CELGenUserEvent().
; eventextra - Extra data included with this CEL event, typically along with
; an event of type USER_DEFINED from CELGenUserEvent().
; BRIDGEPEER - Bridged peer channel name at the time of the CEL event.
; CHANNEL(peer) could also be used.
;
;[master] ; currently, only file "master.db" is supported, with only one table at a time.
;table => cel
;columns => eventtype, eventtime, cidname, cidnum, cidani, cidrdnis, ciddnid, context, exten, channame, appname, appdata, amaflags, accountcode, uniqueid, userfield, peer, userdeftype, eventextra
;values => '${eventtype}','${eventtime}','${CALLERID(name)}','${CALLERID(num)}','${CALLERID(ANI)}','${CALLERID(RDNIS)}','${CALLERID(DNID)}','${CHANNEL(context)}','${CHANNEL(exten)}','${CHANNEL(channame)}','${CHANNEL(appname)}','${CHANNEL(appdata)}','${CHANNEL(amaflags)}','${CHANNEL(accountcode)}','${CHANNEL(uniqueid)}','${CHANNEL(userfield)}','${BRIDGEPEER}','${userdeftype}','${eventextra}'

69
version_1.8.2/pabx/etc/asterisk/cel_tds.conf

@ -0,0 +1,69 @@
;
; Asterisk Channel Event Logging (CEL) - FreeTDS Backend
;
;[global]
; Connection
;
; Use the 'connection' keyword to specify one of the instance names from your
; 'freetds.conf' file. Note that 'freetds.conf' is not an Asterisk
; configuration file, but one specific to the FreeTDS library. See the FreeTDS
; documentation on 'freetds.conf' for more information:
;
; http://www.freetds.org/userguide/freetdsconf.htm
;
; Accepted values: One of the connections specified in freetds.conf
;connection=ConnectionFromFreeTDSConf
; Database Name
;
; The 'dbname' keyword specifies the database name to use when logging CEL
; records.
;
; Accepted values: Any valid database name
;dbname=MalicoHN
; Database Table Name
;
; The 'table' keyword identifies which database table is used to log CEL
; records.
;
; Accepted value: Any valid table name
; Default value: If not specified, a table named 'cel' is assumed
;table=cel
; Credentials
;
; The 'username' and 'password' keywords specify the user credentials that
; Asterisk should use when connecting to the database.
;
; Accepted value: Any valid username and password
;username=mangUsr
;password=
; Language
;
; The 'language' keyword changes the language which are used for error and
; information messages returned by SQL Server. Each database and user has their
; own default value, and this default can be overriden here.
;
; Accepted value: Any language installed on the target SQL Server.
; Default value: Server default
;language=us_english
; Character Set
;
; The 'charset' setting is used to change the character set used when connecting
; to the database server. Each database and database user has their own
; character set setting, and this default can be overriden here.
;
; Accepted value: Any valid character set available on the target server.
; Default value: Server setting
;charset=BIG5

7
version_1.8.2/pabx/etc/asterisk/chan_dahdi.conf

@ -0,0 +1,7 @@
[trunkgroups]
[channels]
#include chan_dahdi_troncos.conf
#include chan_dahdi_troncos_general.conf
#include chan_dahdi_ramais_general.conf
#include chan_dahdi_ramais.conf

0
version_1.8.2/pabx/etc/asterisk/chan_dahdi_ramais.conf

21
version_1.8.2/pabx/etc/asterisk/chan_dahdi_ramais_general.conf

@ -0,0 +1,21 @@
;Config. Portas FXS
language=pt_br
usecallerid=yes
callwaiting=no
usecallingpres=yes
callwaitingcallerid=yes
threewaycalling=yes
transfer=yes
canpark=yes
cancallforward=yes
callreturn=yes
;rxgain=3
;txgain=-7
rxgain=0
txgain=-6
echocancel=128
echocancelwhenbridged=yes
echotraining=yes
relaxdtmf=yes
rxflash=600
group=10

0
version_1.8.2/pabx/etc/asterisk/chan_dahdi_troncos.conf

15
version_1.8.2/pabx/etc/asterisk/chan_dahdi_troncos_general.conf

@ -0,0 +1,15 @@
language=pt_br
usecallerid=yes
callwaiting=no
usecallingpres=yes
callwaitingcallerid=yes
;rxgain=1
;txgain=-7
;rxgain=4
;txgain=4
;echocancel=128
;echocancelwhenbridged=yes
;echotraining=yes
;busydetect=yes
;busycount=4
relaxdtmf=yes

69
version_1.8.2/pabx/etc/asterisk/chan_mobile.conf

@ -0,0 +1,69 @@
;
; chan_mobile.conf
; configuration file for chan_mobile
;
[general]
interval=30 ; Number of seconds between trying to connect to devices.
; The following is a list of adapters we use.
; id must be unique and address is the bdaddr of the adapter from hciconfig.
; Each adapter may only have one device (headset or phone) connected at a time.
; Add an [adapter] entry for each adapter you have.
[adapter]
id=blue
address=00:09:DD:60:01:A3
;forcemaster=yes ; attempt to force adapter into master mode. default is no.
;alignmentdetection=yes ; enable this if you sometimes get 'white noise' on asterisk side of the call
; its a bug in the bluetooth adapter firmware, enabling this will compensate for it.
; default is no.
[adapter]
id=dlink
address=00:80:C8:35:52:78
; The following is a list of the devices we deal with.
; Every device listed below will be available for calls in and out of Asterisk.
; Each device needs an adapter=xxxx entry which determines which bluetooth adapter is used.
; Use the CLI command 'mobile search' to discover devices.
; Use the CLI command 'mobile show devices' to see device status.
;
; To place a call out through a mobile phone use Dial(Mobile/[device]/NNN.....) or Dial(Mobile/gn/NNN......) in your dialplan.
; To call a headset use Dial(Mobile/[device]).
[LGTU550]
address=00:E0:91:7F:46:44 ; the address of the phone
port=4 ; the rfcomm port number (from mobile search)
context=incoming-mobile ; dialplan context for incoming calls
adapter=dlink ; adapter to use
group=1 ; this phone is in channel group 1
;sms=no ; support SMS, defaults to yes
;nocallsetup=yes ; set this only if your phone reports that it supports call progress notification, but does not do it. Motorola L6 for example.
[blackberry]
address=00:60:57:32:7E:B2
port=2
context=incoming-mobile
adapter=dlink
group=1
;blackberry=yes ; set this if you are using a blackberry device
[6310i]
address=00:60:57:32:7E:B1
port=13
context=incoming-mobile
adapter=dlink
group=1 ; this phone is in channel group 1 also.
[headset]
address=00:0B:9E:11:AE:C6
port=1
type=headset ; This is a headset, not a Phone !
adapter=blue
[headset1]
address=00:0B:9E:11:74:A5
port=1
type=headset
adapter=dlink

12
version_1.8.2/pabx/etc/asterisk/cli.conf

@ -0,0 +1,12 @@
;
; Asterisk CLI configuration
;
[startup_commands]
;
; Any commands listed in this section will get automatically executed
; when Asterisk starts as a daemon or foreground process (-c).
;
;sip set debug on = yes
;core set verbose 3 = yes
;core set debug 1 = yes

203
version_1.8.2/pabx/etc/asterisk/cli_aliases.conf

@ -0,0 +1,203 @@
;
; CLI Aliases configuration
;
; This module also registers a "cli show aliases" CLI command to list
; configured CLI aliases.
[general]
; Here you define what alias templates you want to use. You can also define
; multiple templates to use as well. If you do, and there is a conflict, then
; the first alias defined will win.
;
template = friendly ; By default, include friendly aliases
;template = asterisk_1dot2 ; Asterisk 1.2 style syntax
;template = asterisk_1dot4 ; Asterisk 1.4 style syntax
;template = individual_custom ; see [individual_custom] example below which
; includes a list of aliases from an external
; file
; Because the Asterisk CLI syntax follows a "module verb argument" syntax,
; sometimes we run into an issue between being consistant with this format
; in the core system, and maintaining system friendliness. In order to get
; around this we're providing some useful aliases by default.
;
[friendly]
hangup request=channel request hangup
originate=channel originate
help=core show help
pri intense debug span=pri set debug intense span
reload=module reload
pjsip reload=module reload res_pjsip.so res_pjsip_authenticator_digest.so res_pjsip_endpoint_identifier_ip.so res_pjsip_mwi.so res_pjsip_notify.so res_pjsip_outbound_publish.so res_pjsip_publish_asterisk.so res_pjsip_outbound_registration.so
; CLI Alias Templates
; -------------------
;
; You can define several alias templates.
; It works with context templates like all other configuration files
;
;[asterisk](!)
; To create an alias you simply set the variable name as the alias and variable
; value as the real CLI command you want executed
;
;die die die=stop now
;[asterisk_1dot6](asterisk)
; Alias for making voicemail reload actually do module reload app_voicemail.so
;voicemail reload=module reload app_voicemail.so
; This will make the CLI command "mr" behave as though it is "module reload".
;mr=module reload
;
;
; In addition, you could also include a flat file of aliases which is loaded by
; the [individual_custom] template in the [general] section.
;
;[individual_custom]
;#include "/etc/asterisk/aliases"
; Implemented CLI Alias Templates
; -------------------------------
;
; Below here we have provided you with some templates, easily allowing you to
; utilize previous Asterisk CLI commands with any version of Asterisk. In this
; way you will be able to use Asterisk 1.2 and 1.4 style CLI syntax with any
; version Asterisk going forward into the future.
;
; We have also separated out the vanilla syntax into a context template which
; allows you to keep your custom changes separate of the standard templates
; we have provided you. In this way you can clearly see your custom changes,
; and also allowing you to combine various templates as you see fit.
;
; The naming scheme we have used is recommended, but certainly is not enforced
; by Asterisk. If you wish to use the provided templates, simply define the
; context name which does not utilize the '_tpl' at the end. For example,
; if you would like to use the Asterisk 1.2 style syntax, define in the
; [general] section
[asterisk_1dot2_tpl](!)
show channeltypes=core show channeltypes
show channeltype=core show channeltype
show manager command=manager show command
show manager commands=manager show commands
show manager connected=manager show connected
show manager eventq=manager show eventq
rtp no debug=rtp set debug off
rtp rtcp debug ip=rtcp debug ip
rtp rtcp debug=rtcp debug
rtp rtcp no debug=rtcp debug off
rtp rtcp stats=rtcp stats
rtp rtcp no stats=rtcp stats off
stun no debug=stun debug off
udptl no debug=udptl debug off
show image formats=core show image formats
show file formats=core show file formats
show applications=core show applications
show functions=core show functions
show switches=core show switches
show hints=core show hints
show globals=core show globals
show function=core show function
show application=core show application
set global=core set global
show dialplan=dialplan show
show codecs=core show codecs
show audio codecs=core show audio codecs
show video codecs=core show video codecs
show image codecs=core show image codecs
show codec=core show codec
moh classes show=moh show classes
moh files show=moh show files
agi no debug=agi debug off
show agi=agi show
dump agihtml=agi dumphtml
show features=feature show
show indications=indication show
answer=console answer
hangup=console hangup
flash=console flash
dial=console dial
mute=console mute
unmute=console unmute
transfer=console transfer
send text=console send text
autoanswer=console autoanswer
oss boost=console boost
console=console active
save dialplan=dialplan save
add extension=dialplan add extension
remove extension=dialplan remove extension
add ignorepat=dialplan add ignorepat
remove ignorepat=dialplan remove ignorepat
include context=dialplan add include
dont include=dialplan remove include
extensions reload=dialplan reload
show translation=core show translation
convert=file convert
show queue=queue show
add queue member=queue add member
remove queue member=queue remove member
ael no debug=ael nodebug
sip debug=sip set debug
sip no debug=sip set debug off
show voicemail users=voicemail show users
show voicemail zones=voicemail show zones
iax2 trunk debug=iax2 set debug trunk
iax2 jb debug=iax2 set debug jb
iax2 no debug=iax2 set debug off
iax2 no trunk debug=iax2 set debug trunk off
iax2 no jb debug=iax2 set debug jb off
show agents=agent show
show agents online=agent show online
show memory allocations=memory show allocations
show memory summary=memory show summary
show version=core show version
show version files=core show file version
show profile=core show profile
clear profile=core clear profile
soft hangup=channel request hangup
[asterisk_1dot2](asterisk_1dot2_tpl)
; add any additional custom commands you want below here, for example:
;die quickly=stop now
[asterisk_1dot4_tpl](!)
cdr status=cdr show status
rtp debug=rtp set debug on
rtcp debug=rtcp set debug on
rtcp stats=rtcp set stats on
stun debug=stun set debug on
udptl debug=udptl set debug on
core show globals=dialplan show globals
core set global=dialplan set global
core set chanvar=dialplan set chanvar
agi dumphtml=agi dump html
ael debug=ael set debug
funcdevstate list=devstate list
sip history=sip set history on
skinny debug=skinny set debug on
mgcp set debug=mgcp set debug on
abort shutdown=core abort shutdown
stop now=core stop now
stop gracefully=core stop gracefully
stop when convenient=core stop when convenient
restart now=core restart now
restart gracefully=core restart gracefully
restart when convenient=core restart when convenient
soft hangup=channel request hangup
[asterisk_1dot4](asterisk_1dot4_tpl)
; add any additional custom commands you want below here.
[asterisk_11_tpl](!)
jabber list nodes=xmpp list nodes
jabber purge nodes=xmpp purge nodes
jabber delete node=xmpp delete node
jabber create collection=xmpp create collection
jabber create leaf=xmpp create leaf
jabber set debug=xmpp set debug
jabber show connections=xmpp show connections
jabber show buddies=xmpp show buddies
features reload=module reload features
[asterisk_11](asterisk_11_tpl)
; add any additional custom commands you want below here.

82
version_1.8.2/pabx/etc/asterisk/cli_permissions.conf

@ -0,0 +1,82 @@
;
; CLI permissions configuration example for Asterisk
;
; All the users that you want to connect with asterisk using
; rasterisk, should have write/read access to the
; asterisk socket (asterisk.ctl). You could change the permissions
; of this file in 'asterisk.conf' config parameter: 'astctlpermissions' (0666)
; found on the [files] section.
;
; general options:
;
; default_perm = permit | deny
; This is the default permissions to apply for a user that
; does not has a permissions definided.
;
; user options:
; permit = <command name> | all ; allow the user to run 'command' |
; ; allow the user to run 'all' the commands
; deny = <command name> | all ; disallow the user to run 'command' |
; ; disallow the user to run 'all' commands.
;
[general]
default_perm=permit ; To leave asterisk working as normal
; we should set this parameter to 'permit'
;
; Follows the per-users permissions configs.
;
; This list is read in the sequence that is being written, so
; In this example the user 'eliel' is allow to run only the following
; commands:
; sip show peer
; core set debug
; core set verbose
; If the user is not specified, the default_perm option will be apply to
; every command.
;
; Notice that you can also use regular expressions to allow or deny access to a
; certain command like: 'core show application D*'. In this example the user will be
; allowed to view the documentation for all the applications starting with 'D'.
; Another regular expression could be: 'channel originate SIP/[0-9]* extension *'
; allowing the user to use 'channel originate' on a sip channel and with the 'extension'
; parameter and avoiding the use of the 'application' parameter.
;
; We can also use the templates syntax:
; [supportTemplate](!)
; deny=all
; permit=sip show ; all commands starting with 'sip show' will be allowed
; permit=core show
;
; You can specify permissions for a local group instead of a user,
; just put a '@' and we will know that is a group.
; IMPORTANT NOTE: Users permissions overwrite group permissions.
;
;[@adm]
;deny=all
;permit=sip
;permit=core
;
;
;[eliel]
;deny=all
;permit=sip show peer
;deny=sip show peers
;permit=core set
;
;
;User 'tommy' inherits from template 'supportTemplate':
; deny=all
; permit=sip show
; permit=core show
;[tommy](supportTemplate)
;permit=core set debug
;permit=dialplan show
;
;
;[mark]
;deny=all
;permit=all
;
;

206
version_1.8.2/pabx/etc/asterisk/codecs.conf

@ -0,0 +1,206 @@
[speex]
; CBR encoding quality [0..10]
; used only when vbr = false
quality => 3
; codec complexity [0..10]
; tradeoff between cpu/quality
complexity => 2
; perceptual enhancement [true / false]
; improves clarity of decoded speech
enhancement => true
; voice activity detection [true / false]
; reduces bitrate when no voice detected, used only for CBR
; (implicit in VBR/ABR)
vad => true
; variable bit rate [true / false]
; uses bit rate proportionate to voice complexity
vbr => true
; available bit rate [bps, 0 = off]
; encoding quality modulated to match this target bit rate
; not recommended with dtx or pp_vad - may cause bandwidth spikes
abr => 0
; VBR encoding quality [0-10]
; floating-point values allowed
vbr_quality => 4
; discontinuous transmission [true / false]
; stops transmitting completely when silence is detected
; pp_vad is far more effective but more CPU intensive
dtx => false
; preprocessor configuration
; these options only affect Speex v1.1.8 or newer
; enable preprocessor [true / false]
; allows dsp functionality below but incurs CPU overhead
preprocess => false
; preproc voice activity detection [true / false]
; more advanced equivalent of DTX, based on voice frequencies
pp_vad => false
; preproc automatic gain control [true / false]
pp_agc => false
pp_agc_level => 8000
; preproc denoiser [true / false]
pp_denoise => false
; preproc dereverb [true / false]
pp_dereverb => false
pp_dereverb_decay => 0.4
pp_dereverb_level => 0.3
[plc]
; for all codecs which do not support native PLC
; this determines whether to perform generic PLC
; there is a minor performance penalty for this
genericplc => true
; Generate custom formats for formats requiring attributes.
; After defining the custom format, the name used in defining
; the format can be used throughout Asterisk in the format 'allow'
; and 'disallow' options.
;
; Example: silk8 is a predefined custom format in this config file.
; Once this config file is loaded, silk8 can be used anywhere a
; peer's codec capabilities are defined.
;
; In sip.conf 'silk8' can be defined as a capability for a peer.
; [peer1]
; type=peer
; host=dynamic
; disallow=all
; allow=silk8 ;custom codec defined in codecs.conf
;
; LIMITATIONS
; Custom formats can only be defined at startup. Any changes to this
; file made after startup will not take into effect until after Asterisk
; is restarted.
;
; Default Custom SILK format definitions, only one custom SILK format per
; sample rate is allowed.
[silk8]
type=silk
samprate=8000
fec=true ; turn on or off encoding with forward error correction.
; On recommended, off by default.
packetloss_percentage=10 ; Estimated packet loss percentage in uplink direction. This
; affects how much redundancy is built in when using fec.
; The higher the percentage, the larger amount of bandwidth is
; used. Default is 0%, 10% is recommended when fec is in use.
maxbitrate=10000 ; Use the table below to make sure a useful bitrate is choosen
; for maxbitrate. If not set or value is not within the bounds
; of the encoder, a default value is chosen.
;
; sample rate | bitrate range
; 8khz | 5000 - 20000 bps
; 12khz | 7000 - 25000 bps
; 16khz | 8000 - 30000 bps
; 24khz | 20000- 40000 bps
;
;dtx=true ; Encode using discontinuous transmission mode or not. Turning this
; on will save bandwidth during periods of silence at the cost of
; increased computational complexity. Off by default.
[silk12]
type=silk
samprate=12000
maxbitrate=12000
fec=true
packetloss_percentage=10;
[silk16]
type=silk
samprate=16000
maxbitrate=20000
fec=true
packetloss_percentage=10;
[silk24]
type=silk
samprate=24000
maxbitrate=30000
fec=true
packetloss_percentage=10;
; Default custom CELT codec definitions. Only one custom CELT definition is allowed
; per a sample rate.
;[celt44]
;type=celt
;samprate=44100 ; The samplerate in hz. This option is required.
;framesize=480 ; The framesize option represents the duration of each frame in samples.
; This must be a factor of 2. This option is only advertised in an SDP
; when it is set. Otherwise a default of framesize of 480 is assumed
; internally
;[celt48]
;type=celt
;samprate=48000
;[celt32]
;type=celt
;samprate=32000
;============================ OPUS Section Options ============================
;
;[opus]
;type= ; Must be of type "opus" (default: "")
;packet_loss= ; Encoder's packet loss percentage. Can be any number between 0
; and 100, inclusive. A higher value results in more loss
; resistance. (default: 0)
;complexity= ; Encoder's computational complexity. Can be any number between 0
; and 10, inclusive. Note, 10 equals the highest complexity.
; (default: 10)
;max_bandwidth= ; Encoder's maximum bandwidth allowed. Sets an upper bandwidth
; bound on the encoder. Can be any of the following: narrow,
; medium, wide, super_wide, full. (default: full)
;signal= ; Encoder's signal type. Aids in mode selection on the encoder: Can
; be any of the following: auto, voice, music. (default: auto)
;application= ; Encoder's application type. Can be any of the following: voip,
; audio, low_delay. (default: voip)
;max_playback_rate= ; Override the maximum playback rate in the offer's SDP.
; Any value between 8000 and 48000 (inclusive) is valid,
; however typically it should match one of the usual opus
; bandwidths. A value of "sdp" is also allowed. When set
; to "sdp" then the value from the offer's SDP is used.
; (default: "sdp")
;bitrate= ; Override the maximum average bitrate in the offer's SDP. Any value
; between 500 and 512000 is valid. The following values are also
; allowed: auto, max, sdp. When set to "sdp" then the value from
; the offer's sdp is used. (default: "sdp")
;cbr= ; Override the constant bit rate parameter in the offer's SDP. A value of
; 0/false/no represents a variable bit rate whereas 1/true/yes represents
; a constant bit rate. A value of "sdp" is also allowed. When set to "sdp"
; then the value from the offer's sdp is used. (default: "sdp")
;fec= ; Override the use inband fec parameter in the offer's SDP. A value of
; 0/false/no represents disabled whereas 1/true/yes represents enabled.
; A value of "sdp" is also allowed. When set to "sdp" then the value from
; the offer's sdp is used. (default: "sdp")
;dtx= ; Override the use dtx parameter in the offer's SDP. A value of 0/false/no
; represents disabled whereas 1/true/yes represents enabled. A value of
; "sdp" is also allowed. When set to "sdp" then the value from the offer's
; sdp is used. (default: "sdp")
;=============================== OPUS Examples ================================
;
;[opus]
;type=opus
;max_playback_rate=8000 ; Limit the maximum playback rate on the encoder
;fec=no ; Force no inband fec on the encoder (i.e don't use what's on the SDP)
;[myopus]
;type=opus
;max_bandwidth=wide ; Maximum encoded bandwidth set to wide band (0-8000 Hz
; ; audio bandwidth at 16Khz sample rate)
;cbr=yes ; Force a constant bit rate (i.e don't use what's on the SDP)

12
version_1.8.2/pabx/etc/asterisk/confbridge.conf

@ -0,0 +1,12 @@
[general]
[default_user_simplesip]
type=user
dtmf_passthrough=no
dsp_silence_threshold=2500
dsp_drop_silence=yes
[simplesip_menu]
type=menu
1=dialplan_exec(adiciona-conferencia,1,1)
2=admin_kick_last
9=admin_toggle_mute_participants

46
version_1.8.2/pabx/etc/asterisk/config_test.conf

@ -0,0 +1,46 @@
; Config to test config parsing
; global and item have values that differ from defaults
; global_defaults and item_defualts are to show all defaults are set
; there should be an option for every default type, and a custom type
[global]
intopt=-1
uintopt=1
timelenopt1=1ms
timelenopt2=1s
timelenopt3=1m
timelenopt4=1h
doubleopt=0.1
sockaddropt=1.2.3.4:1234
boolopt=true
boolflag1=true
boolflag2=false
boolflag3=true
deny=0.0.0.0/0
permit=1.2.3.4/32
codecopt=!all,ulaw,g729
stropt=test
customopt=yes
[global_defaults]
[item]
intopt=-1
uintopt=1
timelenopt1=1
timelenopt2=1
timelenopt3=1
timelenopt4=1
doubleopt=0.1
sockaddropt=1.2.3.4:1234
boolopt=true
boolflag1=true
boolflag2=false
boolflag3=true
acldenyopt=0.0.0.0/0
aclpermitopt=1.2.3.4/32
codecopt=!all,ulaw,g729
stropt=test
customopt=yes
[item_defaults]

97
version_1.8.2/pabx/etc/asterisk/console.conf

@ -0,0 +1,97 @@
;
; Configuration for chan_console, a cross-platform console channel driver.
;
[general]
; Set this option to "yes" to enable automatically answering calls on the
; console. This is very useful if the console is used as an intercom.
; The default value is "no".
;
;autoanswer = no
; Set the default context to use for outgoing calls. This can be overridden by
; dialing some extension@context, unless the overridecontext option is enabled.
; The default is "default".
;
;context = default
; Set the default extension to use for outgoing calls. The default is "s".
;
;extension = s
; Set the default CallerID for created channels.
;
;callerid = MyName Here <(256) 428-6000>
; Set the default language for created channels.
;
;language = en
; If you set overridecontext to 'yes', then the whole dial string
; will be interpreted as an extension, which is extremely useful
; to dial SIP, IAX and other extensions which use the '@' character.
; The default is "no".
;
;overridecontext = no ; if 'no', the last @ will start the context
; if 'yes' the whole string is an extension.
; Default Music on Hold class to use when this channel is placed on hold in
; the case that the music class is not set on the channel with
; Set(CHANNEL(musicclass)=whatever) in the dialplan and the peer channel
; putting this one on hold did not suggest a class to use.
;
;mohinterpret=default
; ----------------------------- JITTER BUFFER CONFIGURATION --------------------------
; jbenable = yes ; Enables the use of a jitterbuffer on the receiving side of an
; Console channel. Defaults to "no". An enabled jitterbuffer will
; be used only if the sending side can create and the receiving
; side can not accept jitter. The Console channel can't accept jitter,
; thus an enabled jitterbuffer on the receive Console side will always
; be used if the sending side can create jitter.
; jbmaxsize = 200 ; Max length of the jitterbuffer in milliseconds.
; jbresyncthreshold = 1000 ; Jump in the frame timestamps over which the jitterbuffer is
; resynchronized. Useful to improve the quality of the voice, with
; big jumps in/broken timestamps, usually sent from exotic devices
; and programs. Defaults to 1000.
; jbimpl = fixed ; Jitterbuffer implementation, used on the receiving side of a Console
; channel. Two implementations are currently available - "fixed"
; (with size always equals to jbmax-size) and "adaptive" (with
; variable size, actually the new jb of IAX2). Defaults to fixed.
; jbtargetextra = 40 ; This option only affects the jb when 'jbimpl = adaptive' is set.
; The option represents the number of milliseconds by which the new
; jitter buffer will pad its size. the default is 40, so without
; modification, the new jitter buffer will set its size to the jitter
; value plus 40 milliseconds. increasing this value may help if your
; network normally has low jitter, but occasionally has spikes.
; jblog = no ; Enables jitterbuffer frame logging. Defaults to "no".
; ----------------------------------------------------------------------------------
;
; Any configuration context defined beyond the [general] section configures
; specific devices for use.
;
[default]
input_device = default ; When configuring an input device and output device,
output_device = default ; use the name that you see when you run the "console
; list available" CLI command. If you say "default", the
; system default input and output devices will be used.
autoanswer = no
context = default
extension = s
callerid = MyName Here <(256) 428-6000>
language = en
overridecontext = no
mohinterpret = default
active = yes ; This option should only be set for one console.
; It means that it is the active console to be
; used from the Asterisk CLI.

5
version_1.8.2/pabx/etc/asterisk/dahdi_guiread.conf

@ -0,0 +1,5 @@
[general]
#include "../zaptel.conf"

11
version_1.8.2/pabx/etc/asterisk/dahdi_scan.conf

@ -0,0 +1,11 @@
[1]
active=yes
alarms=UNCONFIGURED
description=ZTDUMMY/1 (source: HRtimer) 1
name=ZTDUMMY/1
manufacturer=
devicetype=Zaptel Dummy Timing Driver
location=
basechan=1
totchans=0
irq=0

34
version_1.8.2/pabx/etc/asterisk/dbsep.conf

@ -0,0 +1,34 @@
#
# Configuration file for dbsep.cgi
#
# The purpose of this file is to provide realtime access to a database,
# possibly through ODBC, without needing to load the ODBC drivers into
# Asterisk, since there are several backend drivers which are rather
# buggy.
#
# We accomplish this separation by using the res_config_curl realtime
# driver to connect to a server running dbsep.cgi (or another, which
# implements the same protocol).
#
# This file contains the information necessary to configure dbsep.cgi.
#
#
# Once installed to a web server, you'll need to preload func_curl.so
# and res_config_curl.so in modules.conf and configure extconfig.conf:
#
# voicemail => curl,http://server/path/to/dbsep.cgi/voicemail
# sippeers => curl,http://server/path/to/dbsep.cgi/sippeers
#
# The Data Source Name, as specified by the Perl DBI module.
# Typically, this will be along the lines of 'DBI:mysql:astdbname[:dbhostname]' or 'DBI:Pg:dbname=astdbname;hostname=dbhostname'
dsn=somedsn
# Connected database user
dbuser=someuser
# And its password
dbpass=password
# For most databases, this is fine. Set to 'no' for Sybase or MS SQL Server.
backslash_is_escape=yes

27
version_1.8.2/pabx/etc/asterisk/digivoice.conf

@ -0,0 +1,27 @@
[general]
allow_slinear=0
allow_ulaw=1
allow_alaw=1
allow_gsm=0
consolelanguage=br
[allportsconfig]
default_callprogress=cp_default.cfg
detectiontype=1
dialtype=1
afterdialpause=1000
ringbacktone1=tone1
ringbacktone2=tone1
ringbacktimes=1000,4000,1000,4000
busytone1=tone1
busytone2=tone1
busytimes=250,250,250,250
subchannelringtone1=tone1
subchannelringtone2=tone1
subchannelringtimes=100,100,100,5000
[groups]
[port_config]
[e1_config]

5
version_1.8.2/pabx/etc/asterisk/dnsmgr.conf

@ -0,0 +1,5 @@
[general]
enable=no ; enable creation of managed DNS lookups
; default is 'no'
;refreshinterval=1200 ; refresh managed DNS lookups every <n> seconds
; default is 300 (5 minutes)

42
version_1.8.2/pabx/etc/asterisk/dsp.conf

@ -0,0 +1,42 @@
[default]
;
; Length of sound (in milliseconds) before a period of silence is considered
; to be a change from talking to silence or a period of noise converts silence
; to talking. [default=256]
;
;silencethreshold=256
; DTMF Reverse Twist and Normal Twist is the difference in power between the row and column energies.
;
; Normal Twist is where the row energy is greater than the column energy.
; Reverse Twist is where the column energy is greater.
;
; Power level difference between frequencies for different Administrations/RPOAs
; Power Gain equiv
; normal reverse dB's
; AT&T(default) 6.31 2.51 8dB(normal), 4dB(reverse)
; NTT 3.16 3.16 Max. 5dB
; Danish 3.98 3.98 Max. 6dB
; Australian 10.0 10.0 Max. 10dB
; Brazilian 7.94 7.94 Max. 9dB
; ETSI 3.98 3.98 Max. 6dB
;previous version compatible AT&T values
; RADIO_RELAX disabled, and relaxdtmf=no
; 6.30 2.50 7.99dB(normal), 3.98dB(reverse)
; RADIO_RELAX disabled, and relaxdtmf=yes
; 6.30 4.00 7.99dB(normal), 6.02dB(reverse)
; RADIO_RELAX enabled, and relaxdtmf=no
; 6.30 2.50 7.99dB(normal), 3.984dB(reverse)
; RADIO_RELAX enabled, and relaxdtmf=yes
; 6.30 6.50 7.99dB(normal), 8.13dB(reverse)
;If you don't know what these mean, don't change them.
;dtmf_normal_twist=6.31
;dtmf_reverse_twist=2.51
;relax_dtmf_normal_twist=6.31
;relax_dtmf_reverse_twist=3.98
;successive number hits/misses of 12.75ms before a digit/nodigit is considered valid
;dtmf_hits_to_begin=2
;dtmf_misses_to_end=3

268
version_1.8.2/pabx/etc/asterisk/dundi.conf

@ -0,0 +1,268 @@
;
; DUNDi configuration file
;
; For more information about DUNDi, see http://www.dundi.com
;
;
[general]
;
; The "general" section contains general parameters relating
; to the operation of the dundi client and server.
;
; The first part should be your complete contact information
; should someone else in your peer group need to contact you.
;
;department=Your Department
;organization=Your Company, Inc.
;locality=Your City
;stateprov=ST
;country=US
;email=your@email.com
;phone=+12565551212
;
;
; Specify bind address and port number. Default is
; 4520
;
;bindaddr=0.0.0.0
;port=4520
;
; See https://wiki.asterisk.org/wiki/display/AST/IP+Quality+of+Service for a description of the tos parameter.
;tos=ef
;
; Our entity identifier (Should generally be the MAC address of the
; machine it's running on. Defaults to the first eth address, but you
; can override it here, as long as you set it to the MAC of *something*
; you own!) The EID can be overridden by a setting in asterisk.conf,
; or by setting this option.
;
;entityid=00:07:E9:3B:76:60
;
; Peers shall cache our query responses for the specified time,
; given in seconds. Default is 3600.
;
;cachetime=3600
;
; This defines the max depth in which to search the DUNDi system.
; Note that the maximum time that we will wait for a response is
; (2000 + 200 * ttl) ms.
;
ttl=32
;
; If we don't get ACK to our DPDISCOVER within 2000ms, and autokill is set
; to yes, then we cancel the whole thing (that's enough time for one
; retransmission only). This is used to keep things from stalling for a long
; time for a host that is not available, but would be ill advised for bad
; connections. In addition to 'yes' or 'no' you can also specify a number
; of milliseconds. See 'qualify' for individual peers to turn on for just
; a specific peer.
;
autokill=yes
;
; pbx_dundi creates a rotating key called "secret", under the family
; 'secretpath'. The default family is dundi (resulting in
; the key being held at dundi/secret).
;
;secretpath=dundi
;
; The 'storehistory' option (also changeable at runtime with
; 'dundi store history' and 'dundi no store history') will
; cause the DUNDi engine to keep track of the last several
; queries and the amount of time each query took to execute
; for the purpose of tracking slow nodes. This option is
; off by default due to performance impacts.
;
;storehistory=yes
[mappings]
;
; The "mappings" section maps DUNDi contexts
; to contexts on the local asterisk system. Remember
; that numbers that are made available under the e164
; DUNDi context are regulated by the DUNDi General Peering
; Agreement (GPA) if you are a member of the DUNDi E.164
; Peering System.
;
; dundi_context => local_context,weight,tech,dest[,options]]
;
; 'dundi_context' is the name of the context being requested
; within the DUNDi request
;
; 'local_context' is the name of the context on the local system
; in which numbers can be looked up for which responses shall be given.
;
; 'weight' is the weight to use for the responses provided from this
; mapping. The number must be >= 0 and < 60000. Since it is totally
; valid to receive multiple responses to a query, responses received
; with a lower weight are tried first. Note that the weight has a
; special meaning in the e164 context - see the GPA for more details.
;
; 'tech' is the technology to use (IAX, SIP, H323)
;
; 'dest' is the destination to supply for reaching that number. The
; following variables can be used in the destination string and will
; be automatically substituted:
; ${NUMBER}: The number being requested
; ${IPADDR}: The IP address to connect to
; ${SECRET}: The current rotating secret key to be used
;
; Further options may include:
;
; nounsolicited: No unsolicited calls of any type permitted via this
; route
; nocomunsolicit: No commercial unsolicited calls permitted via
; this route
; residential: This number is known to be a residence
; commercial: This number is known to be a business
; mobile: This number is known to be a mobile phone
; nocomunsolicit: No commercial unsolicited calls permitted via
; this route
; nopartial: Do not search for partial matches
;
; There *must* exist an entry in mappings for DUNDi to respond
; to any request, although it may be empty.
;
;e164 => dundi-e164-canonical,0,IAX2,dundi:${SECRET}@${IPADDR}/${NUMBER},nounsolicited,nocomunsolicit,nopartial
;e164 => dundi-e164-customers,100,IAX2,dundi:${SECRET}@${IPADDR}/${NUMBER},nounsolicited,nocomunsolicit,nopartial
;e164 => dundi-e164-via-pstn,400,IAX2,dundi:${SECRET}@${IPADDR}/${NUMBER},nounsolicited,nocomunsolicit,nopartial
;digexten => default,0,IAX2,guest@lappy/${NUMBER}
;asdf =>
;
; Weights for mappings can be set a few different ways:
;
; 1) It can be set as a static number.
;testmap1 => context1,222,IAX2,guest@peer1/${NUMBER}
;
; 2) It can be an Asterisk global variable.
;testmap2 => context2,${DUNDITESTVAR},IAX2,guest@peer2${NUMBER}
;
; 3) It can be retrieved using a dialplan function. This can be extremely
; useful if you want to let an external script decide what the weight
; in a response shouuld be.
;testmap3 => context3,${SHELL(echo 123)},IAX2,guest@peer3/${NUMBER}
;
; The built in variables ${SECRET}, ${IPADDR} and ${NUMBER} can also be
; passed to the weight. For example, you could pass the ${NUMBER} value
; to your SHELL() script and use that to dynamically return a weight.
;
; Note than when using a global variable or dialplan function to set the
; weight for a mapping, that response caching should be disabled if you
; plan for these values to change frequently at all. If the results are
; cached, then any change in value will not take effect until the cache
; has expired.
;
;
; The remaining sections represent the peers
; that we fundamentally trust. The section name
; represents the name and optionally at a specific
; DUNDi context if you want the trust to be established
; for only a specific DUNDi context.
;
; inkey - What key they will be authenticating to us with
;
; outkey - What key we use to authenticate to them
;
; host - What their host is
;
; port - The port where their host is listening (default: 4520)
;
; order - What search order to use. May be 'primary', 'secondary',
; 'tertiary' or 'quartiary'. In large systems, it is beneficial
; to only query one up-stream host in order to maximize caching
; value. Adding one with primary and one with secondary gives you
; redundancy without sacrificing performance.
;
; include - Includes this peer when searching a particular context
; for lookup (set "all" to perform all lookups with that
; host. This is also the context in which peers are permitted
; to precache.
;
; noinclude - Disincludes this peer when searching a particular context
; for lookup (set "all" to perform no lookups with that
; host.
;
; permit - Permits this peer to search a given DUNDi context on
; the local system. Set "all" to permit this host to
; lookup all contexts. This is also a context for which
; we will create/forward PRECACHE commands.
;
; deny - Denies this peer to search a given DUNDi context on
; the local system. Set "all" to deny this host to
; lookup all contexts.
;
; model - inbound, outbound, or symmetric for whether we receive
; requests only, transmit requests only, or do both.
;
; precache - Utilize/Permit precaching with this peer (to pre
; cache means to provide an answer when no request
; was made and is used so that machines with few
; routes can push those routes up a to a higher level).
; outgoing means we send precache routes to this peer,
; incoming means we permit this peer to send us
; precache routes. symmetric means we do both.
;
; Note: You cannot mix symmetric/outbound model with symmetric/inbound
; precache, nor can you mix symmetric/inbound model with symmetric/outbound
; precache.
;
;
; The '*' peer is special and matches an unspecified entity
;
;
; Sample Primary e164 DUNDi peer
;
;[00:50:8B:F3:75:BB]
;model = symmetric
;host = 64.215.96.114
;inkey = digium
;outkey = misery
;include = e164
;permit = e164
;qualify = yes
;
; Sample Secondary e164 DUNDi peer
;
;[00:A0:C9:96:92:84]
;model = symmetric
;host = misery.digium.com
;inkey = misery
;outkey = ourkey
;include = e164
;permit = e164
;qualify = yes
;order = secondary
;
; Sample "push mode" downstream host
;
;[00:0C:76:96:75:28]
;model = inbound
;host = dynamic
;precache = inbound
;inkey = littleguy
;outkey = ourkey
;include = e164 ; In this case used only for precaching
;permit = e164
;qualify = yes
;
; Sample "push mode" upstream host
;
;[00:07:E9:3B:76:60]
;model = outbound
;precache = outbound
;host = 216.207.245.34
;register = yes
;inkey = dhcp34
;permit = all ; In this case used only for precaching
;include = all
;qualify = yes
;outkey=foo
;[*]
;

22
version_1.8.2/pabx/etc/asterisk/enum.conf

@ -0,0 +1,22 @@
;
; ENUM Configuration for resolving phone numbers over DNS
;
; Sample config for Asterisk
; This file is reloaded at "module reload enum" in the CLI
;
[general]
;
; The search list for domains may be customized. Domains are searched
; in the order they are listed here.
;
search => e164.arpa
;
; If you'd like to use the E.164.org public ENUM registry in addition
; to the official e164.arpa one, uncomment the following line
;
;search => e164.org
;
; As there are more H323 drivers available you have to select to which
; drive a H323 URI will map. Default is "H323".
;
h323driver => H323

111
version_1.8.2/pabx/etc/asterisk/extconfig.conf

@ -0,0 +1,111 @@
;
; Static and realtime external configuration
; engine configuration
;
; See https://wiki.asterisk.org/wiki/display/AST/Realtime+Database+Configuration
; for basic table formatting information.
;
[settings]
;
; Static configuration files:
;
; file.conf => driver,database[,table[,priority]]
;
; maps a particular configuration file to the given
; database driver, database and table (or uses the
; name of the file as the table if not specified)
;
; Uncomment to load queues.conf via the odbc engine.
;
;queues.conf => odbc,asterisk,ast_config
;extensions.conf => sqlite,asterisk,ast_config
;
; The following files CANNOT be loaded from Realtime storage:
; asterisk.conf
; extconfig.conf (this file)
; logger.conf
;
; Additionally, the following files cannot be loaded from
; Realtime storage unless the storage driver is loaded
; early using 'preload' statements in modules.conf:
; manager.conf
; cdr.conf
; rtp.conf
;
; Named ACLs specified in realtime also can not be used
; from manager.conf unless the storage driver is preloaded.
; Attempting to use a realtime stored named ACL before the
; driver is loaded will result in an invalid ACL which
; rejects all addresses.
;
; Realtime configuration engine
;
; maps a particular family of realtime
; configuration to a given database driver,
; database and table (or uses the name of
; the family if the table is not specified
;
;example => odbc,asterisk,alttable,1
;example => mysql,asterisk,alttable,2
;example2 => ldap,"dc=oxymium,dc=net",example2
;
; Additionally, priorities are now supported for use as failover methods
; for retrieving realtime data. If one connection fails to retrieve any
; information, the next sequential priority will be tried next. This
; especially works well with ODBC connections, since res_odbc now caches
; when connection failures occur and prevents immediately retrying those
; connections until after a specified timeout. Note: priorities must
; start at 1 and be sequential (i.e. if you have only priorities 1, 2,
; and 4, then 4 will be ignored, because there is no 3).
;
;
; Possible driver backends:
;
; "odbc" is shown in the examples below, but is not the only valid realtime
; engine. Here are several of the possible options:
; odbc ... res_config_odbc
; sqlite ... res_config_sqlite
; sqlite3 ... res_config_sqlite3
; pgsql ... res_config_pgsql
; curl ... res_config_curl
; ldap ... res_config_ldap
; mysql ... res_config_mysql (available via add-ons in menuselect)
;
; Note: The res_config_pgsql and res_config_sqlite backends configure the
; database used in their respective configuration files and ignore the
; database name configured in this file.
;
;iaxusers => odbc,asterisk
;iaxpeers => odbc,asterisk
;sippeers => odbc,asterisk
;sipregs => odbc,asterisk ; (avoid sipregs if possible, e.g. by using a view)
;ps_endpoints => odbc,asterisk
;ps_auths => odbc,asterisk
;ps_aors => odbc,asterisk
;ps_domain_aliases => odbc,asterisk
;ps_endpoint_id_ips => odbc,asterisk
;ps_outbound_publishes => odbc,asterisk
;ps_inbound_publications = odbc,asterisk
;ps_asterisk_publications = odbc,asterisk
;voicemail => odbc,asterisk
;extensions => odbc,asterisk
;meetme => mysql,general
;queues => odbc,asterisk
;queue_members => odbc,asterisk
;queue_rules => odbc,asterisk
;acls => odbc,asterisk
;musiconhold => mysql,general
;queue_log => mysql,general
;
;
; While most dynamic realtime engines are automatically used when defined in
; this file, 'extensions', distinctively, is not. To activate dynamic realtime
; extensions, you must turn them on in each respective context within
; extensions.conf with a switch statement. The syntax is:
; switch => Realtime/[[db_context@]tablename]/<opts>
; The only option available currently is the 'p' option, which disallows
; extension pattern queries to the database. If you have no patterns defined
; in a particular context, this will save quite a bit of CPU time. However,
; note that using dynamic realtime extensions is not recommended anymore as a
; best practice; instead, you should consider writing a static dialplan with
; proper data abstraction via a tool like func_odbc.

456
version_1.8.2/pabx/etc/asterisk/extensions.ael

@ -0,0 +1,456 @@
//
// Example AEL config file
//
//
// Static extension configuration file, used by
// the pbx_ael module. This is where you configure all your
// inbound and outbound calls in Asterisk.
//
// This configuration file is reloaded
// - With the "ael reload" command in the CLI
// - With the "reload" command (that reloads everything) in the CLI
// The "Globals" category contains global variables that can be referenced
// in the dialplan by using the GLOBAL dialplan function:
// ${GLOBAL(VARIABLE)}
// ${${GLOBAL(VARIABLE)}} or ${text${GLOBAL(VARIABLE)}} or any hybrid
// Unix/Linux environmental variables are reached with the ENV dialplan
// function: ${ENV(VARIABLE)}
//
// NOTE! NOTE! NOTE!
// Asterisk by default will load both extensions.conf and extensions.ael files.
// Upon loading these files the dialplans generated from both with be merged,
// so you must make sure that you don't have any overlapping contexts or global
// variables. If you do, then unexpected behavior may result when the data is
// merged.
// NOTE! NOTE! NOTE!
globals {
CONSOLE-AEL="Console/dsp"; // Console interface for demo
//CONSOLE-AEL=Zap/1;
//CONSOLE-AEL=Phone/phone0;
IAXINFO-AEL=guest; // IAXtel username/password
//IAXINFO-AEL="myuser:mypass";
OUTBOUND-TRUNK="Zap/g2"; // Trunk interface
//
// Note the 'g2' in the OUTBOUND-TRUNK variable above. It specifies which group (defined
// in chan_dahdi.conf) to dial, i.e. group 2, and how to choose a channel to use in
// the specified group. The four possible options are:
//
// g: select the lowest-numbered non-busy DAHDI channel
// (aka. ascending sequential hunt group).
// G: select the highest-numbered non-busy DAHDI channel
// (aka. descending sequential hunt group).
// r: use a round-robin search, starting at the next highest channel than last
// time (aka. ascending rotary hunt group).
// R: use a round-robin search, starting at the next lowest channel than last
// time (aka. descending rotary hunt group).
//
OUTBOUND-TRUNKMSD=1; // MSD digits to strip (usually 1 or 0)
//OUTBOUND-TRUNK2=IAX2/user:pass@provider;
};
//
// Any category other than "General" and "Globals" represent
// extension contexts, which are collections of extensions.
//
// Extension names may be numbers, letters, or combinations
// thereof. If an extension name is prefixed by a '_'
// character, it is interpreted as a pattern rather than a
// literal. In patterns, some characters have special meanings:
//
// X - any digit from 0-9
// Z - any digit from 1-9
// N - any digit from 2-9
// [1235-9] - any digit in the brackets (in this example, 1,2,3,5,6,7,8,9)
// . - wildcard, matches anything remaining (e.g. _9011. matches
// anything starting with 9011 excluding 9011 itself)
// ! - wildcard, causes the matching process to complete as soon as
// it can unambiguously determine that no other matches are possible
//
// For example the extension _NXXXXXX would match normal 7 digit dialings,
// while _1NXXNXXXXXX would represent an area code plus phone number
// preceded by a one.
//
// Each step of an extension is ordered by priority, which must
// always start with 1 to be considered a valid extension. The priority
// "next" or "n" means the previous priority plus one, regardless of whether
// the previous priority was associated with the current extension or not.
// The priority "same" or "s" means the same as the previously specified
// priority, again regardless of whether the previous entry was for the
// same extension. Priorities may be immediately followed by a plus sign
// and another integer to add that amount (most useful with 's' or 'n').
// Priorities may then also have an alias, or label, in
// parenthesis after their name which can be used in goto situations
//
// Contexts contain several lines, one for each step of each
// extension, which can take one of two forms as listed below,
// with the first form being preferred. One may include another
// context in the current one as well, optionally with a
// date and time. Included contexts are included in the order
// they are listed.
//
//context name {
// exten-name => {
// application(arg1,arg2,...);
//
// Timing list for includes is
//
// <time range>|<days of week>|<days of month>|<months>
//
// includes {
// daytime|9:00-17:00|mon-fri|*|*;
// };
//
// ignorepat can be used to instruct drivers to not cancel dialtone upon
// receipt of a particular pattern. The most commonly used example is
// of course '9' like this:
//
// ignorepat => 9;
//
// so that dialtone remains even after dialing a 9.
//};
//
// Sample entries for extensions.conf
//
//
context ael-dundi-e164-canonical {
//
// List canonical entries here
//
// 12564286000 => &ael-std-exten(6000,IAX2/foo);
// _125642860XX => Dial(IAX2/otherbox/${EXTEN:7});
};
context ael-dundi-e164-customers {
//
// If you are an ITSP or Reseller, list your customers here.
//
//_12564286000 => Dial(SIP/customer1);
//_12564286001 => Dial(IAX2/customer2);
};
context ael-dundi-e164-via-pstn {
//
// If you are freely delivering calls to the PSTN, list them here
//
//_1256428XXXX => Dial(DAHDI/G2/${EXTEN:7}); // Expose all of 256-428
//_1256325XXXX => Dial(DAHDI/G2/${EXTEN:7}); // Ditto for 256-325
};
context ael-dundi-e164-local {
//
// Context to put your dundi IAX2 or SIP user in for
// full access
//
includes {
ael-dundi-e164-canonical;
ael-dundi-e164-customers;
ael-dundi-e164-via-pstn;
};
};
context ael-dundi-e164-switch {
//
// Just a wrapper for the switch
//
switches {
DUNDi/e164;
};
};
context ael-dundi-e164-lookup {
//
// Locally to lookup, try looking for a local E.164 solution
// then try DUNDi if we don't have one.
//
includes {
ael-dundi-e164-local;
ael-dundi-e164-switch;
};
//
};
//
// DUNDi can also be implemented as a Macro instead of using
// the Local channel driver.
//
macro ael-dundi-e164(exten) {
//
// ARG1 is the extension to Dial
//
goto ${exten}|1;
return;
};
//
// Here are the entries you need to participate in the IAXTEL
// call routing system. Most IAXTEL numbers begin with 1-700, but
// there are exceptions. For more information, and to sign
// up, please go to www.gnophone.com or www.iaxtel.com
//
context ael-iaxtel700 {
_91700XXXXXXX => Dial(IAX2/${IAXINFO-AEL}@iaxtel.com/${EXTEN:1}@iaxtel);
};
//
// The SWITCH statement permits a server to share the dialplan with
// another server. Use with care: Reciprocal switch statements are not
// allowed (e.g. both A -> B and B -> A), and the switched server needs
// to be on-line or else dialing can be severly delayed.
//
context ael-iaxprovider {
switches {
// IAX2/user:[key]@myserver/mycontext;
};
};
context ael-trunkint {
//
// International long distance through trunk
//
includes {
ael-dundi-e164-lookup;
};
_9011. => {
&ael-dundi-e164(${EXTEN:4});
Dial(${OUTBOUND-TRUNK}/${EXTEN:${OUTBOUND-TRUNKMSD}});
};
};
context ael-trunkld {
//
// Long distance context accessed through trunk
//
includes {
ael-dundi-e164-lookup;
};
_91NXXNXXXXXX => {
&ael-dundi-e164(${EXTEN:1});
Dial(${OUTBOUND-TRUNK}/${EXTEN:${OUTBOUND-TRUNKMSD}});
};
};
context ael-trunklocal {
//
// Local seven-digit dialing accessed through trunk interface
//
_9NXXXXXX => {
Dial(${OUTBOUND-TRUNK}/${EXTEN:${OUTBOUND-TRUNKMSD}});
};
};
context ael-trunktollfree {
//
// Long distance context accessed through trunk interface
//
_91800NXXXXXX => Dial(${OUTBOUND-TRUNK}/${EXTEN:${OUTBOUND-TRUNKMSD}});
_91888NXXXXXX => Dial(${OUTBOUND-TRUNK}/${EXTEN:${OUTBOUND-TRUNKMSD}});
_91877NXXXXXX => Dial(${OUTBOUND-TRUNK}/${EXTEN:${OUTBOUND-TRUNKMSD}});
_91866NXXXXXX => Dial(${OUTBOUND-TRUNK}/${EXTEN:${OUTBOUND-TRUNKMSD}});
};
context ael-international {
//
// Master context for international long distance
//
ignorepat => 9;
includes {
ael-longdistance;
ael-trunkint;
};
};
context ael-longdistance {
//
// Master context for long distance
//
ignorepat => 9;
includes {
ael-local;
ael-trunkld;
};
};
context ael-local {
//
// Master context for local, toll-free, and iaxtel calls only
//
ignorepat => 9;
includes {
ael-default;
ael-trunklocal;
ael-iaxtel700;
ael-trunktollfree;
ael-iaxprovider;
};
};
//
// You can use an alternative switch type as well, to resolve
// extensions that are not known here, for example with remote
// IAX switching you transparently get access to the remote
// Asterisk PBX
//
// switch => IAX2/user:password@bigserver/local
//
// An "lswitch" is like a switch but is literal, in that
// variable substitution is not performed at load time
// but is passed to the switch directly (presumably to
// be substituted in the switch routine itself)
//
// lswitch => Loopback/12${EXTEN}@othercontext
//
// An "eswitch" is like a switch but the evaluation of
// variable substitution is performed at runtime before
// being passed to the switch routine.
//
// eswitch => IAX2/context@${CURSERVER}
macro ael-std-exten-ael( ext , dev ) {
Dial(${dev}/${ext},20);
switch(${DIALSTATUS}) {
case BUSY:
Voicemail(${ext},b);
break;
default:
Voicemail(${ext},u);
};
catch a {
VoiceMailMain(${ext});
return;
};
return;
};
context ael-demo {
s => {
Wait(1);
Answer();
Set(TIMEOUT(digit)=5);
Set(TIMEOUT(response)=10);
restart:
Background(demo-congrats);
instructions:
for (x=0; ${x} < 3; x=${x} + 1) {
Background(demo-instruct);
WaitExten();
};
};
2 => {
Background(demo-moreinfo);
goto s|instructions;
};
3 => {
Set(LANGUAGE()=fr);
goto s|restart;
};
1000 => {
goto ael-default|s|1;
};
500 => {
Playback(demo-abouttotry);
Dial(IAX2/guest@misery.digium.com/s@default);
Playback(demo-nogo);
goto s|instructions;
};
600 => {
Playback(demo-echotest);
Echo();
Playback(demo-echodone);
goto s|instructions;
};
_1234 => &ael-std-exten-ael(${EXTEN}, "IAX2");
8500 => {
VoicemailMain();
goto s|instructions;
};
# => {
Playback(demo-thanks);
Hangup();
};
t => goto #|1;
i => Playback(invalid);
};
//
// If you wish to use AEL for your default context, remove it
// from extensions.conf (or change its name or comment it out)
// and then uncomment the one here.
//
context ael-default {
// By default we include the demo. In a production system, you
// probably don't want to have the demo there.
includes {
ael-demo;
};
//
// Extensions like the two below can be used for FWD, Nikotel, sipgate etc.
// Note that you must have a [sipprovider] section in sip.conf whereas
// the otherprovider.net example does not require such a peer definition
//
//_41X. => Dial(SIP/${EXTEN:2}@sipprovider,,r);
//_42X. => Dial(SIP/user:passwd@${EXTEN:2}@otherprovider.net,30,rT);
// Real extensions would go here. Generally you want real extensions to be
// 4 or 5 digits long (although there is no such requirement) and start with a
// single digit that is fairly large (like 6 or 7) so that you have plenty of
// room to overlap extensions and menu options without conflict. You can alias
// them with names, too, and use global variables
// 6245 => {
// hint(SIP/Grandstream1&SIP/Xlite1,Joe Schmoe); // Channel hints for presence
// Dial(SIP/Grandstream1,20,rt); // permit transfer
// Dial(${HINT}/5245},20,rtT); // Use hint as listed
// switch(${DIALSTATUS}) {
// case BUSY:
// Voicemail(6245,b);
// return;
// default:
// Voicemail(6245,u);
// return;
// };
// };
// 6361 => Dial(IAX2/JaneDoe,,rm); // ring without time limit
// 6389 => Dial(MGCP/aaln/1@192.168.0.14);
// 6394 => Dial(Local/6275/n); // this will dial ${MARK}
// 6275 => &ael-stdexten(6275,${MARK}); // assuming ${MARK} is something like DAHDI/2
// mark => goto 6275|1; // alias mark to 6275
// 6536 => &ael-stdexten(6236,${WIL}); // Ditto for wil
// wil => goto 6236|1;
//
// Some other handy things are an extension for checking voicemail via
// voicemailmain
//
// 8500 => {
// VoicemailMain();
// Hangup();
// };
//
// Or a conference room (you'll need to edit meetme.conf to enable this room)
//
// 8600 => Meetme(1234);
//
// Or playing an announcement to the called party, as soon it answers
//
// 8700 => Dial(${MARK},30,A(/path/to/my/announcemsg))
//
// For more information on applications, just type "show applications" at your
// friendly Asterisk CLI prompt.
//
// 'show application <command>' will show details of how you
// use that particular application in this file, the dial plan.
//
}

27
version_1.8.2/pabx/etc/asterisk/extensions.conf

@ -0,0 +1,27 @@
[general]
#include extensions_general.conf
#include extensions_ramais.conf
#include extensions_disa.conf
#include extensions_fila.conf
#include extensions_fila_login.conf
#include extensions_horarios.conf
#include extensions_facilidades.conf
#include extensions_grupos.conf
#include extensions_ura.conf
#include extensions_rotas_entrada.conf
#include extensions_contextos.conf
#include extensions_conferencia.conf
#include extensions_anuncios.conf
#include extensions_teste.conf
#include extensions_rotas_interno.conf
#include extensions_contextos_personalizados.conf
#include extensions_callback.conf
#include extensions_padrao.conf
#include extensions_padrao_customizado.conf
#include extensions_campanha.conf
#include extensions_rotas_saida_campanha.conf
#include extensions_rotas.conf
#include extensions_transfere_campanha.conf
#include extensions_pesquisa.conf
#include extensions_contextos_custom.conf
#include hints.conf

240
version_1.8.2/pabx/etc/asterisk/extensions.lua

@ -0,0 +1,240 @@
CONSOLE = "Console/dsp" -- Console interface for demo
--CONSOLE = "DAHDI/1"
--CONSOLE = "Phone/phone0"
IAXINFO = "guest" -- IAXtel username/password
--IAXINFO = "myuser:mypass"
TRUNK = "DAHDI/G2"
TRUNKMSD = 1
-- TRUNK = "IAX2/user:pass@provider"
--
-- Extensions are expected to be defined in a global table named 'extensions'.
-- The 'extensions' table should have a group of tables in it, each
-- representing a context. Extensions are defined in each context. See below
-- for examples.
--
-- Extension names may be numbers, letters, or combinations thereof. If
-- an extension name is prefixed by a '_' character, it is interpreted as
-- a pattern rather than a literal. In patterns, some characters have
-- special meanings:
--
-- X - any digit from 0-9
-- Z - any digit from 1-9
-- N - any digit from 2-9
-- [1235-9] - any digit in the brackets (in this example, 1,2,3,5,6,7,8,9)
-- . - wildcard, matches anything remaining (e.g. _9011. matches
-- anything starting with 9011 excluding 9011 itself)
-- ! - wildcard, causes the matching process to complete as soon as
-- it can unambiguously determine that no other matches are possible
--
-- For example the extension _NXXXXXX would match normal 7 digit
-- dialings, while _1NXXNXXXXXX would represent an area code plus phone
-- number preceded by a one.
--
-- If your extension has special characters in it such as '.' and '!' you must
-- explicitly make it a string in the tabale definition:
--
-- ["_special."] = function;
-- ["_special!"] = function;
--
-- There are no priorities. All extensions to asterisk appear to have a single
-- priority as if they consist of a single priority.
--
-- Each context is defined as a table in the extensions table. The
-- context names should be strings.
--
-- One context may be included in another context using the 'includes'
-- extension. This extension should be set to a table containing a list
-- of context names. Do not put references to tables in the includes
-- table.
--
-- include = {"a", "b", "c"};
--
-- Channel variables can be accessed thorugh the global 'channel' table.
--
-- v = channel.var_name
-- v = channel["var_name"]
-- v.value
-- v:get()
--
-- channel.var_name = "value"
-- channel["var_name"] = "value"
-- v:set("value")
--
-- channel.func_name(1,2,3):set("value")
-- value = channel.func_name(1,2,3):get()
--
-- channel["func_name(1,2,3)"]:set("value")
-- channel["func_name(1,2,3)"] = "value"
-- value = channel["func_name(1,2,3)"]:get()
--
-- Note the use of the ':' operator to access the get() and set()
-- methods.
--
-- Also notice the absence of the following constructs from the examples above:
-- channel.func_name(1,2,3) = "value" -- this will NOT work
-- value = channel.func_name(1,2,3) -- this will NOT work as expected
--
--
-- Dialplan applications can be accessed through the global 'app' table.
--
-- app.Dial("DAHDI/1")
-- app.dial("DAHDI/1")
-- app["dial"]("DAHDI/1")
--
-- More examples can be found below.
--
-- An autoservice is automatically run while lua code is executing. The
-- autoservice can be stopped and restarted using the autoservice_stop() and
-- autoservice_start() functions. The autservice should be running before
-- starting long running operations. The autoservice will automatically be
-- stopped before executing applications and dialplan functions and will be
-- restarted afterwards. The autoservice_status() function can be used to
-- check the current status of the autoservice and will return true if an
-- autoservice is currently running.
--
-- Note about naming conflicts:
-- Lua allows you to refer to table entries using the '.' notation,
-- I.E. app.goto(something), only if the entry doesn't conflict with an Lua
-- reserved word. In the 'goto' example, with Lua 5.1 or earlier, 'goto' is
-- not a reserved word so you'd be calling the Asterisk dialplan application
-- 'goto'. Lua 5.2 however, introduced the 'goto' control statement which
-- makes 'goto' a reserved word. This casues the interpreter to fail parsing
-- the file and pbx_lua.so will fail to load. The same applies to any use of
-- Lua tables including extensions, channels and any tables you create.
--
-- There are two ways around this: Since Lua is case-sensitive, you can use
-- capitalized names, I.E. app.Goto(something) to refer to the Asterisk apps,
-- functions, etc. Or you can use the full syntax, I.E. app["goto"](something).
-- Both syntaxes are backwards compatible with earlier Lua versions. To make
-- your Lua dialplans easier to maintain and to reduce the chance of future
-- conflicts you may want to use the app["goto"](something) syntax for all
-- table accesses.
--
function outgoing_local(c, e)
app.dial("DAHDI/1/" .. e, "", "")
end
function demo_instruct()
app.background("demo-instruct")
app.waitexten()
end
function demo_congrats()
app.background("demo-congrats")
demo_instruct()
end
-- Answer the chanel and play the demo sound files
function demo_start(context, exten)
app.wait(1)
app.answer()
channel.TIMEOUT("digit"):set(5)
channel.TIMEOUT("response"):set(10)
-- app.set("TIMEOUT(digit)=5")
-- app.set("TIMEOUT(response)=10")
demo_congrats(context, exten)
end
function demo_hangup()
app.playback("demo-thanks")
app.hangup()
end
extensions = {
demo = {
s = demo_start;
["2"] = function()
app.background("demo-moreinfo")
demo_instruct()
end;
["3"] = function ()
channel.LANGUAGE():set("fr") -- set the language to french
demo_congrats()
end;
["1000"] = function()
-- See the naming conflict note above.
app['goto']("default", "s", 1)
end;
["1234"] = function()
app.playback("transfer", "skip")
-- do a dial here
end;
["1235"] = function()
app.voicemail("1234", "u")
end;
["1236"] = function()
app.dial("Console/dsp")
app.voicemail(1234, "b")
end;
["#"] = demo_hangup;
t = demo_hangup;
i = function()
app.playback("invalid")
demo_instruct()
end;
["500"] = function()
app.playback("demo-abouttotry")
app.dial("IAX2/guest@misery.digium.com/s@default")
app.playback("demo-nogo")
demo_instruct()
end;
["600"] = function()
app.playback("demo-echotest")
app.echo()
app.playback("demo-echodone")
demo_instruct()
end;
["8500"] = function()
app.voicemailmain()
demo_instruct()
end;
};
default = {
-- by default, do the demo
include = {"demo"};
};
public = {
-- ATTENTION: If your Asterisk is connected to the internet and you do
-- not have allowguest=no in sip.conf, everybody out there may use your
-- public context without authentication. In that case you want to
-- double check which services you offer to the world.
--
include = {"demo"};
};
["local"] = {
["_NXXXXXX"] = outgoing_local;
};
}
hints = {
demo = {
[1000] = "SIP/1000";
[1001] = "SIP/1001";
};
default = {
["1234"] = "SIP/1234";
};
}

3
version_1.8.2/pabx/etc/asterisk/extensions_anuncios.conf

@ -0,0 +1,3 @@
[ext-anuncios]
include => ext-anuncios-custom
exten => h,1,Macro(hangup)

2
version_1.8.2/pabx/etc/asterisk/extensions_callback.conf

@ -0,0 +1,2 @@
[ext-callback-externo]
include => ext-callback-externo-custom

1
version_1.8.2/pabx/etc/asterisk/extensions_campanha.conf

@ -0,0 +1 @@
[ext-campanha]

2
version_1.8.2/pabx/etc/asterisk/extensions_conferencia.conf

@ -0,0 +1,2 @@
[ext-conferencia]
include => ext-conferencia-custom

0
version_1.8.2/pabx/etc/asterisk/extensions_contextos.conf

0
version_1.8.2/pabx/etc/asterisk/extensions_contextos_custom.conf

33
version_1.8.2/pabx/etc/asterisk/extensions_contextos_personalizados.conf

@ -0,0 +1,33 @@
[ext-ramais-custom]
exten => _1100,1,ExecIf($["${ISNULL(${CDR(direcao)})}" = "1"]?Set(CDR(direcao)=I))
exten => _1100,n,ExecIf($["${CDR(direcao)}" != "E" && "${ISNULL(${CDR(ramal_origem)})}" = "1"]?Set(CDR(ramal_origem)=${CALLERID(num)}))
exten => _1100,n,Set(CHANNEL(accountcode)=${TRANSFER})
exten => _1100,n,AGI(chefe-secretaria.php,${EXTEN},${CALLERID(num)})
exten => _1100,n,GotoIf($["${TIPO}" = "EXTERNA"]?externa:interna)
exten => _1100,n(interna),AGI(pbx_complemento.php,ext-ramais,interna)
exten => _1100,n,Macro(dial-interno-manual,${EXTEN})
exten => _1100,n,Hangup()
exten => _1100,n(externa),AGI(pbx_complemento.php,ext-ramais)
exten => _1100,n,Macro(dial-externo,${EXTEN})
exten => _1100,n,Hangup()
exten => _1101,1,ExecIf($["${ISNULL(${CDR(direcao)})}" = "1"]?Set(CDR(direcao)=I))
exten => _1101,n,ExecIf($["${CDR(direcao)}" != "E" && "${ISNULL(${CDR(ramal_origem)})}" = "1"]?Set(CDR(ramal_origem)=${CALLERID(num)}))
exten => _1101,n,Set(CHANNEL(accountcode)=${TRANSFER})
exten => _1101,n,AGI(chefe-secretaria.php,${EXTEN},${CALLERID(num)})
exten => _1101,n,GotoIf($["${TIPO}" = "EXTERNA"]?externa:interna)
exten => _1101,n(interna),AGI(pbx_complemento.php,ext-ramais,interna)
exten => _1101,n,Macro(dial-interno-manual,${EXTEN})
exten => _1101,n,Hangup()
exten => _1101,n(externa),AGI(pbx_complemento.php,ext-ramais)
exten => _1101,n,Macro(dial-externo,${EXTEN})
exten => _1101,n,Hangup()
[ext-horarios-custom]
[ext-fila-custom]
[ext-disa-custom]
[ext-grupos-custom]
[ext-conferencia-custom]
[ext-testes-custom]
[saida-pstn-custom]
[ext-anuncios-custom]
[ext-callback-externo-custom]
[ext-rotasinternas-custom]

2
version_1.8.2/pabx/etc/asterisk/extensions_disa.conf

@ -0,0 +1,2 @@
[ext-disa]
include => ext-disa-custom

0
version_1.8.2/pabx/etc/asterisk/extensions_discador.conf

369
version_1.8.2/pabx/etc/asterisk/extensions_facilidades.conf

@ -0,0 +1,369 @@
[app-identifica-ramal]
exten => *10,1,NoCDR()
exten => *10,n,AGI(pbx_complemento.php,aplicacoes)
exten => *10,n,Playback(appsounds/ramal)
exten => *10,n,SayDigits(${CALLERID(NUM)})
exten => *10,n,Hangup()
[app-hora]
exten => *11,1,NoCDR()
exten => *11,n,AGI(pbx_complemento.php,aplicacoes)
exten => *11,n,Answer()
exten => *11,n,SayUnixTime(,,HMS)
exten => *11,n,Hangup()
[app-echo]
exten => *12,1,NoCDR()
exten => *12,n,AGI(pbx_complemento.php,aplicacoes)
exten => *12,n,Answer()
exten => *12,n,Playback(demo-echotest)
exten => *12,n,Echo()
exten => *12,n,Playback(demo-echodone)
exten => *12,n,Hangup()
[app-troca-senha-ramal]
exten => *13,1,NoCDR()
exten => *13,n,AGI(pbx_complemento.php,aplicacoes)
exten => *13,n,Authenticate(${DB(SENHA/${CALLERID(NUM)})},d,)
exten => *13,n,Read(NOVASENHA,vm-newpassword,,n)
exten => *13,n,GotoIf($["${LEN(${NOVASENHA})}" = "${LEN(${CALLERID(NUM)})}"]?confirmasenha)
exten => *13,n,Playback(invalid)
exten => *13,n,Hangup()
exten => *13,n(confirmasenha),Read(CONFIRMASENHA,vm-reenterpassword,,n)
exten => *13,n,GotoIf($["${NOVASENHA}" = "${CONFIRMASENHA}"]?final)
exten => *13,n,Playback(incorrect-password)
exten => *13,n,Hangup()
exten => *13,n(final),Set(DB(SENHA/${CALLERID(NUM)})=${NOVASENHA})
exten => *13,n,AGI(facilidades.php,${NOVASENHA})
exten => *13,n,Wait(1)
exten => *13,n,Playback(vm-passchanged&vm-goodbye)
exten => *13,n,Hangup()
[app-nao-pertube]
exten => *14,1,NoCDR()
exten => *14,n,AGI(pbx_complemento.php,aplicacoes)
exten => *14,n,Authenticate(${DB(SENHA/${CALLERID(NUM)})},d,)
exten => *14,n,Noop(Ativando função não pertube)
exten => *14,n,Set(DB(NAOPERTUBE/${CALLERID(num)})=V)
exten => *14,n,AGI(facilidades.php)
exten => *14,n,Playback(beep&beep&activated)
exten => *14,n,Hangup()
exten => *15,1,NoCDR()
exten => *15,n,AGI(pbx_complemento.php,aplicacoes)
exten => *15,n,Authenticate(${DB(SENHA/${CALLERID(NUM)})},d,)
exten => *15,n,Noop(Desativando função não pertube)
exten => *15,n,Set(DB(NAOPERTUBE/${CALLERID(num)})=F)
exten => *15,n,AGI(facilidades.php)
exten => *15,n,Playback(beep&beep&de-activated)
exten => *15,n,Hangup()
[app-siga-me]
exten => *17,1,NoCDR()
exten => *17,n,AGI(pbx_complemento.php,aplicacoes)
exten => *17,n,Authenticate(${DB(SENHA/${CALLERID(NUM)})},d,)
exten => *17,n,Playback(vm-enter-num-to-call&vm-then-pound)
exten => *17,n,Read(DESTINO,,,n)
exten => *17,n,Noop(Ativando função siga-me interno para o ramal ${DESTINO})
exten => *17,n,Set(DB(SIGAME-INTERNO/${CALLERID(num)})=${DESTINO})
exten => *17,n,AGI(facilidades.php,${DESTINO})
exten => *17,n,Playback(beep&beep&activated)
exten => *17,n,Hangup()
exten => *18,1,NoCDR()
exten => *18,n,AGI(pbx_complemento.php,aplicacoes)
exten => *18,n,Authenticate(${DB(SENHA/${CALLERID(NUM)})},d,)
exten => *18,n,Noop(Desativando função siga-me interno)
exten => *18,n,Set(DB(SIGAME-INTERNO/${CALLERID(num)})=F)
exten => *18,n,AGI(facilidades.php)
exten => *18,n,Playback(beep&beep&de-activated)
exten => *18,n,Hangup()
exten => *19,1,NoCDR()
exten => *19,n,AGI(pbx_complemento.php,aplicacoes)
exten => *19,n,Authenticate(${DB(SENHA/${CALLERID(NUM)})},d,)
exten => *19,n,Noop(Ativando função siga-me externo para o numero ${EXTEN:5})
exten => *19,n,Playback(vm-enter-num-to-call&vm-then-pound)
exten => *19,n,Read(DESTINO,,,n)
exten => *19,n,Set(DB(SIGAME-EXTERNO/${CALLERID(num)})=${DESTINO})
exten => *19,n,AGI(facilidades.php,${DESTINO})
exten => *19,n,Playback(beep&beep&activated)
exten => *19,n,Hangup()
exten => *20,1,NoCDR()
exten => *20,n,AGI(pbx_complemento.php,aplicacoes)
exten => *20,n,Authenticate(${DB(SENHA/${CALLERID(NUM)})},d,)
exten => *20,n,Noop(Desativando função siga-me externo)
exten => *20,n,Set(DB(SIGAME-EXTERNO/${CALLERID(num)})=F)
exten => *20,n,AGI(facilidades.php)
exten => *20,n,Playback(beep&beep&de-activated)
exten => *20,n,Hangup()
exten => *21,1,NoCDR()
exten => *21,n,AGI(pbx_complemento.php,aplicacoes)
exten => *21,n,Authenticate(${DB(SENHA/${CALLERID(NUM)})},d,)
exten => *21,n,Noop(Ativando função siga-me quando ocupado para o numero ${EXTEN:5})
exten => *21,n,Playback(vm-enter-num-to-call&vm-then-pound)
exten => *21,n,Read(DESTINO,,,n)
exten => *21,n,Set(DB(SIGAME-OCUPADO/${CALLERID(num)})=${DESTINO})
exten => *21,n,AGI(facilidades.php,${DESTINO})
exten => *21,n,Playback(beep&beep&activated)
exten => *21,n,Hangup()
exten => *22,1,NoCDR()
exten => *22,n,AGI(pbx_complemento.php,aplicacoes)
exten => *22,n,Authenticate(${DB(SENHA/${CALLERID(NUM)})},d,)
exten => *22,n,Noop(Desativando função siga-me ocupado)
exten => *22,n,Set(DB(SIGAME-OCUPADO/${CALLERID(num)})=F)
exten => *22,n,AGI(facilidades.php)
exten => *22,n,Playback(beep&beep&de-activated)
exten => *22,n,Hangup()
exten => *23,1,NoCDR()
exten => *23,n,AGI(pbx_complemento.php,aplicacoes)
exten => *23,n,Authenticate(${DB(SENHA/${CALLERID(NUM)})},d,)
exten => *23,n,Noop(Ativando função siga-me externo para o numero ${EXTEN:5})
exten => *23,n(inicio),Playback(vm-enter-num-to-call&vm-then-pound)
exten => *23,n,Read(DESTINO,,,n,,)
exten => *23,n,GotoIf($["X${DESTINO}" = "X"]?invalido)
exten => *23,n,Set(DB(SIGAME-NAOATENDE/${CALLERID(num)})=${DESTINO})
exten => *23,n,AGI(facilidades.php,${DESTINO})
exten => *23,n,Playback(beep&beep&activated)
exten => *23,n,Hangup()
exten => *23,n(invalido),Playback(invalid)
exten => *23,n,Goto(inicio)
exten => *24,1,NoCDR()
exten => *24,n,AGI(pbx_complemento.php,aplicacoes)
exten => *24,n,Authenticate(${DB(SENHA/${CALLERID(NUM)})},d,)
exten => *24,n,Noop(Desativando função siga-me externo)
exten => *24,n,Set(DB(SIGAME-NAOATENDE/${CALLERID(num)})=F)
exten => *24,n,AGI(facilidades.php)
exten => *24,n,Playback(beep&beep&de-activated)
exten => *24,n,Hangup()
[app-rechamada]
exten => *25,1,NoCDR()
exten => *25,n,AGI(pbx_complemento.php,aplicacoes)
exten => *25,n,Set(ARQUIVO=${DB(RECHAMADA/${CALLERID(NUM)})})
exten => *25,n,System(/bin/rm ${ARQUIVO})
exten => *25,n,Playback(beep&beep&activated)
exten => *25,n,AGI(rechamada.php,${CALLERID(NUM)})
exten => *25,n,Hangup()
exten => *26,1,NoCDR()
exten => *26,n,AGI(pbx_complemento.php,aplicacoes)
exten => *26,n,Set(ARQUIVO=${DB(RECHAMADA/${CALLERID(NUM)})})
exten => *26,n,System(/bin/rm ${ARQUIVO})
exten => *26,n,Set(DB(RECHAMADA/${CALLERID(NUM)})=F)
exten => *26,n,Playback(beep&beep&de-activated)
exten => *26,n,Hangup()
[app-cadeado]
exten => *27,1,NoCDR()
exten => *27,n,AGI(pbx_complemento.php,aplicacoes)
exten => *27,n,Authenticate(${DB(SENHA/${CALLERID(NUM)})},d,)
exten => *27,n,Noop(Ativando função Cadeado Eletronico)
exten => *27,n,Set(DB(CADEADO/${CALLERID(NUM)})=V)
exten => *27,n,AGI(facilidades.php)
exten => *27,n,Playback(beep&beep&activated)
exten => *27,n,Hangup()
exten => *28,1,NoCDR()
exten => *28,n,AGI(pbx_complemento.php,aplicacoes)
exten => *28,n,Authenticate(${DB(SENHA/${CALLERID(NUM)})},d,)
exten => *28,n,Noop(Desativando função Cadeado Eletronico)
exten => *28,n,Set(DB(CADEADO/${CALLERID(NUM)})=F)
exten => *28,n,AGI(facilidades.php)
exten => *28,n,Playback(beep&beep&de-activated)
exten => *28,n,Hangup()
[app-chamada-espera]
exten => *29,1,NoCDR()
exten => *29,n,AGI(pbx_complemento.php,aplicacoes)
exten => *29,n,Authenticate(${DB(SENHA/${CALLERID(NUM)})},d,)
exten => *29,n,Noop(Ativando função Cadeado Eletronico)
exten => *29,n,Set(DB(CHAMADA-ESPERA/${CALLERID(NUM)})=V)
exten => *29,n,AGI(facilidades.php)
exten => *29,n,Playback(beep&beep&activated)
exten => *29,n,Hangup()
exten => *30,1,NoCDR()
exten => *30,n,AGI(pbx_complemento.php,aplicacoes)
exten => *30,n,Authenticate(${DB(SENHA/${CALLERID(NUM)})},d,)
exten => *30,n,Noop(Desativando função Cadeado Eletronico)
exten => *30,n,Set(DB(CHAMADA-ESPERA/${CALLERID(NUM)})=F)
exten => *30,n,AGI(facilidades.php)
exten => *30,n,Playback(beep&beep&de-activated)
exten => *30,n,Hangup()
[app-identifica-vm]
exten => *32,1,NoCDR()
exten => *32,n,AGI(pbx_complemento.php,aplicacoes)
exten => *32,n,Playback(appsounds/vm-caixapostal)
exten => *32,n,Set(VM=${DB(VM/${CALLERID(NUM)})})
exten => *32,n,SayDigits(${VM})
exten => *32,n,Playback(auth-thankyou)
exten => *32,n,Hangup()
[app-acessa-vm]
exten => *31,1,NoCDR()
exten => *31,n,AGI(pbx_complemento.php,aplicacoes)
exten => *31,n,VoiceMailMain(${DB(VM/${CALLERID(NUM)})})
exten => *31,n,Hangup()
[app-agenda-ramal]
exten => *33,1,NoCDR()
exten => *33,n,AGI(pbx_complemento.php,aplicacoes)
exten => *33,n,Authenticate(${DB(SENHA/${CALLERID(NUM)})},d,)
exten => *33,n,Noop(Ativando Agenda Ramal)
exten => *33,n(inicio),Background(speed-enterlocation&vm-then-pound,n)
exten => *33,n,Read(POSICAO-AGENDA,,,n,,30)
exten => *33,n,GotoIf($["X${POSICAO-AGENDA}" = "X"]?invalido)
exten => *33,n,Background(speed-enternumber&vm-then-pound,n)
exten => *33,n,Read(DESTINO-AGENDA,,,n,,30)
exten => *33,n,GotoIf($["X${DESTINO-AGENDA}" = "X"]?invalido)
exten => *33,n,Set(DB(AGENDA/${CALLERID(NUM)}/${POSICAO-AGENDA})=${DESTINO-AGENDA})
exten => *33,n,AGI(facilidades.php,${CALLERID(NUM)},${POSICAO-AGENDA},${DESTINO-AGENDA})
exten => *33,n,Playback(beep&beep&activated)
exten => *33,n,Goto(inicio)
exten => *33,n,Hangup()
exten => *33,n(invalido),Playback(invalid)
exten => *33,n,Goto(inicio)
exten => *33,n,Hangup()
exten => *34,1,NoCDR()
exten => *34,n,AGI(pbx_complemento.php,aplicacoes)
exten => *34,n,Authenticate(${DB(SENHA/${CALLERID(NUM)})},d,)
exten => *34,n,Noop(Desativando Agenda Ramal)
exten => *34,n(inicio),Background(speed-enterlocation&vm-then-pound,n)
exten => *34,n,Read(POSICAO-AGENDA,,,n,,30)
exten => *34,n,GotoIf($["X${POSICAO-AGENDA}" = "X"]?invalido)
exten => *34,n,Noop(${DB_DELETE(AGENDA/${CALLERID(NUM)}/${POSICAO-AGENDA})})
exten => *34,n,AGI(facilidades.php,${CALLERID(NUM)},${POSICAO-AGENDA},${DESTINO-AGENDA})
exten => *34,n,Playback(beep&beep&de-activated)
exten => *34,n,Goto(inicio)
exten => *34,n,Hangup()
exten => *34,n(invalido),Playback(invalid)
exten => *34,n,Goto(inicio)
exten => *34,n,Hangup()
[app-agenda-publica]
exten => *35,1,NoCDR()
exten => *35,n,AGI(pbx_complemento.php,aplicacoes)
exten => *35,n,Authenticate(${DB(SENHA/${CALLERID(NUM)})},d,)
exten => *35,n,Noop(Ativando Agenda Publica)
exten => *35,n(inicio),Background(speed-enterlocation&vm-then-pound,n)
exten => *35,n,Read(POSICAO-AGENDA,,,n,,30)
exten => *35,n,GotoIf($["X${POSICAO-AGENDA}" = "X"]?invalido)
exten => *35,n,Background(speed-enternumber&vm-then-pound,n)
exten => *35,n,Read(DESTINO-AGENDA,,,n,,30)
exten => *35,n,GotoIf($["X${DESTINO-AGENDA}" = "X"]?invalido)
exten => *35,n,Set(DB(AGENDA/${POSICAO-AGENDA})=${DESTINO-AGENDA})
exten => *35,n,AGI(facilidades.php,${POSICAO-AGENDA},${DESTINO-AGENDA})
exten => *35,n,Playback(beep&beep&activated)
exten => *35,n,Goto(inicio)
exten => *35,n,Hangup()
exten => *35,n(invalido),Playback(invalid)
exten => *35,n,Goto(inicio)
exten => *35,n,Hangup()
exten => *36,1,NoCDR()
exten => *36,n,AGI(pbx_complemento.php,aplicacoes)
exten => *36,n,Authenticate(${DB(SENHA/${CALLERID(NUM)})},d,)
exten => *36,n,Noop(Desativando Agenda Publica)
exten => *36,n(inicio),Background(speed-enterlocation&vm-then-pound,n)
exten => *36,n,Read(POSICAO-AGENDA,,,n,,30)
exten => *36,n,GotoIf($["X${POSICAO-AGENDA}" = "X"]?invalido)
exten => *36,n,Noop(${DB_DELETE(AGENDA/${POSICAO-AGENDA})})
exten => *36,n,AGI(facilidades.php,${POSICAO-AGENDA},${DESTINO-AGENDA})
exten => *36,n,Playback(beep&beep&de-activated)
exten => *36,n,Goto(inicio)
exten => *36,n,Hangup()
exten => *36,n(invalido),Playback(invalid)
exten => *36,n,Goto(inicio)
exten => *36,n,Hangup()
[app-ultimo-recebido]
exten => *16,1,NoCDR()
exten => *16,n,AGI(pbx_complemento.php,aplicacoes)
exten => *16,n,SayDigits(${DB(ULTIMO-RECEBIDO/${CALLERID(num)})})
exten => *16,n,Hangup()
[app-monitoramento]
exten => *37,1,NoCDR()
exten => *37,n,AGI(pbx_complemento.php,aplicacoes)
exten => *37,n,GotoIf($["X${DB(MONITORAMENTO/${CALLERID(NUM)})}" = "X"]?negado)
exten => *37,n(inicio),Read(DESTINO-MONITOR,vm-enter-num-to-call,,n,,)
exten => *37,n,GotoIf($["X${DESTINO-MONITOR}" = "X"]?invalido)
exten => *37,n,ChanSpy(${DB(DIAL/${DESTINO-MONITOR})},bq)
exten => *37,n,Hangup()
exten => *37,n(invalido),Playback(invalid)
exten => *37,n,Goto(inicio)
exten => *37,n(negado),Playback(appsounds/ramal-invalido&vm-goodbye)
exten => *37,n,Hangup()
[app-intercalar]
exten => *38,1,NoCDR()
exten => *38,n,AGI(pbx_complemento.php,aplicacoes)
exten => *38,n,GotoIf($["X${DB(MONITORAMENTO/${CALLERID(NUM)})}" = "X"]?negado)
exten => *38,n(inicio),Read(DESTINO-MONITOR,vm-enter-num-to-call,,n,,)
exten => *38,n,GotoIf($["X${DESTINO-MONITOR}" = "X"]?invalido)
exten => *38,n,ChanSpy(${DB(DIAL/${DESTINO-MONITOR})},bqw)
exten => *38,n,Hangup()
exten => *38,n(invalido),Playback(invalid)
exten => *38,n,Goto(inicio)
exten => *38,n(negado),Playback(appsounds/ramal-invalido&vm-goodbye)
exten => *38,n,Hangup()
[app-discagem-agenda]
exten => _*8.,1,AGI(pbx_complemento.php,app-discagem-agenda)
exten => _*8.,n,GotoIf($["X${DB(AGENDA/${CALLERID(NUM)}/${EXTEN:2})}" = "X"]?vazia)
exten => _*8.,n,Goto(saida-pstn,${DB(AGENDA/${CALLERID(NUM)}/${EXTEN:2})},disca)
exten => _*8.,n,Hangup()
exten => _*8.,n(vazia),Playback(speed-dial-empty)
exten => _*8.,n,Hangup()
exten => _*9.,1,AGI(pbx_complemento.php,app_discagem_agenda_ramal)
exten => _*9.,n,GotoIf($["X${DB(AGENDA/${EXTEN:2})}" = "X"]?vazia)
exten => _*9.,n,Goto(saida-pstn,${DB(AGENDA/${EXTEN:2})},disca)
exten => _*9.,n,Hangup()
exten => _*9.,n(vazia),Playback(speed-dial-empty)
exten => _*9.,n,Hangup()
[troca-senha]
exten => *5,1,Answer()
exten => *5,n,AGI(pbx_complemento.php,aplicacoes)
exten => *5,n,Goto(troca-senha-conta,s,1)
[troca-senha-conta]
exten => s,1,Answer()
exten => s,n,Background(appsounds/codigodeacesso&beep)
exten => s,n,WaitExten()
exten => _XXXX,1,Set(__CONTA=${EXTEN})
exten => _XXXX,n,Goto(troca-senha-senhaatual,s,1)
[troca-senha-senhaatual]
exten => s,1,Answer()
exten => s,n,Background(appsounds/senhaatual&beep)
exten => s,n,WaitExten()
exten => _XXXX,1,Set(_ATUAL=${EXTEN})
exten => _XXXX,n,AGI(confirma_senha.php)
exten => _XXXX,n,Noop(atual ? = ${ATUAL})
exten => _XXXX,n,Noop(atual no banco ? = ${ATUAL_DB})
exten => _XXXX,n,GotoIf($["${ATUAL}" = "${ATUAL_DB}"]?novasenha:invalida)
exten => _XXXX,n(invalida),Answer()
exten => _XXXX,n,Playback(appsounds/senha-invalida)
exten => _XXXX,n,Hangup()
exten => _XXXX,n(novasenha),Goto(troca-senha-novasenha,s,1)
[troca-senha-novasenha]
exten => s,1,Answer()
exten => s,n,Background(appsounds/novasenha&beep)
exten => s,n,WaitExten()
exten => _XXXX,1,Set(_NOVA=${EXTEN})
exten => _XXXX,n,Goto(troca-senha-confirmasenha,s,1)
[troca-senha-confirmasenha]
exten => s,1,Answer()
exten => s,n(confirme),Background(appsounds/confirme&beep)
exten => s,n,WaitExten()
exten => _XXXX,1,Set(_NOVA2=${EXTEN})
exten => _XXXX,n,GotoIf($["${NOVA}" = "${NOVA2}"]?atualiza:invalida)
exten => _XXXX,n(atualiza),Set(DATA=${STRFTIME(${EPOCH},,%Y-%m-%d %H:%M:%S)})
exten => _XXXX,n,AGI(update.php)
exten => _XXXX,n,Answer()
exten => _XXXX,n,Playback(appsounds/alterada-sucesso)
exten => _XXXX,n,Hangup()
exten => _XXXX,n(invalida),Answer()
exten => _XXXX,n,Playback(appsounds/senha-invalida)
exten => _XXXX,n,Hangup()
[captura-chamada]
exten => _*76X.,1,AGI(pbx_complemento.php,aplicacoes)
exten => _*76X.,n,PickUp(${EXTEN:3}@PICKUPMARK)
exten => _*76X.,n,Hangup()
[app-ausencia-grupo]
exten => *40,1,NoCDR()
exten => *40,n,AGI(pbx_complemento.php,aplicacoes)
exten => *40,n,Authenticate(${DB(SENHA/${CALLERID(NUM)})},d,)
exten => *40,n,Noop(Ativando funcao - AUSENCIA NO GRUPO)
exten => *40,n,PauseQueueMember(,Local/${CALLERID(NUM)}@padrao/n)
exten => *40,n,AGI(facilidades.php)
exten => *40,n,Playback(beep&beep&activated)
exten => *40,n,Hangup()
exten => *41,1,NoCDR()
exten => *41,n,AGI(pbx_complemento.php,aplicacoes)
exten => *41,n,Authenticate(${DB(SENHA/${CALLERID(NUM)})},d,)
exten => *41,n,Noop(Desativando funcao - AUSENCIA NO GRUPO)
exten => *41,n,UnPauseQueueMember(,Local/${CALLERID(NUM)}@padrao/n)
exten => *41,n,AGI(facilidades.php)
exten => *41,n,Playback(beep&beep&de-activated)
exten => *41,n,Hangup()
[app-conferencia-dinamica]
exten => *99,1,Macro(inicia-conferencia)
exten => *99,n,Hangup()

1
version_1.8.2/pabx/etc/asterisk/extensions_fila.conf

@ -0,0 +1 @@
[ext-fila]

1
version_1.8.2/pabx/etc/asterisk/extensions_fila_login.conf

@ -0,0 +1 @@
[ext-fila-login]

23
version_1.8.2/pabx/etc/asterisk/extensions_general.conf

@ -0,0 +1,23 @@
clearglobalvars = yes
static = yes
writeprotect = no
[globals]
;Scripts CallCenter
INSERIR = /var/lib/asterisk/scripts/callcenter/inserir-agente.php
ATUALIZAR = /var/lib/asterisk/scripts/callcenter/atualizar-agente.php
DELETAR = /var/lib/asterisk/scripts/callcenter/deletar-agente.php
CANAL = /var/lib/asterisk/scripts/callcenter/atualizar-canal.php
TRANSFERENCIA = /var/lib/asterisk/scripts/callcenter/atualizar-transferencia.php
MONITORAR = /var/lib/asterisk/scripts/callcenter/atualizar-monitorar.php
INTERCALAR = /var/lib/asterisk/scripts/callcenter/atualizar-intercalar.php
DYNAMIC_FEATURES=app-hangup-agentes
TRANSFER_CONTEXT=ext-transferencia
TEMPODERING=45
OPCOESDIAL=wWKk
INTEGRACAO = /var/lib/asterisk/scripts/integracao/serverAgi.php
INTEGRACAO_ABD = /var/lib/asterisk/scripts/integracao/abdAgi.php
RECHAMADA = /var/lib/asterisk/scripts/rechamada.sh
TIMEOUT_PREPAGO=86400000
LOGOFFAGENTE = /var/lib/asterisk/scripts/callcenter/logoff-agente.php
;LOGOFFAGENTERAMAL = /var/lib/asterisk/scripts/callcenter/logoff_agente_ramal.php

2
version_1.8.2/pabx/etc/asterisk/extensions_grupos.conf

@ -0,0 +1,2 @@
[ext-grupos]
include => ext-grupos-custom

0
version_1.8.2/pabx/etc/asterisk/extensions_grv.conf

3
version_1.8.2/pabx/etc/asterisk/extensions_horarios.conf

@ -0,0 +1,3 @@
[ext-horarios]
include => ext-horarios-custom
exten => h,1,Macro(hangup)

158
version_1.8.2/pabx/etc/asterisk/extensions_minivm.conf

@ -0,0 +1,158 @@
; MINI-VOICEMAIL dialplan example
; ---------------------------------------------------------------------------------------
; ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
;
;
; This is an example on how to use the Mini-Voicemail system to build
; voicemail systems.
;
;.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
; A macro to test the MINIVMACCOUNT dialplan function
; Currently, accountcode and pincode is not used in the application
; They where added to be used in dialplan scripting
;
;
[macro-minivmfunctest]
exten => s,1,set(account=${ARGV1})
exten => minivm,n,verbose(1,-------------------- Minivm Function test - Accoutn ${account} -------------)
exten => s,n,verbose(1,---- Has account: ${MINIVMACCOUNT(${account}:hasaccount)})
exten => s,n,verbose(1,---- Fullname: ${MINIVMACCOUNT(${account}:fullname)})
exten => s,n,verbose(1,---- Email: ${MINIVMACCOUNT(${account}:email)})
exten => s,n,verbose(1,---- Pager: ${MINIVMACCOUNT(${account}:pager)})
exten => s,n,verbose(1,---- E-mail template: ${MINIVMACCOUNT(${account}:etemplate)})
exten => s,n,verbose(1,---- Pager template: ${MINIVMACCOUNT(${account}:ptemplate)})
exten => s,n,verbose(1,---- Account code: ${MINIVMACCOUNT(${account}:accountcode)})
exten => s,n,verbose(1,---- Path: ${MINIVMACCOUNT(${account}:path)})
exten => s,n,verbose(1,---- Pincode: ${MINIVMACCOUNT(${account}:pincode)})
exten => s,n,verbose(1,---- Time zone: ${MINIVMACCOUNT(${account}:timezone)})
exten => s,n,verbose(1,---- Language: ${MINIVMACCOUNT(${account}:language)})
; This requires setvar=customerclass=gold in the account configuration
exten => s,n,verbose(1,---- Var:customerclass: ${MINIVMACCOUNT(${account}:customerclass)})
[minivm-scenario1]
; minivmtest tests the dialplan function MINIVMACCOUNT
; Check the output in the console with verbose set
exten => minivmtest,1,answer
exten => minivmtest,n,wait(0.5)
exten => minivmtest,n,set(ACCOUNT=do-not-spam-me@example.com)
exten => minivmtest,n,macro(minivmfunctest, ${ACCOUNT})
exten => minivmtest,n,playback(beep)
exten => minivmtest,n,hangup
;.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
; "minivm" tests a full scenario
; Remember that users may hangup
; This works both for users with accounts in minivm.conf and by just giving an e-mail address
; without configuring an account
exten => minivm,1,answer
exten => minivm,n,wait(0.5) ; Wait for Voip channels to settle
exten => minivm,n,set(account=oej@example.com)
exten => minivm,n,noop(------------------------------------------- Minivm Greet -------------)
exten => minivm,n,minivmgreet(${account})
exten => minivm,n,verbose(1,-- MINIVM_GREET_STATUS = ${MINIVM_GREET_STATUS} )
exten => minivm,n,noop(------------------------------------------- Minivm Record -------------)
exten => minivm,n,minivmRecord(${account},b)
exten => minivm,n,goto(minivmcleanup,1)
; Cleanup after recording or hangup
exten => minivmcleanup,1,noop(------------------------------------------- Minivm Notify -------------)
;Increment voicemail counter with 1. The counter will be used in the e-mail message
;and in the filename
exten => minivmcleanup,n,gotoif($[${MINIVM_RECORD_STATUS} != SUCCESS]?minivmrecordfailure,1)
exten => minivmcleanup,n,set(MINIVMCOUNTER(${account}:voicemailcounter:inc)=1)
exten => minivmcleanup,n,set(MVM_COUNTER = ${MINIVMCOUNTER(${account}:voicemailcounter)})
exten => minivmcleanup,n,minivmNotify(${account})
exten => minivmcleanup,n,verbose(1,-- MINIVM_NOTIFY_STATUS = ${MINIVM_NOTIFY_STATUS} )
; Now, clean up after sending voicemail
exten => minivmcleanup,n,noop(------------------------------------------- Minivm Delete -------------)
exten => minivmcleanup,n,minivmdelete()
exten => minivmcleanup,n,verbose(1,-- MINIVM_DELETE_STATUS = ${MINIVM_DELETE_STATUS} )
;Recording failed
exten => minivmrecordfailure,1,playback(vm-sorry)
exten => minivmrecordfailure,n,wait(1)
exten => minivmrecordfailure,n,hangup
; If the user hangs up during the recording, we need to clean up
; And send notifications
exten => h,1,gotoif($[x${MINIVM_DELETE_STATUS} != x] ?h,stop)
exten => h,n,noop(------------------------------------------- HANGUP during voicemail recording -------------)
exten => h,n,goto(minivmcleanup,1)
exten => h,n(stop),noop(---Minivm DONE----)
;.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
; Extension to record a greeting message
; Call this like:
; macro(recordgreetings,alice@atlanta.example.com)
;
[macro-recordgreetings]
exten => s,1,answer
exten => s,n,wait(0.5)
exten => s,n,set(account=${ARGV1])
; This file give extra options not available here, needs to be edited
; Change of password does not work
exten => s,n(menu),background(vm-options)
exten => 1,1,setvar(option=u)
exten => 1,n,macro(minivmrec,${account},${option})
exten => 1,n,goto(menu)
exten => 2,1,setvar(option=b)
exten => 2,n,macro(minivmrec,${account},${option})
exten => 2,n,goto(menu)
exten => 3,1,setvar(option=n)
exten => 3,n,macro(minivmrec,${account},${option})
exten => 3,n,goto(menu)
exten => 4,1,setvar(option=t)
exten => 4,n,macro(minivmrec,${account},${option})
exten => 4,n,goto(menu)
exten => *,1,playback(vm-thankyou)
exten => *,n,wait(1)
exten => *,n,hangup
exten => i,1,playback(invalid)
exten => i,n,goto(menu)
[macro-minivmrec]
exten => s,1,gotoif(${MINIVMACCOUNT(${account}:hasaccount)}?record)
; Account is not configured in minivm.conf or realtime
; Phony message, add something useful here
exten => s,n,playback(privacy-incorrect)
exten => s,n,macroreturn
exten => record,1,minivmappmess(${ARGV1},${ARGV2})
exten => record,n,noop(Recording status: ${MINIVM_APPMESS_STATUS})
exten => record,n,macroreturn
;.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
; To set a counter and use a template for voicemail to users without acounts
; use something like this
;
; email address is in the "account" channel variable. Set from ast_db or a script
; based on called ID
exten => sendvoicemail,1,answer
exten => sendvoicemail,n,wait(0.5)
exten => sendvoicemail,n,set(domain=${CUT(account,@,2)})
exten => sendvoicemail,n,set(country=${CUT(domain,.,2)})
exten => sendvoicemail,n,minivmgreet(${account})
exten => sendvoicemail,n,minivmRecord(${account},b)
exten => sendvoicemail,n,goto(sendvmcleanup)
exten => sendvmcleanup,1,gotoif($[${MINIVM_RECORD_STATUS} != SUCCESS]?done)
; The counter is set in the domain directory, so we don't create one directory per user
; The counter has the email in the name of the counter, increase it
; Set the MVM_COUNTER variable that we use in the template
exten => sendvmcleanup,n,set(MINIVMCOUNTER(${account}:voicemailcounter:inc)=1)
exten => sendvmcleanup,n,set(MVM_COUNTER = ${MINIVMCOUNTER(${account}:voicemailcounter)})
; Increase a domain counter too, to see how many voicemails are sent to this domain
; This is just for statistics
exten => sendvmcleanup,n,set(MINIVMCOUNTER(${domain}:${domain}-all:inc) = 1)
; Send voicemail in e-mail with country-specific template
; The template need to be defined in minivm.conf
;
exten => sendvmcleanup,n,minivmNotify(${account}, ${country}_email)
exten => sendvmcleanup,n,minivmDelete()
exten => sendvmcleanup,n(done),wait(0.5)
exten => sendvmcleanup,n,hangup
exten => h,1,gotoif($[${MINIVM_RECORD_STATUS} = SUCCESS]?sendvmcleanup,1))

1830
version_1.8.2/pabx/etc/asterisk/extensions_padrao.conf

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save