ODBC Voicemail and greeting / unavailable / busy messages

Hi all,

I have configured ODBC Voicemail and am now looking at doing two things

  1. Setting default greetings for all users
  2. Allowing users to record their own

How do I do 1?

With regard to 2, when I testing I see the following verbose log in the console

voip01*CLI>
  == Setting global variable 'SIPDOMAIN' to 'voip01'
    -- Executing [*96@NSW:1] Verbose("PJSIP/236666-00000003", "1, "User 236666 dialed the voicemail feature."") in new stack
  "User 236666 dialed the voicemail feature."
    -- Executing [*96@NSW:2] Set("PJSIP/236666-00000003", "MAILBOX=236666") in new stack
    -- Executing [*96@NSW:3] VoiceMailMain("PJSIP/236666-00000003", "236666@voip01,s") in new stack
       > 0x7f1b482b3c60 -- Probation passed - setting RTP source address to xxx.xxx.xxx.xxx:4026
    -- <PJSIP/236666-00000003> Playing 'vm-youhave.gsm' (language 'en')
    -- <PJSIP/236666-00000003> Playing 'vm-no.gsm' (language 'en')
    -- <PJSIP/236666-00000003> Playing 'vm-messages.gsm' (language 'en')
    -- <PJSIP/236666-00000003> Playing 'vm-opts.gsm' (language 'en')
    -- <PJSIP/236666-00000003> Playing 'vm-options.gsm' (language 'en')
    -- Recording the message
    -- <PJSIP/236666-00000003> Playing 'vm-rec-unv.gsm' (language 'en')
    -- <PJSIP/236666-00000003> Playing 'beep.gsm' (language 'en')
    -- x=0, open writing:  /var/spool/asterisk/voicemail/voip01/236666/unavail.tmp format: wav49, 0x7f1ba8018358
    -- User ended message by pressing #
    -- <PJSIP/236666-00000003> Playing 'auth-thankyou.gsm' (language 'en')
    -- <PJSIP/236666-00000003> Playing 'vm-review.gsm' (language 'en')
    -- <PJSIP/236666-00000003> Playing 'vm-review.gsm' (language 'en')
    -- Saving message as is
    -- <PJSIP/236666-00000003> Playing 'vm-msgsaved.gsm' (language 'en')
    -- <PJSIP/236666-00000003> Playing 'vm-options.gsm' (language 'en')
  == Spawn extension (NSW, *96, 3) exited non-zero on 'PJSIP/236666-00000003'

Before I dial to save the message the temporary file exists (with a WAV extension). As soon as I try to save the message the file is gone and no new rows are inserted into voicemal_messages in my database. Any ideas?

I turned query logging on with MySQL to work out what was happening. Here’s the insert statement for inserting the user’s custom message:

INSERT INTO voicemail_messages (dir,msgnum,recording,context,macrocontext,callerid,origtime,duration,mailboxuser,mailboxcontext,flag,msg_id) VALUES ('/var/spool/asterisk/voicemail/voip01/236666/unavail','-1','RIFF\[binary]','','','','','','236666','voip01','','')

Running the statement manually shows the following error message

Error in query (1366): Incorrect integer value: '' for column 'origtime' at row 1

This is because MySQL 5.7 defaults to using a strict SQL mode. Should I file a bug against this? The query should insert NULL instead of an empty string based on the table structure.

1 Like