Instalando Asterisk 11 no CentOS 7.8.2003
Instalando o Asterisk 11 no CentOS 7.8.2003, dahdi-linux-complete-3.1.0+3.1.0, libpri-1.6.0, voicerlib-4.2.5.6, asterisk-11.25.3.tar.gz, dgvchannel-1.1.8.
Primeiramente devemos assumir o diretório “/usr/src/” como padrão de instalação dos pacotes linux:
cd /usr/src/
Para instalar os pacotes de compilação necessários no CentOS, análogos ao libtools, utilize o seguinte comando:
yum groupinstall 'Development Tools'
Dahdi-linux
Para instalar a libpri é necessário a instalação da dahdi-linux, então eu baixei a
dahdi-linux-complete-3.1.0+3.1.0.tar.gz completa, descompactei, compilei e instalei com os seguintes comandos:
wget https://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-3.1.0+3.1.0.tar.gz
tar -xvzf dahdi-linux-complete-3.1.0+3.1.0
cd dahdi-linux-complete-3.1.0+3.1.0/
make all
make install
make config
Veja o final da instalação do dahdi-linux:
libtool: install: /usr/bin/install -c dahdi_monitor /usr/sbin/dahdi_monitor
libtool: install: /usr/bin/install -c .libs/dahdi_cfg /usr/sbin/dahdi_cfg
libtool: install: /usr/bin/install -c dahdi_speed /usr/sbin/dahdi_speed
libtool: install: /usr/bin/install -c dahdi_scan /usr/sbin/dahdi_scan
libtool: install: /usr/bin/install -c fxotune /usr/sbin/fxotune
libtool: install: /usr/bin/install -c sethdlc /usr/sbin/sethdlc
make install-exec-hook
make[4]: Entrando no diretório `/usr/src/dahdi-linux-complete-3.1.0+3.1.0/tools'
make -f ./Makefile.legacy top_srcdir=. srcdir=. install
make[5]: Entrando no diretório `/usr/src/dahdi-linux-complete-3.1.0+3.1.0/tools'
/sbin/restorecon -v /usr/lib/
###################################################
###
### DAHDI tools installed successfully.
### If you have not done so before, install init scripts with:
###
### make install-config
###
###################################################
make[5]: Saindo do diretório `/usr/src/dahdi-linux-complete-3.1.0+3.1.0/tools'
Compatibility symlinks (should be removed in the future)
ln -sf libtonezone.so.2.0.0 /usr/lib/libtonezone.so.2.0
make[4]: Saindo do diretório `/usr/src/dahdi-linux-complete-3.1.0+3.1.0/tools'
/usr/bin/mkdir -p '/etc/dahdi'
/usr/bin/install -c -m 644 system.conf.sample assigned-spans.conf.sample span-types.conf.sample modules.sample '/etc/dahdi'
/usr/bin/mkdir -p '/usr/include/dahdi'
/usr/bin/install -c -m 644 tonezone.h '/usr/include/dahdi'
/usr/bin/mkdir -p '/etc/udev/rules.d'
/usr/bin/install -c -m 644 dahdi.rules '/etc/udev/rules.d'
make install-data-hook
make[4]: Entrando no diretório `/usr/src/dahdi-linux-complete-3.1.0+3.1.0/tools'
mkdir -p /etc/bash_completion.d
install -m 644 ./dahdi-bash-completion /etc/bash_completion.d/dahdi
make[4]: Saindo do diretório `/usr/src/dahdi-linux-complete-3.1.0+3.1.0/tools'
make[3]: Saindo do diretório `/usr/src/dahdi-linux-complete-3.1.0+3.1.0/tools'
make[2]: Saindo do diretório `/usr/src/dahdi-linux-complete-3.1.0+3.1.0/tools'
make[1]: Saindo do diretório `/usr/src/dahdi-linux-complete-3.1.0+3.1.0/tools'
Para resolver problemas como “pridump.c:45:24: fatal error: dahdi/user.h:” basta instalar o kernel-devel corretamente, ao instalar lembre-se de alterar o “uname -r” pela versão que esse comando retornar, a não ser que utilize “crase” em volta do comando, ai o linux entenderá como comando e retornará automaticamente a versão do kernel.
#yum install kernel-devel-`uname -r`
Depois de instalar o dahdi-linux e tiver uma placa para ser instalada junto com o Asterisk, é bom executar o comando de configuração do dahdi, veja:
make install-config
Veja a seguir o resultado do comando acima:
make[5]: Saindo do diretório `/usr/src/dahdi-linux-complete-3.1.0+3.1.0/tools'
Compatibility symlinks (should be removed in the future)
ln -sf libtonezone.so.2.0.0 /usr/lib/libtonezone.so.2.0
make[4]: Saindo do diretório `/usr/src/dahdi-linux-complete-3.1.0+3.1.0/tools'
/usr/bin/mkdir -p '/etc/dahdi'
/usr/bin/install -c -m 644 system.conf.sample assigned-spans.conf.sample span-types.conf.sample modules.sample '/etc/dahdi'
/usr/bin/mkdir -p '/usr/include/dahdi'
/usr/bin/install -c -m 644 tonezone.h '/usr/include/dahdi'
/usr/bin/mkdir -p '/etc/udev/rules.d'
/usr/bin/install -c -m 644 dahdi.rules '/etc/udev/rules.d'
make install-data-hook
make[4]: Entrando no diretório `/usr/src/dahdi-linux-complete-3.1.0+3.1.0/tools'
mkdir -p /etc/bash_completion.d
install -m 644 ./dahdi-bash-completion /etc/bash_completion.d/dahdi
make[4]: Saindo do diretório `/usr/src/dahdi-linux-complete-3.1.0+3.1.0/tools'
make[3]: Saindo do diretório `/usr/src/dahdi-linux-complete-3.1.0+3.1.0/tools'
make[2]: Saindo do diretório `/usr/src/dahdi-linux-complete-3.1.0+3.1.0/tools'
make[1]: Saindo do diretório `/usr/src/dahdi-linux-complete-3.1.0+3.1.0/tools'
make -C tools install-config
make[1]: Entrando no diretório `/usr/src/dahdi-linux-complete-3.1.0+3.1.0/tools'
mkdir -p /etc/dahdi
mkdir -p /etc/modprobe.d
install -m644 xpp/genconf_parameters /etc/dahdi/genconf_parameters
install -m644 init.conf.sample /etc/dahdi/init.conf
install -m644 blacklist.sample /etc/modprobe.d/dahdi-blacklist.conf
install -m644 modprobe.conf.sample /etc/modprobe.d/dahdi.conf
make -f ./Makefile.legacy top_srcdir=. srcdir=. config
make[2]: Entrando no diretório `/usr/src/dahdi-linux-complete-3.1.0+3.1.0/tools'
install -D dahdi.init /etc/rc.d/init.d/dahdi
install -D ifup-hdlc /etc/sysconfig/network-scripts/ifup-hdlc
/sbin/chkconfig --add dahdi
DAHDI has been configured.
List of detected DAHDI devices:
No hardware found
make[2]: Saindo do diretório `/usr/src/dahdi-linux-complete-3.1.0+3.1.0/tools'
make[1]: Saindo do diretório `/usr/src/dahdi-linux-complete-3.1.0+3.1.0/tools'
Veja que no final ele informou que não encontrou nenhum hardware presente.
Libpri
Depois da instalação do dahdi-linux é possível instalar a libpri. Eu baixei, descompactei, compilei e instalei a seguinte versão libpri-1.6.0:
wget https://downloads.asterisk.org/pub/telephony/libpri/libpri-1.6.0.tar.gz
tar -xvzf libpri-1.6.0.tar.gz
cd libpri-1.6.0/
make all
make install
Veja o resultado da compilação do libpri:
[root@localhost libpri-1.6.0]# make all
gcc -g -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -fPIC -O2 -MD -MT pridump.o -MF .pridump.o.d -MP -c -o pridump.o pridump.c
gcc -o pridump pridump.o -L. -lpri -g -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -fPIC -O2
gcc -g -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -fPIC -O2 -MD -MT pritest.o -MF .pritest.o.d -MP -c -o pritest.o pritest.c
gcc -o pritest pritest.o libpri.a -g -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -fPIC -O2
gcc -g -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -fPIC -O2 -MD -MT rosetest.o -MF .rosetest.o.d -MP -c -o rosetest.o rosetest.c
gcc -o rosetest rosetest.o libpri.a -g -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -fPIC -O2
gcc -g -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -fPIC -O2 -D_REENTRANT -D_GNU_SOURCE -MD -MT testprilib.o -MF .testprilib.o.d -MP -c -o testprilib.o testprilib.c
gcc -o testprilib testprilib.o libpri.a -lpthread -g -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -fPIC -O2
[root@localhost libpri-1.6.0]# make install
mkdir -p /usr/lib
mkdir -p /usr/include
install -m 644 libpri.h /usr/include
install -m 755 libpri.so.1.4 /usr/lib
#if [ -x /usr/sbin/sestatus ] && ( /usr/sbin/sestatus | grep "SELinux status:" | grep -q "enabled"); then /sbin/restorecon -v /usr/lib/libpri.so.1.4; fi
( cd /usr/lib ; ln -sf libpri.so.1.4 libpri.so)
install -m 644 libpri.a /usr/lib
if test $(id -u) = 0; then /sbin/ldconfig -n /usr/lib; fi
Voicerlib
Agora o próximo passo é instalar as bibliotecas da digivoice, eu baixei, descompactei, compilei e instalei a seguinte versão voicerlib-4.2.5.6.tar.gz:
wget http://www.digivoice.com.br/docs/voicerlib-4.2.5.6.tar.gz
tar -xvzf voicerlib-4.2.5.6.tar.gz
cd voicerlib-4.2.5.6/
make all
make install
make config
Veja o resultado do final da instalação acima:
cc -fPIC -std=gnu99 -D__LINUX__ -DK_ECHO -I../../../../src_common vbfxs.c -L../../../../src_linux -ldigivoice -lncurses -lpthread -lm -o vbfxs
vbfxs.c: In function âReceiveEventsâ:
vbfxs.c:157:7: warning: passing argument 1 of âsprintfâ makes pointer from integer without a cast [enabled by default]
sprintf(EventContext-> port, "(EV_AFTERDIAL) - Erro ao iniciar ring. Ret %d", ret);
^
In file included from vbfxs.c:13:0:
/usr/include/stdio.h:364:12: note: expected âchar * restrictâ but argument is of type âshort unsigned intâ
extern int sprintf (char *__restrict __s,
^
vbfxs.c:159:7: warning: passing argument 1 of âsprintfâ makes pointer from integer without a cast [enabled by default]
sprintf(EventContext-> port, "(EV_AFTERDIAL) - Iniciou ring com sucesso!");
^
In file included from vbfxs.c:13:0:
/usr/include/stdio.h:364:12: note: expected âchar * restrictâ but argument is of type âshort unsigned intâ
extern int sprintf (char *__restrict __s,
^
install -m 755 vbfxs /usr/bin/vlib_vbfxs
make[1]: Saindo do diretório `/usr/src/voicerlib-4.2.5.6/samples/dll_so/diags/vbfxs'
make[1]: Entrando no diretório `/usr/src/voicerlib-4.2.5.6/samples/dll_so/diags/vbgsm'
cc -fPIC -std=gnu99 -D__LINUX__ -DK_ECHO -I../../../../src_common -c -o vbgsm.o vbgsm.c
cc -fPIC -std=gnu99 -D__LINUX__ -DK_ECHO -I../../../../src_common vbgsm.c -L../../../../src_linux -ldigivoice -lncurses -lpthread -lm -o vbgsm
install -m 755 vbgsm /usr/bin/vlib_vbgsm
make[1]: Saindo do diretório `/usr/src/voicerlib-4.2.5.6/samples/dll_so/diags/vbgsm'
make[1]: Entrando no diretório `/usr/src/voicerlib-4.2.5.6/samples/dll_so/diags/vbtst'
cc -fPIC -std=gnu99 -D__LINUX__ -DK_ECHO -I../../../../src_common -c -o vbtst.o vbtst.c
cc -fPIC -std=gnu99 -D__LINUX__ -DK_ECHO -I../../../../src_common vbtst.c -L../../../../src_linux -ldigivoice -lncurses -lpthread -lm -o vbtst
install -m 755 vbtst /usr/bin/vlib_vbtst
make[1]: Saindo do diretório `/usr/src/voicerlib-4.2.5.6/samples/dll_so/diags/vbtst'
+-------- VoicerLib4 Install Complete -------+
+ VoicerLib4 has successfully been installed +
+--------------------------------------------+
[root@localhost voicerlib-4.2.5.6]# make config
make[1]: Entrando no diretório `/usr/src/voicerlib-4.2.5.6/driver/linux'
Setting up the init script and system configuration...
Installing a Non-Debian init script
make[1]: Saindo do diretório `/usr/src/voicerlib-4.2.5.6/driver/linux'
Se o seguinte erro se apresentar “vlib_diag.c:30:21: fatal error: ncurses.h: Arquivo ou diretório não encontrado”, significa que faltou instalar a biblioteca ncurses. dai podemos resolver instalado com o seguinte comando:
yum install ncurses*
Asterisk
O próximo passo seria a instalação do Asterisk. Eu baixei, descompactei, configurei, compilei e instalei a seguinte versão
wget https://downloads.asterisk.org/pub/telephony/asterisk/old-releases/asterisk-11.25.3.tar.gz
tar -xvzf asterisk-11.25.3.tar.gz
cd asterisk-11.25.3/
./configure
make all
make install
make samples
O resultado positivo do comando “./configure” do Asterisk deve ser como o exemplo abaixo:
checking for initscr in -lcurses... yes
checking curses.h usability... yes
checking curses.h presence... yes
checking for curses.h... yes
checking for initscr in -lncurses... yes
checking for curses.h... (cached) yes
checking for a sed that does not truncate output... /usr/bin/sed
checking for xml2-config... /bin/xml2-config
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for GTK2... no
configure: creating ./config.status
config.status: creating makeopts
config.status: creating autoconfig.h
configure: Menuselect build configuration successfully completed
.$$$$$$$$$$$$$$$=..
.$7$7.. .7$$7:.
.$$:. ,$7.7
.$7. 7$$$$ .$$77
..$$. $$$$$ .$$$7
..7$ .?. $$$$$ .?. 7$$$.
$.$. .$$$7. $$$$7 .7$$$. .$$$.
.777. .$$$$$$77$$$77$$$$$7. $$$,
$$$~ .7$$$$$$$$$$$$$7. .$$$.
.$$7 .7$$$$$$$7: ?$$$.
$$$ ?7$$$$$$$$$$I .$$$7
$$$ .7$$$$$$$$$$$$$$$$ :$$$.
$$$ $$$$$$7$$$$$$$$$$$$ .$$$.
$$$ $$$ 7$$$7 .$$$ .$$$.
$$$$ $$$$7 .$$$.
7$$$7 7$$$$ 7$$$
$$$$$ $$$
$$$$7. $$ (TM)
$$$$$$$. .7$$$$$$ $$
$$$$$$$$$$$$7$$$$$$$$$.$$$$$$
$$$$$$$$$$$$$$$$.
configure: Package configured for:
configure: OS type : linux-gnu
configure: Host CPU : x86_64
configure: build-cpu:vendor:os: x86_64 : unknown : linux-gnu :
configure: host-cpu:vendor:os: x86_64 : unknown : linux-gnu :
O fim do resultado da compilação do asterisk deve ser parecido como a seguir:
checking for mawk... gawk
checking host system type... x86_64-unknown-linux-gnu
checking for a BSD compatible install... /usr/bin/install -c
checking for ranlib... ranlib
checking for ar... /usr/bin/ar
checking for tgetent in -ltermcap... yes
checking for termcap.h... yes
checking for sys/cdefs.h... yes
checking for vis.h... no
checking for issetugid... no
checking for fgetln... no
checking for strvis... no
checking for strunvis... no
checking for strlcpy... no
checking for strlcat... no
updating cache ./config.cache
creating ./config.status
creating Makefile
creating makelist
creating config.h
[LD] abstract_jb.o acl.o adsi.o alaw.o aoc.o app.o ast_expr2.o ast_expr2f.o asterisk.o astfd.o astmm.o astobj2.o audiohook.o autochan.o autoservice.o bridging.o callerid.o ccss.o cdr.o cel.o channel.o channel_internal_api.o chanvars.o cli.o config.o config_options.o data.o datastore.o db.o devicestate.o dial.o dns.o dnsmgr.o dsp.o enum.o event.o features.o file.o fixedjitterbuf.o format.o format_cap.o format_pref.o frame.o framehook.o fskmodem.o global_datastores.o hashtab.o heap.o http.o image.o indications.o io.o jitterbuf.o loader.o lock.o logger.o manager.o md5.o message.o named_acl.o netsock.o netsock2.o pbx.o plc.o poll.o presencestate.o privacy.o rtp_engine.o say.o sched.o security_events.o sha1.o sip_api.o slinfactory.o srv.o stdtime/localtime.o strcompat.o strings.o stun.o syslog.o taskprocessor.o tcptls.o tdd.o term.o test.o threadstorage.o timing.o translate.o udptl.o ulaw.o utils.o version.o xml.o xmldoc.o editline/libedit.a -> asterisk
Building Documentation For: channels pbx apps codecs formats cdr cel bridges funcs tests main res addons
+--------- Asterisk Build Complete ---------+
+ Asterisk has successfully been built, and +
+ can be installed by running: +
+ +
+ make install +
+-------------------------------------------+
O final do resultado da instalação do asterisk deve ser parecido com o a seguir:
/usr/bin/install -c -m 644 doc/core-en_US.xml "/var/lib/asterisk/static-http";
if [ -d doc/tex/asterisk ] ; then \
/usr/bin/install -c -d "/var/lib/asterisk/static-http/docs" ; \
for n in doc/tex/asterisk/* ; do \
/usr/bin/install -c -m 644 $n "/var/lib/asterisk/static-http/docs" ; \
done \
fi
for x in images/*.jpg; do \
/usr/bin/install -c -m 644 $x "/var/lib/asterisk/images" ; \
done
make -C sounds install
make[1]: Entrando no diretório `/usr/src/asterisk-11.25.3/sounds'
make[1]: Saindo do diretório `/usr/src/asterisk-11.25.3/sounds'
+---- Asterisk Installation Complete -------+
+ +
+ YOU MUST READ THE SECURITY DOCUMENT +
+ +
+ Asterisk has successfully been installed. +
+ If you would like to install the sample +
+ configuration files (overwriting any +
+ existing config files), run: +
+ +
+ make samples +
+ +
+----------------- or ---------------------+
+ +
+ You can go ahead and install the asterisk +
+ program documentation now or later run: +
+ +
+ make progdocs +
+ +
+ **Note** This requires that you have +
+ doxygen installed on your local system +
+-------------------------------------------+
O final do resultado da geração dos arquivos de exemplo do asterisk deve ser como a seguir:
Installing file configs/unistim.conf.sample
Installing file configs/users.conf.sample
Installing file configs/voicemail.conf.sample
Installing file configs/vpb.conf.sample
Installing file configs/xmpp.conf.sample
if [ "y" = "y" ]; then \
echo "Updating asterisk.conf" ; \
sed -e 's|^astetcdir.*$|astetcdir => /etc/asterisk|' \
-e 's|^astmoddir.*$|astmoddir => /usr/lib/asterisk/modules|' \
-e 's|^astvarlibdir.*$|astvarlibdir => /var/lib/asterisk|' \
-e 's|^astdbdir.*$|astdbdir => /var/lib/asterisk|' \
-e 's|^astkeydir.*$|astkeydir => /var/lib/asterisk|' \
-e 's|^astdatadir.*$|astdatadir => /var/lib/asterisk|' \
-e 's|^astagidir.*$|astagidir => /var/lib/asterisk/agi-bin|' \
-e 's|^astspooldir.*$|astspooldir => /var/spool/asterisk|' \
-e 's|^astrundir.*$|astrundir => /var/run/asterisk|' \
-e 's|^astlogdir.*$|astlogdir => /var/log/asterisk|' \
-e 's|^astsbindir.*$|astsbindir => /usr/sbin|' \
"/etc/asterisk/asterisk.conf" > "/etc/asterisk/asterisk.conf.tmp" ; \
/usr/bin/install -c -m 644 "/etc/asterisk/asterisk.conf.tmp" "/etc/asterisk/asterisk.conf" ; \
rm -f "/etc/asterisk/asterisk.conf.tmp" ; \
fi ; \
/usr/bin/install -c -d "/var/spool/asterisk/voicemail/default/1234/INBOX"
Updating asterisk.conf
build_tools/make_sample_voicemail "//var/lib/asterisk" "//var/spool/asterisk"
Installing file phoneprov/000000000000.cfg
Installing file phoneprov/000000000000-directory.xml
Installing file phoneprov/000000000000-phone.cfg
Installing file phoneprov/polycom_line.xml
Installing file phoneprov/polycom.xml
Installing file phoneprov/snom-mac.xml
Se ocorrer o seguinte erro “configure: *** or install the ‘libxml2’ development package.”, significa que está faltando a biblioteca xml2. Para resolver basta instalar com o seguinte comando:
yum install libxml2*
Se ocorrer o seguinte erro “configure: error: *** Asterisk now uses SQLite3 for the internal Asterisk database.”, significa que está faltando o SDB sqlite3. Para resolver basta consultar a versão mais adequada para o CentOS com o comando “yum list | grep sqlite”, encontrar a versão, que no meu caso foi a “sqlite-devel.x86_64” e instalar com o seguinte comando:
yum install sqlite-devel.x86_64
DGVChannel
O próximo passo agora é instalar os drivers da Digivoice, referente aos canais DDR, conhecidos como DGVChannel. Eu baixei, descompactei, compilei e instalei a seguinte versão dgvchannel-1.1.8.tar.gz:
wget http://www.digivoice.com.br/docs/dgvchannel-1.1.8.tar.gz
tar -xvzf dgvchannel-1.1.8.tar.gz
cd dgvchannel-1.1.8/
ln -s /usr/include/ /usr/src/libpri
ln -s /usr/src/asterisk-11.25.3 /usr/src/asterisk
make
make install
make config
make install_config
O final do resultado da compilação do DGVChannel deve ser como a seguir:
gcc -shared -Xlinker -x -o app_dggsmchangecsca.so app_dggsmchangecsca.o -ldigivoice
gcc -std=gnu99 -pipe -fPIC -Wall -Wmissing-prototypes -Wmissing-declarations -I/usr/src/asterisk/include -D_REENTRANT -D_GNU_SOURCE -D__LINUX__ -c -o auto_conf_dgv.o auto_conf_dgv.c
gcc -o auto_conf_dgv -std=gnu99 -pipe -fPIC -Wall -Wmissing-prototypes -Wmissing-declarations -I/usr/src/asterisk/include -D_REENTRANT -D_GNU_SOURCE -D__LINUX__ auto_conf_dgv.o -I/usr/include/voicerlib -pthread -ldigivoice -lm
make -C fifodev
make[1]: Entrando no diretório `/usr/src/dgvchannel-1.1.8/fifodev'
Building FIFO device for kernel 3.x...
make -C /lib/modules/3.10.0-1127.el7.x86_64/build -I/usr/include/asm/mach-default/ SUBDIRS=/usr/src/dgvchannel-1.1.8/fifodev modules
make[2]: Entrando no diretório `/usr/src/kernels/3.10.0-1127.el7.x86_64'
CC [M] /usr/src/dgvchannel-1.1.8/fifodev/dgvfifo.o
Building modules, stage 2.
MODPOST 1 modules
CC /usr/src/dgvchannel-1.1.8/fifodev/dgvfifo.mod.o
LD [M] /usr/src/dgvchannel-1.1.8/fifodev/dgvfifo.ko
make[2]: Saindo do diretório `/usr/src/kernels/3.10.0-1127.el7.x86_64'
make[1]: Saindo do diretório `/usr/src/dgvchannel-1.1.8/fifodev'
######## Channel Driver Build Complete ########
# Channel Driver has successfully been built, #
# and can be installed by running: #
# #
# make install #
###############################################
O resultado da instalação do DGVChannel deve ser como a seguir:
make -C fifodev
make[1]: Entrando no diretório `/usr/src/dgvchannel-1.1.8/fifodev'
Building FIFO device for kernel 3.x...
make -C /lib/modules/3.10.0-1127.el7.x86_64/build -I/usr/include/asm/mach-default/ SUBDIRS=/usr/src/dgvchannel-1.1.8/fifodev modules
make[2]: Entrando no diretório `/usr/src/kernels/3.10.0-1127.el7.x86_64'
Building modules, stage 2.
MODPOST 1 modules
make[2]: Saindo do diretório `/usr/src/kernels/3.10.0-1127.el7.x86_64'
make[1]: Saindo do diretório `/usr/src/dgvchannel-1.1.8/fifodev'
######## Channel Driver Build Complete ########
# Channel Driver has successfully been built, #
# and can be installed by running: #
# #
# make install #
###############################################
install -d -m 755 /usr/lib/asterisk/modules
make install -C fifodev
make[1]: Entrando no diretório `/usr/src/dgvchannel-1.1.8/fifodev'
Building FIFO device for kernel 3.x...
make -C /lib/modules/3.10.0-1127.el7.x86_64/build -I/usr/include/asm/mach-default/ SUBDIRS=/usr/src/dgvchannel-1.1.8/fifodev modules
make[2]: Entrando no diretório `/usr/src/kernels/3.10.0-1127.el7.x86_64'
Building modules, stage 2.
MODPOST 1 modules
make[2]: Saindo do diretório `/usr/src/kernels/3.10.0-1127.el7.x86_64'
Installing the FIFO device module...
install -d /lib/modules/3.10.0-1127.el7.x86_64/misc
install -m 664 dgvfifo.ko /lib/modules/3.10.0-1127.el7.x86_64/misc
if [ -d /etc/modutils ]; then \
/sbin/update-modules; \
fi
/sbin/depmod -a
./create_inodes.sh
Kernel 2.X...
Loading dgvfifo.ko...
Allocating major number = 243
Creating /dev/dgvfifo...
Creating fifo inodes...
Done!
make[1]: Saindo do diretório `/usr/src/dgvchannel-1.1.8/fifodev'
for x in chan_dgv.so app_dgccb.so app_dgflash.so app_dggetstatistics.so app_dggetunreadsms.so app_dgsendr2groupb.so app_dgsendsms.so app_dgsendisdnsig.so app_dggsmchangecsca.so; do install -m 755 $x /usr/lib/asterisk/modules ; done
if [ -d /usr/lib64/asterisk/modules ]; then \
for x in chan_dgv.so app_dgccb.so app_dgflash.so app_dggetstatistics.so app_dggetunreadsms.so app_dgsendr2groupb.so app_dgsendsms.so app_dgsendisdnsig.so app_dggsmchangecsca.so; do install -m 755 $x /usr/lib64/asterisk/modules ; done \
fi
mkdir -p -m 777 /var/lib/voicerlib/statistics
####################################################
# #
# Foram instalados em /usr/lib/asterisk/modules #
# os modulos: #
# #
# chan_dgv.so - o channel para placas Digivoice #
# #
# app_dgccb.so - aplicacao CollectCallBlock para #
# ser utilizado no dialplan per- #
# mitindo o bloqueio de chamadas a #
# cobrar. #
# #
# app_dgflash.so - aplicacao Flash para ser uti- #
# lizado no dialplan permitindo #
# executar um flash na linha. #
# #
# app_dggetstatistics.so - aplicacao GetStatistics #
# para ser utilizado no #
# dialplan permitindo #
# recuperar a quantidade #
# de segundos utilizados #
# em um canal/porta. #
# #
# app_dggetunreadsms.so - aplicacao GetUnReadSMS #
# para ser utilizado no #
# dialplan permitindo #
# ler mensagens SMS ainda #
# nao lidas. #
# #
# app_dgsendr2groupb.so - aplicacao SendR2GroupB #
# para ser utilizado no #
# dialplan permitindo #
# enviar uma sinalizacao #
# de grupo B em um #
# canal/porta R2. #
# #
# app_dgsendsms.so - aplicacao SendSMS para ser #
# utilizado no dialplan permi- #
# tindo enviar um SMS em um #
# canal/porta GSM. #
# #
# app_dgsendisdnsig.so - aplicacao SendISDNSig #
# para ser utilizado no #
# dialplan permitindo #
# enviar uma sinalizacao #
# em um canal/porta ISDN. #
# #
# app_dggsmchangecsca.so - aplicacao GSMChangeCSCA #
# para ser utilizado no #
# dialplan permitindo #
# ler/alterar o endereco #
# do servico de SMS #
# (SMSC address). #
# #
# Atencao: Se essa for a primeira instalacao, eh #
# necessario instalar o digivoice.conf no #
# diretorio do Asterisk (/etc/asterisk). Para #
# isso, utilize o comando: #
# make install_config #
# #
# O arquivo esta pre-configurado para trabalhar #
# com as placas detectadas em sua maquina, voce #
# pode edita-lo para outras configuracoes. #
# #
####################################################
Se o seguinte erro aparecer “asterisk: error while loading shared libraries: libasteriskssl.so.1: cannot open shared object file: No such file or directory”, provavelmente que a biblioteca foi instalada no diretório “/usr/lib/” e por algum erro não copiou para o diretório “/usr/lib64/”. Para resolver basta criar um link simbólico:
ln -s /usr/lib/libasteriskssl.so.1 /usr/lib64/libasteriskssl.so.1
Agora para ligar e acessar o asterisk digite os seguintes comandos:
asterisk
asterisk -rvvvvvvvvvvv
Agora dentro do console do asterisk podemos verificar os canais disponíveis pelo seguinte comando:
dgv show channels
O resultado deve ser algo parecido como a seguir:
localhost*CLI> dgv show channels
List of available DigiVoice Channels
Chan Grp Context PortId Rsrvd Alrmd Lckd Extension CardType Intrf.
1 1 from-pstn 1145678901 0 1 no VB3030PCIe R2/ISDN
2 1 from-pstn 1145678901 0 1 no VB3030PCIe R2/ISDN
3 1 from-pstn 1145678901 0 1 no VB3030PCIe R2/ISDN
4 1 from-pstn 1145678901 0 1 no VB3030PCIe R2/ISDN
5 1 from-pstn 1145678901 0 1 no VB3030PCIe R2/ISDN
6 1 from-pstn 1145678901 0 1 no VB3030PCIe R2/ISDN
7 1 from-pstn 1145678901 0 1 no VB3030PCIe R2/ISDN
8 1 from-pstn 1145678901 0 1 no VB3030PCIe R2/ISDN
9 1 from-pstn 1145678901 0 1 no VB3030PCIe R2/ISDN
10 1 from-pstn 1145678901 0 1 no VB3030PCIe R2/ISDN
11 1 from-pstn 1145678901 0 1 no VB3030PCIe R2/ISDN
12 1 from-pstn 1145678901 0 1 no VB3030PCIe R2/ISDN
13 1 from-pstn 1145678901 0 1 no VB3030PCIe R2/ISDN
14 1 from-pstn 1145678901 0 1 no VB3030PCIe R2/ISDN
15 1 from-pstn 1145678901 0 1 no VB3030PCIe R2/ISDN
16 1 from-pstn 1145678901 0 1 no VB3030PCIe R2/ISDN
17 1 from-pstn 1145678901 0 1 no VB3030PCIe R2/ISDN
18 1 from-pstn 1145678901 0 1 no VB3030PCIe R2/ISDN
19 1 from-pstn 1145678901 0 1 no VB3030PCIe R2/ISDN
20 1 from-pstn 1145678901 0 1 no VB3030PCIe R2/ISDN
Chan Grp Context PortId Rsrvd Alrmd Lckd Extension CardType Intrf.
21 1 from-pstn 1145678901 0 1 no VB3030PCIe R2/ISDN
22 1 from-pstn 1145678901 0 1 no VB3030PCIe R2/ISDN
23 1 from-pstn 1145678901 0 1 no VB3030PCIe R2/ISDN
24 1 from-pstn 1145678901 0 1 no VB3030PCIe R2/ISDN
25 1 from-pstn 1145678901 0 1 no VB3030PCIe R2/ISDN
26 1 from-pstn 1145678901 0 1 no VB3030PCIe R2/ISDN
27 1 from-pstn 1145678901 0 1 no VB3030PCIe R2/ISDN
28 1 from-pstn 1145678901 0 1 no VB3030PCIe R2/ISDN
29 1 from-pstn 1145678901 0 1 no VB3030PCIe R2/ISDN
30 1 from-pstn 1145678901 0 1 no VB3030PCIe R2/ISDN
Para ver os status da comunicação com o link E1 digite o seguinte comando:
dgv show alarms 1
O resultado dever ser algo como a seguir:
localhost*CLI> dgv show alarms 1
DigiVoice - Alarmes E1 - Placa E1: 1
+---[ Span: 1 ]----------------+
| |
| ALARM_LOSS On 001 |
| ALARM_AISS Off 000 |
| ALARM_AIS16S Off 000 |
| ALARM_SYNC Off 000 |
| ALARM_MFSYNC Off 000 |
| ALARM_RAIS Off 000 |
| ALARM_CRC4SYNC Off 000 |
| ALARM_LINKDOWN Off 000 |
| ALARM_RSLIP 000 |
| |
| Ultimo Reset: |
| 2020-07-16 18:01:47 |
| |
+------------------------------+
Descricoes dos Alarmes:
|
|_ ALARM_LOSS - Indicacao de Perda de Sinal.
|_ ALARM_AISS - Status de Indicacao de Alarme.
|_ ALARM_AIS16S - Indicacao de Alarme no Canal 16.
|_ ALARM_SYNC - Perda de Sincronismo de Quadro.
|_ ALARM_MFSYNC - Perda de Sincronismo de Multiquadro.
|_ ALARM_RAIS - Indicacao de Alarme Remoto.
|_ ALARM_CRC4SYNC - Erro de CRC-4.
|_ ALARM_LINKDOWN - Indicacao do Status de Protocolo ISDN.
|_ ALARM_RSLIP - Escorregamento.
Pronto, agora estamos prontos para configurar as lógicas do asterisk para receber e realizar ligações.
Configurando o ODBC
Configurando a conexão com o banco de dados asterisk no arquivo res_config_mysql.conf:
[general]
dbhost = 127.0.0.1
dbname = asterisk
dbuser = meu usuário
dbpass = minha senha
dbport = 3306
dbsock = /tmp/mysql.sock
dbcharset = latin1
requirements=warn ; or createclose or createchar
/etc/odbcinst.ini
[MySQL]
Description = ODBCforMySQL
Driver = /usr/lib/libmyodbc5.so
Setup = /usr/lib/libodbcmyS.so
Driver64 = /usr/lib64/libmyodbc5.so
Setup64 = /usr/lib64/libodbcmyS.so
FileUsage = 1
/etc/odbc.ini
[asteriskconnector]
Description = ODBCforMySQL
Driver = MySQL
Database = asterisk
Server = localhost
Port = 3306
Socket = /tmp/mysql.sock
/etc/asterisk/res_odbc.conf
[asterisk]
enabled => yes
dsn => asteriskconnector
username => meu usuário
password => minha senha
pre-connect => yes
/etc/asterisk/cdr_adaptive_odbc.conf
[asterisk]
connection=asterisk
table=cdr
alias start => calldate
/etc/asterisk/cdr_odbc.conf
[global]
dsn=asteriskconnector
loguniqueid=yes
dispositionstring=yes
table=cdr
usegmtime=no
hrtime=yes
newcdrcolumns=yes
Testando sem senha:
# isql -v asteriskconnector
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+---------------------------------------+
Tabela CDR:
mysql> desc asterisk.cdr;
+-------------+--------------+------+-----+---------------------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------+--------------+------+-----+---------------------+-------+
| uniqueid | varchar(32) | NO | PRI | | |
| linkedid | varchar(32) | NO | | | |
| clid | varchar(80) | NO | | | |
| src | varchar(80) | NO | | | |
| dst | varchar(80) | NO | MUL | | |
| dcontext | varchar(80) | NO | | | |
| channel | varchar(80) | NO | | | |
| dstchannel | varchar(80) | NO | | | |
| lastapp | varchar(80) | NO | | | |
| lastdata | varchar(80) | NO | | | |
| start | datetime | NO | MUL | 0000-00-00 00:00:00 | |
| answer | datetime | NO | | 0000-00-00 00:00:00 | |
| end | datetime | NO | | 0000-00-00 00:00:00 | |
| duration | int(11) | NO | | 0 | |
| billsec | int(11) | NO | | 0 | |
| disposition | varchar(45) | NO | | | |
| amaflags | int(11) | NO | | 0 | |
| accountcode | varchar(20) | NO | MUL | | |
| userfield | varchar(255) | NO | | | |
| sequence | varchar(32) | NO | | | |
| peeraccount | varchar(32) | NO | | | |
+-------------+--------------+------+-----+---------------------+-------+
21 rows in set (0,00 sec)
# CREATE USER 'asterisk'@'%' IDENTIFIED BY 'coloque a senha aqui'; # CREATE DATABASE asterisk; # USE asterisk; # GRANT ALL PRIVILEGES ON asterisk.* TO 'asterisk'@'%'; CREATE SCHEMA IF NOT EXISTS `asterisk` DEFAULT CHARACTER SET utf8; CREATE TABLE IF NOT EXISTS `asterisk`.`cdr` ( `uniqueid` VARCHAR(32) NOT NULL DEFAULT '' , `linkedid` VARCHAR(32) NOT NULL DEFAULT '' , `clid` VARCHAR(80) NOT NULL DEFAULT '' , `src` VARCHAR(80) NOT NULL DEFAULT '' , `dst` VARCHAR(80) NOT NULL DEFAULT '' , `dcontext` VARCHAR(80) NOT NULL DEFAULT '' , `channel` VARCHAR(80) NOT NULL DEFAULT '' , `dstchannel` VARCHAR(80) NOT NULL DEFAULT '' , `lastapp` VARCHAR(80) NOT NULL DEFAULT '' , `lastdata` VARCHAR(80) NOT NULL DEFAULT '' , `start` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' , `answer` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' , `end` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' , `duration` INT(11) NOT NULL DEFAULT '0' , `billsec` INT(11) NOT NULL DEFAULT '0' , `disposition` VARCHAR(45) NOT NULL DEFAULT '' , `amaflags` INT(11) NOT NULL DEFAULT '0' , `accountcode` VARCHAR(20) NOT NULL DEFAULT '' , `userfield` VARCHAR(255) NOT NULL DEFAULT '' , `sequence` VARCHAR(32) NOT NULL DEFAULT '' , `peeraccount` VARCHAR(32) NOT NULL DEFAULT '' , PRIMARY KEY (`uniqueid`) , INDEX `start` (`start` ASC) , INDEX `dst` (`dst` ASC) , INDEX `accountcode` (`accountcode` ASC) ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8;
INSERT INTO cdr (uniqueid,linkedid,clid,src,dst,dcontext,channel,dstchannel,lastapp,lastdata,start,answer,end,duration,billsec,disposition,amaflags,sequence) VALUES ('1596239844.8','1596239844.8','"1099" <1099>','1099','3101','from-pstn','SIP/1099-00000008','SIP/186.227.176.9:5060-00000009','Dial','SIP/08000753100@186.227.176.9:5060,90,tT',{ ts '2020-07-31 20:57:24' },{ ts '2020-07-31 20:57:24' },{ ts '2020-07-31 20:57:27' },3,3,'ANSWERED',3,'12')
SIP REALTIME
Criando a tabela dos ramais SIP no banco asterisk:
CREATE TABLEsippeers
(
id
int(11) NOT NULL AUTO_INCREMENT,
name
varchar(80) NOT NULL DEFAULT '',
context
varchar(80) DEFAULT 'clientes',
secret
varchar(80) DEFAULT NULL,
host
varchar(31) NOT NULL DEFAULT 'dynamic',
nat
varchar(5) NOT NULL DEFAULT 'yes',
type
enum('user','peer','friend') NOT NULL DEFAULT 'friend',
callerid
varchar(80) DEFAULT NULL,
qualify
char(3) DEFAULT 'yes',
rtptimeout
char(10) DEFAULT NULL,
username
varchar(80) NOT NULL DEFAULT '',
lastms
int(11) NOT NULL,
regseconds
int(11) NOT NULL DEFAULT '0',
useragent
varchar(50) NOT NULL DEFAULT '',
ipaddr
varchar(45) DEFAULT NULL,
port
int(5) DEFAULT NULL,
fullcontact
varchar(35) DEFAULT NULL,
regserver
varchar(20) DEFAULT NULL,
deny
varchar(40) DEFAULT NULL,
disallow
text,
insecure
text,
fromuser
text,
permit
varchar(40) DEFAULT NULL,
callbackextension
varchar(40) DEFAULT NULL,
dtmfmode
enum('rfc2833','info','shortinfo','inband','auto') DEFAULT NULL,
ip
varchar(15) DEFAULT NULL,
status
varchar(30) DEFAULT NULL,
defaultuser
varchar(10) DEFAULT NULL,
call-limit
int(11) DEFAULT NULL,
PRIMARY KEY (id
),
KEYname
(name
)
);
Criando o primeiro ramal SIP:
INSERT INTO asterisk.sippeers SET name='1099', context='default', Secret='minhasenhamaluca';
Adicionando o apontamento da tabela realtime no arquivo extconfig.conf:
[settings] sippeers =>odbc,asterisk,sippeers
Reiniciando o asterisk para receber as novas configurações:
asterisk -rx "core restart now"
Acessando os logs completos para testar a autenticação:
tail /var/log/asterisk/full -f
Veja o resultado de uma autenticação:
[Aug 3 12:20:42] WARNING[22571] sip/config_parser.c: nat=yes is deprecated, use nat=force_rport,comedia instead
[Aug 3 12:20:42] WARNING[22571] chan_sip.c: Qualify is incompatible with dynamic uncached realtime. Please either turn rtcachefriends on or turn qualify off on peer '1099'
[Aug 3 12:20:42] WARNING[22571] sip/config_parser.c: nat=yes is deprecated, use nat=force_rport,comedia instead
[Aug 3 12:20:42] WARNING[22571] chan_sip.c: Qualify is incompatible with dynamic uncached realtime. Please either turn rtcachefriends on or turn qualify off on peer '1099'
[Aug 3 12:20:42] SECURITY[22539] res_security_log.c: SecurityEvent="ChallengeSent",EventTV="1596468042-272125",Severity="Informational",Service="SIP",EventVersion="1",AccountID="1099",SessionID="0x7f6138001a98",LocalAddress="IPV4/UDP/10.1.0.3/5060",RemoteAddress="IPV4/UDP/10.1.0.17/53397",Challenge="0b5942cc"
[Aug 3 12:20:42] WARNING[22571] sip/config_parser.c: nat=yes is deprecated, use nat=force_rport,comedia instead
[Aug 3 12:20:42] WARNING[22571] chan_sip.c: Qualify is incompatible with dynamic uncached realtime. Please either turn rtcachefriends on or turn qualify off on peer '1099'
[Aug 3 12:20:42] WARNING[22571] sip/config_parser.c: nat=yes is deprecated, use nat=force_rport,comedia instead
[Aug 3 12:20:42] WARNING[22571] chan_sip.c: Qualify is incompatible with dynamic uncached realtime. Please either turn rtcachefriends on or turn qualify off on peer '1099'
[Aug 3 12:20:42] SECURITY[22539] res_security_log.c: SecurityEvent="SuccessfulAuth",EventTV="1596468042-308366",Severity="Informational",Service="SIP",EventVersion="1",AccountID="1099",SessionID="0x7f6138001a98",LocalAddress="IPV4/UDP/10.1.0.3/5060",RemoteAddress="IPV4/UDP/10.1.0.17/53397",UsingPassword="1"
[Aug 3 12:20:42] WARNING[22544] chan_sip.c: Qualify is incompatible with dynamic uncached realtime. Please either turn rtcachefriends on or turn qualify off on peer '1099'
[Aug 3 12:20:42] WARNING[22571] sip/config_parser.c: nat=yes is deprecated, use nat=force_rport,comedia instead
[Aug 3 12:20:42] WARNING[22571] chan_sip.c: Qualify is incompatible with dynamic uncached realtime. Please either turn rtcachefriends on or turn qualify off on peer '1099'
[Aug 3 12:20:42] WARNING[22571] sip/config_parser.c: nat=yes is deprecated, use nat=force_rport,comedia instead
[Aug 3 12:20:42] WARNING[22571] chan_sip.c: Qualify is incompatible with dynamic uncached realtime. Please either turn rtcachefriends on or turn qualify off on peer '1099'
[Aug 3 12:20:42] WARNING[22571] sip/config_parser.c: nat=yes is deprecated, use nat=force_rport,comedia instead
[Aug 3 12:20:42] WARNING[22571] chan_sip.c: Qualify is incompatible with dynamic uncached realtime. Please either turn rtcachefriends on or turn qualify off on peer '1099'
[Aug 3 12:20:42] WARNING[22571] sip/config_parser.c: nat=yes is deprecated, use nat=force_rport,comedia instead
[Aug 3 12:20:42] WARNING[22571] chan_sip.c: Qualify is incompatible with dynamic uncached realtime. Please either turn rtcachefriends on or turn qualify off on peer '1099'
[Aug 3 12:20:42] NOTICE[22571] chan_sip.c: Received SIP subscribe for peer without mailbox: 1099
EXTENSIONS REALTIME
Criando a tabela das configurações de roteamento, que substituirá o extension.conf, no banco asterisk:
CREATE TABLE extensions ( id int(11) NOT NULL auto_increment, context varchar(20) NOT NULL default "", exten varchar(20) NOT NULL default "", priority tinyint(4) NOT NULL default "0", app varchar(20) NOT NULL default "", appdata varchar(128) NOT NULL default "", PRIMARY KEY (context,exten,priority), KEY id (id) ) TYPE=MyISAM;
Adicionando o apontamento da tabela realtime no arquivo extconfig.conf:
[settings] extensions.conf => odbc,asterisk,extensions
Reiniciando o asterisk para receber as novas configurações:
asterisk -rx "core restart now"
RESOLVENDO O PROBLEMA DO MYSQL.PLUGIN
Após uma instalação mau sucedida pela utilização de versão anterior, ao iniciar o banco de dados mysql com o comando mysqld_safe, o seguinte erro ocorreu:
[ERROR] Can’t open the mysql.plugin table. Please run mysql_upgrade to create it.
Veja abaixo o log completo do erro ao tentar iniciar o banco de dados pelo mysqld_safe:
200804 22:21:22 mysqld_safe Starting mysqld daemon with databases from /usr/local/var
/usr/local/libexec/mysqld: Table 'mysql.plugin' doesn't exist
200804 22:21:22 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
200804 22:21:22 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
200804 22:21:22 mysqld_safe mysqld from pid file /usr/local/var/localhost.localdomain.pid ended
Se esse erro aparecer durante a manutenção do mysql, a solução que resolveu pra mim foi criando todas as tabelas novamente, usando o seguinte comando logado como root:
bin/mysql_install_db --user=mysql
Veja abaixo o resultado do comando anterior:
[root@localhost mysql]# bin/mysql_install_db --user=mysql Installing MySQL system tables… OK Filling help tables… OK To start mysqld at boot time you have to copy support-files/mysql.server to the right place for your system PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER ! To do so, start the server, then issue the following commands: /usr/local/mysql/bin/mysqladmin -u root password 'new-password' /usr/local/mysql/bin/mysqladmin -u root -h localhost.localdomain password 'new-password' Alternatively you can run: /usr/local/mysql/bin/mysql_secure_installation which will also give you the option of removing the test databases and anonymous user created by default. This is strongly recommended for production servers. See the manual for more instructions. You can start the MySQL daemon with: cd /usr/local/mysql ; /usr/local/mysql/bin/mysqld_safe & You can test the MySQL daemon with mysql-test-run.pl cd /usr/local/mysql/mysql-test ; perl mysql-test-run.pl Please report any problems with the /usr/local/mysql/bin/mysqlbug script! The latest information about MySQL is available at http://www.mysql.com/ Support MySQL by buying support/licenses from http://shop.mysql.com/
Depois de executar esse comando como root, tive que novamente alterar as propriedades dos diretórios e pastas, com os seguintes comandos:
# chown -R root . # chown -R mysql var # chgrp -R mysql .
Em seguida foi possível executar o banco de dados com o comando mysql_safe tradicional:
/usr/local/bin/mysqld_safe &
PROBLEMA COM libmyodbc5.so
Ao testar a conexão do conector odbc com o comando “isql -v asteriskconnector” o seguinte erro se apresentou:
[unixODBC][Driver Manager]Can't open lib '/usr/lib64/libmyodbc5.so' : file not found
Ao consultar o mesmo encontrava-se no local, mas insistia em apresentar o erro que não existia. Então tentei reinstalar o mysql-connector com o yum e não funcionou, tentei criar link simbólico e nada. A única forma que resolveu foi baixar o pacote do “mysql-connector-odbc-5.3.14-linux-glibc2.12-x86-64bit/“, descompactar e copiar o arquivo para o loca especificado:
Baixando o pacote “mysql-connector-odbc-5.3.14-linux-glibc2.12-x86-64bit/“:
wget https://dev.mysql.com/get/Downloads/Connector-ODBC/5.3/mysql-connector-odbc-5.3.14-linux-glibc2.12-x86-64bit.tar.gz
Descompactando:
tar -xvzf mysql-connector-odbc-5.3.14-linux-glibc2.12-x86-64bit.tar.gz
Copiando os arquivos:
cp mysql-connector-odbc-5.3.14-linux-glibc2.12-x86-64bit/lib/* /usr/lib64/
Depois alterei o apontamento no arquivo “/etc/odbcinst.ini“:
[MySQL]
Description = ODBCforMySQL
Driver = /usr/lib/libmyodbc5.so
Setup = /usr/lib/libodbcmyS.so
Driver64 = /usr/lib64/odbc/libmyodbc5a.so
Setup64 = /usr/lib64/libodbcmyS.so
FileUsage = 1
Então testei novamente e deu certo, veja:
[root@localhost lib]# isql -v asteriskconnector +---------------------------------------+ | Connected! | | | | sql-statement | | help [tablename] | | quit | | | +---------------------------------------+ SQL> quit
Segui seu tutorial e funcionou quase que perfeitamente. O único problema é que os comandos dgv não ficavm disponíveis na CLI do asterisk.
Para resolver:
copie o módulo libpri.so.1.4 do diretorio /usr/lib para o /usr/lib64
Feito isso, funciona redondo.
Muito obrigado pelo tutorial!!!
Boa noite Nilson
Primeiramente muito obrigado pelo retorno, é uma grande honra que tenha seguido meu manual e dado certo, fico feliz.
Porém sobre o problema da lib64, você não deve ter executando o seguinte comando:
ln -s /usr/lib/libasteriskssl.so.1 /usr/lib64/libasteriskssl.so.1
No final do título “DGVChannel” eu relato a necessidade da criação do link simbólico para sincronizar as duas libs.
Atenciosamente
Agenor Zapparoli