<div dir="ltr"><div>Hi,<br><br></div>I have some issue with voice mail with ODBC on asterisk 11.7 box. I may not understand database functionality on asterisk fully. The most suspected area is func_odbc. I already googled but not luck. Your guide is warmly welcomed<div>
<div><div><div><br></div><div><b>Error messages when I make call and leave message.<br></b></div><div><br>-- <SIP/1ffa9-00000007> Playing 'auth-thankyou.g722' (language 'en')<br>[2014-05-28 14:55:13] DEBUG[12260][C-00000006]: app_voicemail.c:3824 last_message_index: Directory '/var/spool/asterisk/voicemail/default/701/INBOX' has no messages and therefore no index was retrieved.<br>
  == Parsing '/var/spool/asterisk/voicemail/default/701/INBOX/msg0000.txt': Found<br>[2014-05-28 14:55:13] WARNING[12260][C-00000006]: app_voicemail.c:4086 insert_data_cb: SQL Direct Execute failed!<br>[2014-05-28 14:55:13] WARNING[12260][C-00000006]: res_odbc.c:608 ast_odbc_direct_execute: SQL Execute error! Verifying connection to asterisk [asterisk-connector]...<br>
[2014-05-28 14:55:13] WARNING[12260][C-00000006]: app_voicemail.c:4086 insert_data_cb: SQL Direct Execute failed!<br>[2014-05-28 14:55:13] WARNING[12260][C-00000006]: app_voicemail.c:4202 store_file: SQL Execute error!<br>
[INSERT INTO voicemessages (dir,msgnum,recording,context,macrocontext,callerid,origtime,duration,mailboxuser,mailboxcontext,flag,msg_id) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)]<br><br>  == Parsing '/var/spool/asterisk/voicemail/default/701/INBOX/msg0000.txt': Found<br>
  == Parsing '/var/spool/asterisk/voicemail/default/701/INBOX/msg0000.txt': Found<br>    -- Auto fallthrough, channel 'SIP/1ffa9-00000007' status is 'NOANSWER'<br><br><br><b>Dialplan Configuration<br>
</b><div><div><br>[internal]<br><br>exten => 701,1,Dial(SIP/ffbb,17,tT)<br>        same => n,VoiceMail(${EXTEN}@default,u)<br><br>exten => 702,1,Dial(SIP/xlite-1,17,tT)<br>        same => n,VoiceMail(${EXTEN}@default,u)<br>
<br>exten => 703,1,Dial(SIP/ffa9,17,tT)<br>        same => n,VoiceMail(${EXTEN}@default,u)<br><br><br><br><b>Voicemail Configuration</b><br><br>[general]<br><br>format=wav49|wav<br><br>attach=yes<br><br>maxmsg=999<br>
<br>maxsecs=600!<br><br>minsecs= 3<br><br>skipms=3000<br><br>maxlogins=3<br><br>odbcstorage=asterisk<br><br>odbctable=voicemessages<br><br>emailbody=Dear ${VM_NAME}:\n\n\tjust wanted to let you know you were just ${IF($["${VM_CIDNUM}" = "${ORIG_VM_CIDNUM}"]?left:forwarded)} a ${VM_DUR} long message (number ${VM_MSGNUM})\nin mailbox ${VM_MAILBOX} from ${VM_CALLERID}, on ${VM_DATE},\n${IF($["${VM_CIDNUM}" = "${ORIG_VM_CIDNUM}"]?so:(originally sent by ${ORIG_VM_CALLERID} on ${ORIG_VM_DATE})\nso)} you might want to check it when you get a chance.  Thanks!\n\n\t\t\t\t--Asterisk\n<br>
emaildateformat=%A, %B %d, %Y at %r<br>pagerdateformat=%A, %B %d, %Y at %r<br>tz=me                   ; Timezone from zonemessages below. Irrelevant if envelope=no.<br><br>eastern=America/New_York|'vm-received' Q 'digits/at' IMp<br>
central=America/Chicago|'vm-received' Q 'digits/at' IMp<br>central24=America/Chicago|'vm-received' q 'digits/at' H N 'hours'<br>military=Zulu|'vm-received' q 'digits/at' H N 'hours' 'phonetic/z_p'<br>
european=Europe/Copenhagen|'vm-received' a d b 'digits/at' HMi<br>me=Asia/Dubai|'vm-received' Q 'digit/at' H N 'hours'<br><br>[default]<br><br>;1234 => 4242,Example Mailbox,root@localhost<br>
701 => -7012,User One,<a href="mailto:pronekker@gmail.com">pronekker@gmail.com</a><br>702 => -7023,Soft Phone,sp@localhost<br>703 => -7034,Pro Nek,<a href="mailto:pronek@gmail.com">pronek@gmail.com</a><br><br></div>
<div><br></div><div><br></div><div><b>res_odbc Configuration<br></b></div><div><br>[asterisk]<br>enabled => yes<br>dsn => asterisk-connector<br>username => thet<br>password => MyPassword<br>pooling => 1<br>
limit => 5<br>pre-connect => yes<br><br></div><div><b>func_odbc Configuration</b><br></div><div><br>[SQL]<br>dsn=mysql1,asterisk<br>readsql=${ARG1}<br><br>; ODBC_ANTIGF - A blacklist.<br>[ANTIGF]<br>dsn=mysql1,mysql2   ; Use mysql1 as the primary handle, but fall back to mysql2<br>
                    ; if mysql1 is down.  Supports up to 5 comma-separated<br>                    ; DSNs.  "dsn" may also be specified as "readhandle" and<br>                    ; "writehandle", if it is important to separate reads and<br>
                    ; writes to different databases.<br>readsql=SELECT COUNT(*) FROM exgirlfriends WHERE callerid='${SQL_ESC(${ARG1})}'<br>syntax=<callerid><br>synopsis=Check if a specified callerid is contained in the ex-gf database<br>
<br>; ODBC_PRESENCE - Retrieve and update presence<br>[PRESENCE]<br>dsn=mysql1<br>readsql=SELECT location FROM presence WHERE id='${SQL_ESC(${ARG1})}'<br>writesql=UPDATE presence SET location='${SQL_ESC(${VAL1})}' WHERE id='${SQL_ESC(${ARG1})}'<br>
<br></div><div><b>voicemail show command</b><br></div><div><br>abox*CLI> voicemail show users<br>You must specify a specific context to show users from realtime!<br>Usage: voicemail show users [for <context>]<br>
       Lists all mailboxes currently set up<br>abox*CLI><br><br><br><br></div><div><b>extconfig Configuration file</b><br><br></div><div>voicemail =>mysql,asterisk,voicemessages<br><br></div><div>I create table voicemessages in mysql exactly as description in Definitive Guide 4th edition book.<br>
</div></div></div></div></div></div></div>