[asterisk-users] voicemail with odbc

ProNek pronek at gmail.com
Thu May 29 03:33:35 CDT 2014


Hi,

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


*Error messages when I make call and leave message.*

-- <SIP/1ffa9-00000007> Playing 'auth-thankyou.g722' (language 'en')
[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.
  == Parsing '/var/spool/asterisk/voicemail/default/701/INBOX/msg0000.txt':
Found
[2014-05-28 14:55:13] WARNING[12260][C-00000006]: app_voicemail.c:4086
insert_data_cb: SQL Direct Execute failed!
[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]...
[2014-05-28 14:55:13] WARNING[12260][C-00000006]: app_voicemail.c:4086
insert_data_cb: SQL Direct Execute failed!
[2014-05-28 14:55:13] WARNING[12260][C-00000006]: app_voicemail.c:4202
store_file: SQL Execute error!
[INSERT INTO voicemessages
(dir,msgnum,recording,context,macrocontext,callerid,origtime,duration,mailboxuser,mailboxcontext,flag,msg_id)
VALUES (?,?,?,?,?,?,?,?,?,?,?,?)]

  == Parsing '/var/spool/asterisk/voicemail/default/701/INBOX/msg0000.txt':
Found
  == Parsing '/var/spool/asterisk/voicemail/default/701/INBOX/msg0000.txt':
Found
    -- Auto fallthrough, channel 'SIP/1ffa9-00000007' status is 'NOANSWER'



*Dialplan Configuration*

[internal]

exten => 701,1,Dial(SIP/ffbb,17,tT)
        same => n,VoiceMail(${EXTEN}@default,u)

exten => 702,1,Dial(SIP/xlite-1,17,tT)
        same => n,VoiceMail(${EXTEN}@default,u)

exten => 703,1,Dial(SIP/ffa9,17,tT)
        same => n,VoiceMail(${EXTEN}@default,u)



*Voicemail Configuration*

[general]

format=wav49|wav

attach=yes

maxmsg=999

maxsecs=600!

minsecs= 3

skipms=3000

maxlogins=3

odbcstorage=asterisk

odbctable=voicemessages

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
emaildateformat=%A, %B %d, %Y at %r
pagerdateformat=%A, %B %d, %Y at %r
tz=me                   ; Timezone from zonemessages below. Irrelevant if
envelope=no.

eastern=America/New_York|'vm-received' Q 'digits/at' IMp
central=America/Chicago|'vm-received' Q 'digits/at' IMp
central24=America/Chicago|'vm-received' q 'digits/at' H N 'hours'
military=Zulu|'vm-received' q 'digits/at' H N 'hours' 'phonetic/z_p'
european=Europe/Copenhagen|'vm-received' a d b 'digits/at' HMi
me=Asia/Dubai|'vm-received' Q 'digit/at' H N 'hours'

[default]

;1234 => 4242,Example Mailbox,root at localhost
701 => -7012,User One,pronekker at gmail.com
702 => -7023,Soft Phone,sp at localhost
703 => -7034,Pro Nek,pronek at gmail.com




*res_odbc Configuration*

[asterisk]
enabled => yes
dsn => asterisk-connector
username => thet
password => MyPassword
pooling => 1
limit => 5
pre-connect => yes

*func_odbc Configuration*

[SQL]
dsn=mysql1,asterisk
readsql=${ARG1}

; ODBC_ANTIGF - A blacklist.
[ANTIGF]
dsn=mysql1,mysql2   ; Use mysql1 as the primary handle, but fall back to
mysql2
                    ; if mysql1 is down.  Supports up to 5 comma-separated
                    ; DSNs.  "dsn" may also be specified as "readhandle" and
                    ; "writehandle", if it is important to separate reads
and
                    ; writes to different databases.
readsql=SELECT COUNT(*) FROM exgirlfriends WHERE
callerid='${SQL_ESC(${ARG1})}'
syntax=<callerid>
synopsis=Check if a specified callerid is contained in the ex-gf database

; ODBC_PRESENCE - Retrieve and update presence
[PRESENCE]
dsn=mysql1
readsql=SELECT location FROM presence WHERE id='${SQL_ESC(${ARG1})}'
writesql=UPDATE presence SET location='${SQL_ESC(${VAL1})}' WHERE
id='${SQL_ESC(${ARG1})}'

*voicemail show command*

abox*CLI> voicemail show users
You must specify a specific context to show users from realtime!
Usage: voicemail show users [for <context>]
       Lists all mailboxes currently set up
abox*CLI>



*extconfig Configuration file*

voicemail =>mysql,asterisk,voicemessages

I create table voicemessages in mysql exactly as description in Definitive
Guide 4th edition book.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20140529/5f911de4/attachment.html>


More information about the asterisk-users mailing list