[AsteriskBrasil] Erro ao executar query em PostgreSQL odbc voicemessage
Rodrigo Vian
listas em porttaltecnologia.com.br
Sexta Junho 18 09:07:18 BRT 2010
Porque usar ODBC para se conectar ao Postgresql???
O asterisk tem suporte nativo à ele...
- cdr_pgsql.conf
- res_pgsql.conf
Abs
Moisés Paes Sena escreveu:
> Bom dia pessoal!
>
> Estou querendo gravar as mensagens de voz no Banco de Dados
> Postgresql, usando a versão 8.44, nativa do CentOS 5.5, segui os
> passos de [1].
>
> Tenho uma extensão:
>
> exten => _1,1,Voicemail(250 em default);
>
> Quando ligo para '1', a aplicação Voicemail roda perfeitamente e me
> envia o email contendo a mensagem.
>
> Entretanto, durante a execução de Voicemail recebo as seguintes
> mensagens de erro conforme log abaixo.
> OBS.: A aplicação CDR funciona perfeitamente com esta mesma
> conexão de banco de dados.
>
> [1]
> http://astbook.asteriskdocs.org/en/2nd_Edition/asterisk-book-html-chunk/I_section12_tt1578.html
>
> OBS.: O meu ODBC está configurado apenas nos arquivos: cdr_odbc.conf e
> res_odbc.conf
>
> cdr_odbc.conf:
> [global]
> dsn = asterisk-connector
> username = asterisk
> password = asterisk
> loguniqueid = 1
> table = cdr
>
> res_odbc.conf:
> [asterisk]
> enabled => yes
> dsn => asterisk-connector
> username => asterisk
> password => asterisk
> pooling => no
> limit => -1
> pre-connect => yes
>
> Log:
>
> [Jun 18 08:36:50] DEBUG[2608] channel.c: Set channel SIP/250-00000002
> to read format alaw
> [Jun 18 08:36:50] DEBUG[2608] app.c: Locked path
> '/var/spool/asterisk/voicemail/default/250/INBOX'
> [Jun 18 08:36:50] DEBUG[2608] app.c: Unlocked path
> '/var/spool/asterisk/voicemail/default/250/INBOX'
> [Jun 18 08:36:50] WARNING[2608] app_voicemail.c: SQL Prepare
> failed![DELETE FROM voicemessages WHERE dir=? AND msgnum=?]
> [Jun 18 08:36:50] WARNING[2608] res_odbc.c: SQL Prepare failed.
> Attempting a reconnect...
> [Jun 18 08:36:50] DEBUG[2608] res_odbc.c: Disconnected 0 from asterisk
> [asterisk-connector]
> [Jun 18 08:36:50] DEBUG[2608] res_odbc.c: Database handle deallocated
> [Jun 18 08:36:50] NOTICE[2608] res_odbc.c: Connecting asterisk
> [Jun 18 08:36:50] NOTICE[2608] res_odbc.c: res_odbc: Connected to
> asterisk [asterisk-connector]
> [Jun 18 08:36:50] WARNING[2608] app_voicemail.c: SQL Prepare
> failed![DELETE FROM voicemessages WHERE dir=? AND msgnum=?]
> [Jun 18 08:36:50] WARNING[2608] res_odbc.c: SQL Prepare failed.
> Attempting a reconnect...
> [Jun 18 08:36:50] DEBUG[2608] res_odbc.c: Disconnected 0 from asterisk
> [asterisk-connector]
> [Jun 18 08:36:50] DEBUG[2608] res_odbc.c: Database handle deallocated
> [Jun 18 08:36:50] NOTICE[2608] res_odbc.c: Connecting asterisk
> [Jun 18 08:36:50] NOTICE[2608] res_odbc.c: res_odbc: Connected to
> asterisk [asterisk-connector]
> [Jun 18 08:36:50] WARNING[2608] app_voicemail.c: SQL Execute error!
> [DELETE FROM voicemessages WHERE dir=? AND msgnum=?]
>
> [Jun 18 08:36:50] VERBOSE[2608] logger.c: == Parsing
> '/var/spool/asterisk/voicemail/default/250/INBOX/msg0000.txt': [Jun 18
> 08:36:50] DEBUG[2608] config.c: Parsing
> /var/spool/asterisk/voicemail/default/250/INBOX/msg0000.txt
> [Jun 18 08:36:50] VERBOSE[2608] logger.c: Found
> [Jun 18 08:36:50] WARNING[2608] app_voicemail.c: SQL Prepare
> failed![INSERT INTO voicemessages
> (dir,msgnum,recording,context,macrocontext,callerid,origtime,duration,mailboxuser,mailboxcontext)
> VALUES (?,?, ? , ?,?,?,?,?,?,?)]
> [Jun 18 08:36:50] WARNING[2608] res_odbc.c: SQL Prepare failed.
> Attempting a reconnect...
> [Jun 18 08:36:50] DEBUG[2608] res_odbc.c: Disconnected 0 from asterisk
> [asterisk-connector]
> [Jun 18 08:36:50] DEBUG[2608] res_odbc.c: Database handle deallocated
> [Jun 18 08:36:50] NOTICE[2608] res_odbc.c: Connecting asterisk
> [Jun 18 08:36:51] NOTICE[2608] res_odbc.c: res_odbc: Connected to
> asterisk [asterisk-connector]
> [Jun 18 08:36:51] WARNING[2608] app_voicemail.c: SQL Prepare
> failed![INSERT INTO voicemessages
> (dir,msgnum,recording,context,macrocontext,callerid,origtime,duration,mailboxuser,mailboxcontext)
> VALUES (?,?, ? , ?,?,?,?,?,?,?)]
> [Jun 18 08:36:51] WARNING[2608] res_odbc.c: SQL Prepare failed.
> Attempting a reconnect...
> [Jun 18 08:36:51] DEBUG[2608] res_odbc.c: Disconnected 0 from asterisk
> [asterisk-connector]
> [Jun 18 08:36:51] DEBUG[2608] res_odbc.c: Database handle deallocated
> [Jun 18 08:36:51] NOTICE[2608] res_odbc.c: Connecting asterisk
> [Jun 18 08:36:51] NOTICE[2608] res_odbc.c: res_odbc: Connected to
> asterisk [asterisk-connector]
> [Jun 18 08:36:51] DEBUG[2608] app_voicemail.c: Attaching file
> '/var/spool/asterisk/voicemail/default/250/INBOX/msg0000', format
> 'WAV', uservm is '2048', global is 2048
> [Jun 18 08:36:51] VERBOSE[2608] logger.c: == Parsing
> '/var/spool/asterisk/voicemail/default/250/INBOX/msg0000.txt': [Jun 18
> 08:36:51] DEBUG[2608] config.c: Parsing
> /var/spool/asterisk/voicemail/default/250/INBOX/msg0000.txt
> [Jun 18 08:36:51] VERBOSE[2608] logger.c: Found
> [Jun 18 08:36:51] DEBUG[2608] devicestate.c: Notification of state
> change to be queued on device/channel Substitution/voicemail
> [Jun 18 08:36:51] VERBOSE[2608] logger.c: == Parsing
> '/var/spool/asterisk/voicemail/default/250/INBOX/msg0000.txt': [Jun 18
> 08:36:51] DEBUG[2608] config.c: Parsing
> /var/spool/asterisk/voicemail/default/250/INBOX/msg0000.txt
> [Jun 18 08:36:51] VERBOSE[2608] logger.c: Found
> [Jun 18 08:36:51] DEBUG[2608] devicestate.c: Notification of state
> change to be queued on device/channel Substitution/voicemail
> [Jun 18 08:36:51] DEBUG[2608] app_voicemail.c: Sent mail to
> moises em oriontec.com.br <mailto:moises em oriontec.com.br> with command
> '/usr/sbin/sendmail -t'
> [Jun 18 08:36:51] DEBUG[2109] devicestate.c: No provider found,
> checking channel drivers for Substitution - voicemail
> [Jun 18 08:36:51] DEBUG[2109] devicestate.c: Changing state for
> Substitution/voicemail - state 4 (Invalid)
> [Jun 18 08:36:51] DEBUG[2109] devicestate.c: No provider found,
> checking channel drivers for Substitution - voicemail
> [Jun 18 08:36:51] DEBUG[2109] devicestate.c: Changing state for
> Substitution/voicemail - state 4 (Invalid)
> [Jun 18 08:36:51] DEBUG[2231] app_queue.c: Device
> 'Substitution/voicemail' changed to state '4' (Invalid) but we don't
> care because they're not a member of any queue.
> [Jun 18 08:36:51] DEBUG[2231] app_queue.c: Device
> 'Substitution/voicemail' changed to state '4' (Invalid) but we don't
> care because they're not a member of any queue.
> [Jun 18 08:36:51] DEBUG[2608] pbx.c: Spawn extension (interno,1,1)
> exited non-zero on 'SIP/250-00000002'
> [Jun 18 08:36:51] VERBOSE[2608] logger.c: == Spawn extension
> (interno, 1, 1) exited non-zero on 'SIP/250-00000002'
> [Jun 18 08:36:51] DEBUG[2608] channel.c: Soft-Hanging up channel
> 'SIP/250-00000002'
> [Jun 18 08:36:51] DEBUG[2608] channel.c: Hanging up channel
> 'SIP/250-00000002'
> [Jun 18 08:36:51] DEBUG[2608] chan_sip.c: Hangup call
> SIP/250-00000002, SIP callid NTg1MmFmZTQ3YjAxYmFkMzg1MjQxY2Y3ODk2YTc0OTc.)
> [Jun 18 08:36:51] DEBUG[2608] chan_sip.c: Updating call counter for
> incoming call
> [Jun 18 08:36:51] DEBUG[2608] chan_sip.c: Call from user '250' removed
> from call limit 10
> [Jun 18 08:36:51] VERBOSE[2608] logger.c: > cdr_odbc: Connected
> to asterisk-connector
> [Jun 18 08:36:51] VERBOSE[2608] logger.c: > cdr_odbc: Error in
> PREPARE -1
> [Jun 18 08:36:51] VERBOSE[2608] logger.c: > cdr_odbc: Query
> FAILED Call not logged!
>
> --
> Moisés P. Sena <moises em oriontec.com.br <mailto:moises em oriontec.com.br>>
> (Desenvolvedor WEB)
> Oriontec Automação Comercial
> http://www.oriontec.com.br
> ------------------------------------------------------------------------
>
> _______________________________________________
> KHOMP: qualidade em placas de E1, GSM, FXS e FXO para Asterisk.
> - Hardware com alta disponibilidade de recursos e qualidade KHOMP
> - Suporte técnico local qualificado e gratuito
> Conheça a linha completa de produtos KHOMP em www.khomp.com.br
> _______________________________________________
> Participe do I Encontro VoIPCenter, 08 a 10 de junho -- Rio de Janeiro.
> Área de exposição, palestras e cursos de VoIP, Asterisk e Convergência de Redes.
> http://www.encontrovoipcenter.com.br
> ______________________________________________
> Lista de discussões AsteriskBrasil.org
> AsteriskBrasil em listas.asteriskbrasil.org
> http://listas.asteriskbrasil.org/mailman/listinfo/asteriskbrasil
-------------- Próxima Parte ----------
Um anexo em HTML foi limpo...
URL: http://listas.asteriskbrasil.org/pipermail/asteriskbrasil/attachments/20100618/2af3d832/attachment.htm
Mais detalhes sobre a lista de discussão AsteriskBrasil