Bom dia pessoal!<br><br>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].<br><br>Tenho uma extensão:<br><br>exten => _1,1,Voicemail(250@default);<br>
<br>Quando ligo para '1', a aplicação Voicemail roda perfeitamente e me envia o email contendo a mensagem.<br><br>Entretanto, durante a execução de Voicemail recebo as seguintes mensagens de erro conforme log abaixo.<br>
OBS.: A aplicação CDR funciona perfeitamente com esta mesma conexão de banco de dados.<br><br>[1] <a href="http://astbook.asteriskdocs.org/en/2nd_Edition/asterisk-book-html-chunk/I_section12_tt1578.html">http://astbook.asteriskdocs.org/en/2nd_Edition/asterisk-book-html-chunk/I_section12_tt1578.html</a><br>
<br>OBS.: O meu ODBC está configurado apenas nos arquivos: cdr_odbc.conf e res_odbc.conf<br><br>cdr_odbc.conf: <br> [global]<br> dsn = asterisk-connector<br> username = asterisk<br> password = asterisk<br> loguniqueid = 1<br>
table = cdr<br><br>res_odbc.conf:<br> [asterisk]<br> enabled => yes<br> dsn => asterisk-connector<br> username => asterisk<br> password => asterisk<br> pooling => no<br> limit => -1<br>
pre-connect => yes<br><br>Log:<br><br>[Jun 18 08:36:50] DEBUG[2608] channel.c: Set channel SIP/250-00000002 to read format alaw<br>[Jun 18 08:36:50] DEBUG[2608] app.c: Locked path '/var/spool/asterisk/voicemail/default/250/INBOX'<br>
[Jun 18 08:36:50] DEBUG[2608] app.c: Unlocked path '/var/spool/asterisk/voicemail/default/250/INBOX'<br>[Jun 18 08:36:50] WARNING[2608] app_voicemail.c: SQL Prepare failed![DELETE FROM voicemessages WHERE dir=? AND msgnum=?]<br>
[Jun 18 08:36:50] WARNING[2608] res_odbc.c: SQL Prepare failed. Attempting a reconnect...<br>[Jun 18 08:36:50] DEBUG[2608] res_odbc.c: Disconnected 0 from asterisk [asterisk-connector]<br>[Jun 18 08:36:50] DEBUG[2608] res_odbc.c: Database handle deallocated<br>
[Jun 18 08:36:50] NOTICE[2608] res_odbc.c: Connecting asterisk<br>[Jun 18 08:36:50] NOTICE[2608] res_odbc.c: res_odbc: Connected to asterisk [asterisk-connector]<br>[Jun 18 08:36:50] WARNING[2608] app_voicemail.c: SQL Prepare failed![DELETE FROM voicemessages WHERE dir=? AND msgnum=?]<br>
[Jun 18 08:36:50] WARNING[2608] res_odbc.c: SQL Prepare failed. Attempting a reconnect...<br>[Jun 18 08:36:50] DEBUG[2608] res_odbc.c: Disconnected 0 from asterisk [asterisk-connector]<br>[Jun 18 08:36:50] DEBUG[2608] res_odbc.c: Database handle deallocated<br>
[Jun 18 08:36:50] NOTICE[2608] res_odbc.c: Connecting asterisk<br>[Jun 18 08:36:50] NOTICE[2608] res_odbc.c: res_odbc: Connected to asterisk [asterisk-connector]<br>[Jun 18 08:36:50] WARNING[2608] app_voicemail.c: SQL Execute error!<br>
[DELETE FROM voicemessages WHERE dir=? AND msgnum=?]<br><br>[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<br>
[Jun 18 08:36:50] VERBOSE[2608] logger.c: Found<br>[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 (?,?, ? , ?,?,?,?,?,?,?)]<br>
[Jun 18 08:36:50] WARNING[2608] res_odbc.c: SQL Prepare failed. Attempting a reconnect...<br>[Jun 18 08:36:50] DEBUG[2608] res_odbc.c: Disconnected 0 from asterisk [asterisk-connector]<br>[Jun 18 08:36:50] DEBUG[2608] res_odbc.c: Database handle deallocated<br>
[Jun 18 08:36:50] NOTICE[2608] res_odbc.c: Connecting asterisk<br>[Jun 18 08:36:51] NOTICE[2608] res_odbc.c: res_odbc: Connected to asterisk [asterisk-connector]<br>[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 (?,?, ? , ?,?,?,?,?,?,?)]<br>
[Jun 18 08:36:51] WARNING[2608] res_odbc.c: SQL Prepare failed. Attempting a reconnect...<br>[Jun 18 08:36:51] DEBUG[2608] res_odbc.c: Disconnected 0 from asterisk [asterisk-connector]<br>[Jun 18 08:36:51] DEBUG[2608] res_odbc.c: Database handle deallocated<br>
[Jun 18 08:36:51] NOTICE[2608] res_odbc.c: Connecting asterisk<br>[Jun 18 08:36:51] NOTICE[2608] res_odbc.c: res_odbc: Connected to asterisk [asterisk-connector]<br>[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<br>
[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<br>
[Jun 18 08:36:51] VERBOSE[2608] logger.c: Found<br>[Jun 18 08:36:51] DEBUG[2608] devicestate.c: Notification of state change to be queued on device/channel Substitution/voicemail<br>[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<br>
[Jun 18 08:36:51] VERBOSE[2608] logger.c: Found<br>[Jun 18 08:36:51] DEBUG[2608] devicestate.c: Notification of state change to be queued on device/channel Substitution/voicemail<br>[Jun 18 08:36:51] DEBUG[2608] app_voicemail.c: Sent mail to <a href="mailto:moises@oriontec.com.br">moises@oriontec.com.br</a> with command '/usr/sbin/sendmail -t'<br>
[Jun 18 08:36:51] DEBUG[2109] devicestate.c: No provider found, checking channel drivers for Substitution - voicemail<br>[Jun 18 08:36:51] DEBUG[2109] devicestate.c: Changing state for Substitution/voicemail - state 4 (Invalid)<br>
[Jun 18 08:36:51] DEBUG[2109] devicestate.c: No provider found, checking channel drivers for Substitution - voicemail<br>[Jun 18 08:36:51] DEBUG[2109] devicestate.c: Changing state for Substitution/voicemail - state 4 (Invalid)<br>
[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.<br>[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.<br>
[Jun 18 08:36:51] DEBUG[2608] pbx.c: Spawn extension (interno,1,1) exited non-zero on 'SIP/250-00000002'<br>[Jun 18 08:36:51] VERBOSE[2608] logger.c: == Spawn extension (interno, 1, 1) exited non-zero on 'SIP/250-00000002'<br>
[Jun 18 08:36:51] DEBUG[2608] channel.c: Soft-Hanging up channel 'SIP/250-00000002'<br>[Jun 18 08:36:51] DEBUG[2608] channel.c: Hanging up channel 'SIP/250-00000002'<br>[Jun 18 08:36:51] DEBUG[2608] chan_sip.c: Hangup call SIP/250-00000002, SIP callid NTg1MmFmZTQ3YjAxYmFkMzg1MjQxY2Y3ODk2YTc0OTc.)<br>
[Jun 18 08:36:51] DEBUG[2608] chan_sip.c: Updating call counter for incoming call<br>[Jun 18 08:36:51] DEBUG[2608] chan_sip.c: Call from user '250' removed from call limit 10<br>[Jun 18 08:36:51] VERBOSE[2608] logger.c: > cdr_odbc: Connected to asterisk-connector<br>
[Jun 18 08:36:51] VERBOSE[2608] logger.c: > cdr_odbc: Error in PREPARE -1<br>[Jun 18 08:36:51] VERBOSE[2608] logger.c: > cdr_odbc: Query FAILED Call not logged!<br clear="all"><br>-- <br>Moisés P. Sena <<a href="mailto:moises@oriontec.com.br">moises@oriontec.com.br</a>><br>
(Desenvolvedor WEB)<br>Oriontec Automação Comercial<br><a href="http://www.oriontec.com.br">http://www.oriontec.com.br</a><br>