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 =&gt; _1,1,Voicemail(250@default);<br>
<br>Quando ligo para &#39;1&#39;, 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 =&gt; yes<br>    dsn =&gt; asterisk-connector<br>    username =&gt; asterisk<br>    password =&gt; asterisk<br>    pooling =&gt; no<br>    limit =&gt; -1<br>
    pre-connect =&gt; 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 &#39;/var/spool/asterisk/voicemail/default/250/INBOX&#39;<br>
[Jun 18 08:36:50] DEBUG[2608] app.c: Unlocked path &#39;/var/spool/asterisk/voicemail/default/250/INBOX&#39;<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 &#39;/var/spool/asterisk/voicemail/default/250/INBOX/msg0000.txt&#39;: [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 &#39;/var/spool/asterisk/voicemail/default/250/INBOX/msg0000&#39;, format &#39;WAV&#39;, uservm is &#39;2048&#39;, global is 2048<br>
[Jun 18 08:36:51] VERBOSE[2608] logger.c:   == Parsing &#39;/var/spool/asterisk/voicemail/default/250/INBOX/msg0000.txt&#39;: [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 &#39;/var/spool/asterisk/voicemail/default/250/INBOX/msg0000.txt&#39;: [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 &#39;/usr/sbin/sendmail -t&#39;<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 &#39;Substitution/voicemail&#39; changed to state &#39;4&#39; (Invalid) but we don&#39;t care because they&#39;re not a member of any queue.<br>[Jun 18 08:36:51] DEBUG[2231] app_queue.c: Device &#39;Substitution/voicemail&#39; changed to state &#39;4&#39; (Invalid) but we don&#39;t care because they&#39;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 &#39;SIP/250-00000002&#39;<br>[Jun 18 08:36:51] VERBOSE[2608] logger.c:   == Spawn extension (interno, 1, 1) exited non-zero on &#39;SIP/250-00000002&#39;<br>
[Jun 18 08:36:51] DEBUG[2608] channel.c: Soft-Hanging up channel &#39;SIP/250-00000002&#39;<br>[Jun 18 08:36:51] DEBUG[2608] channel.c: Hanging up channel &#39;SIP/250-00000002&#39;<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 &#39;250&#39; removed from call limit 10<br>[Jun 18 08:36:51] VERBOSE[2608] logger.c:        &gt; cdr_odbc: Connected to asterisk-connector<br>
[Jun 18 08:36:51] VERBOSE[2608] logger.c:        &gt; cdr_odbc: Error in PREPARE -1<br>[Jun 18 08:36:51] VERBOSE[2608] logger.c:        &gt; cdr_odbc: Query FAILED Call not logged!<br clear="all"><br>-- <br>Moisés P. Sena &lt;<a href="mailto:moises@oriontec.com.br">moises@oriontec.com.br</a>&gt;<br>
(Desenvolvedor WEB)<br>Oriontec Automação Comercial<br><a href="http://www.oriontec.com.br">http://www.oriontec.com.br</a><br>