login | register
Wed 09 of Jul, 2008 [05:32 UTC]

voip-info.org

Discuss [19] History

Asterisk RealTime Voicemail

Created by: utdrmac,Last modification on Fri 09 of May, 2008 [17:45 UTC] by jmahonin

Asterisk RealTime Voicemail


Voicemail.conf Setup

::(Move voicemail.conf to some other directory. Create an empty voicemail.conf in its place.)

Attention: Doesn't seem to work with asterisk 1.2.10, had to add at least the following in voicemail.conf:


[general]
searchcontexts=yes

Extconfig.conf Setup

Add the following line, swapping your own personal values if you wish:


voicemail => mysql,asterisk,voicemail_users



You can change mysql to odbc if you want to use odbc.
You can change asterisk to be the name of your database.
You can change voicemail_users to be the name of the voicemail table we will create below.


Database Table

Lets create the table we need:

NOTE: You can use any table name you wish, just make sure the table name matches what you have the family name bound to.


#
# Table structure for table `voicemail_users`
#

Extended table structure


CREATE TABLE `voicemail_users` (
 `uniqueid` int(11) NOT NULL auto_increment,
 `customer_id` varchar(11) NOT NULL default '0',
 `context` varchar(50) NOT NULL default '',
 `mailbox` varchar(11) NOT NULL default '0',
 `password` varchar(5) NOT NULL default '0',
 `fullname` varchar(150) NOT NULL default '',
 `email` varchar(50) NOT NULL default '',
 `pager` varchar(50) NOT NULL default '',
 `tz` varchar(10) NOT NULL default 'central',
 `attach` varchar(4) NOT NULL default 'yes',
 `saycid` varchar(4) NOT NULL default 'yes',
 `dialout` varchar(10) NOT NULL default '',
 `callback` varchar(10) NOT NULL default '',
 `review` varchar(4) NOT NULL default 'no',
 `operator` varchar(4) NOT NULL default 'no',
 `envelope` varchar(4) NOT NULL default 'no',
 `sayduration` varchar(4) NOT NULL default 'no',
 `saydurationm` tinyint(4) NOT NULL default '1',
 `sendvoicemail` varchar(4) NOT NULL default 'no',
 `delete` varchar(4) NOT NULL default 'no',
 `nextaftercmd` varchar(4) NOT NULL default 'yes',
 `forcename` varchar(4) NOT NULL default 'no',
 `forcegreetings` varchar(4) NOT NULL default 'no',
 `hidefromdir` varchar(4) NOT NULL default 'yes',
 `stamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
 PRIMARY KEY  (`uniqueid`),
 KEY `mailbox_context` (`mailbox`,`context`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ;

Basic table structure


CREATE TABLE `voicemail_users` (
 `uniqueid` int(11) NOT NULL auto_increment,
 `customer_id` int(11) NOT NULL default '0',
 `context` varchar(50) NOT NULL default '',
 `mailbox` int(5) NOT NULL default '0',
 `password` varchar(4) NOT NULL default '0',
 `fullname` varchar(50) NOT NULL default '',
 `email` varchar(50) NOT NULL default '',
 `pager` varchar(50) NOT NULL default '',
 `stamp` timestamp(14) NOT NULL,
 PRIMARY KEY  (`uniqueid`),
 KEY `mailbox_context` (`mailbox`,`context`)
) TYPE=MyISAM;


NOTE: Voicemail `options` such as "attach=yes|saycid=yes" are supported in ARA by creating separate columns in the database, one for each option that you require:

`attach` varchar(3) NOT NULL default 'no',
`saycid` varchar(3) NOT NULL default 'yes',
`hidefromdir` varchar(3) NOT NULL default 'no',


NOTE: The index created on the 2 columns `mailbox` and `context` is because RealTime does its SELECT query using those two columns every time.

Testing


Throw some data into the above table and have fun.

NOTE: 'show voicemail users' will tell you "There are no voicemail users currently defined". This is CORRECT behavior.

Cheers,
Matthew

NOTE: 'uniqueid' column MUST be 'uniqueid' NOT 'id', DO NOT CHANGE to 'id', updating voicemail passwords will not work if changed.

Hard lesson learned.
Hubguru, JR




See Also


Comments

Comments Filter
222

333Re: Realtime Voicemail - Mailbox still not found despite of beeing in database

by look, Friday 16 of May, 2008 [06:29:29 UTC]
Hi beccon, did you solve problem with realtime asterisk? I have the same problem. I am using Asterisk 1.4.18 + addons 1.4.6. CLI "voicemail show users for (my-context-in voicemail.conf)" show me "No such voicemail context". I also tried Asterisk1.4.18 & addons 1.4.4. Realtime peers & users are not problem. Only realtime voicemail has problem :-(. Thanks

lOOk
look@inetbox.sk
222

333Getting MWI on Polycoms working with Asterisk 1.6 Realtime

by jmahonin, Friday 09 of May, 2008 [18:01:16 UTC]
See Asterisk Realtime MWI hacks page, I couldn't get it all working as a comment...
222

333VPN for VoIP Blocking

by jenniferhan, Wednesday 12 of December, 2007 [06:06:30 UTC]
Somebody use VPN to solve the VoIP Blocking issue. But it seems not a good way to solve the voip blocking issue. Because VPN will take more bandwidth and will take effection on the Voice Quality

Currently I am using the VGCP, a new solution to solve the VoIP Blocking issue. Following is theirs website:
http://www.speed-voip.com/index-36.html

If any of you have interested, you may try to use it to solve your VoIP Blocking problems. Thanks.

Andy
andywong-01@hotmail.com

222

333Voicemail msg file name

by arfeen, Friday 25 of May, 2007 [11:03:56 UTC]
how to change he msg filename. currectly it sets like 'msg000x' . i wat to put callerid and user id in the filename for easy access.
222

333Need of mailbox_content KEY??

by ibc, Monday 21 of August, 2006 [16:18:59 UTC]
<i>"NOTE: The index created on the 2 columns `mailbox` and `context` is because RealTime does its SELECT query using those two columns every time."</i><BR><BR>

I have created the table "voicemails" without the KEY `mailbox_context` (`mailbox`,`context`) and it works well. In fact, monitoring the MySQL logs I just see the following QUERY when Asterisk needs to search for a voicemail number:
<BR><BR>
     6 Init DB     asterisk<BR>
     6 Query       SELECT * FROM voicemail WHERE mailbox = '202'

222

333Centralized voicemail?

by lschweiss, Wednesday 18 of January, 2006 [14:50:50 UTC]
Can I use Realtime Voicemail to have several asterisk servers utilize the same storage for voicemail?

I'd like to set up a voicemail server to catch overflow calls for my clients with an Asterisk box. Ideally I would have their Asterisk box have the database and mine would take calls on a VoIP DID and present their same voicemail box and store new message on their server. I would maintain a VPN between Asterisk boxes to do this?

Will Realtime Voicemail work like this or will a voicemail being deposited by another Asterisk box through off the first?
222

333Realtime Voicemail - Mailbox still not found despite of beeing in database

by beccon, Wednesday 18 of January, 2006 [00:18:56 UTC]
Having configured Realtime Voicemail exactly as described above I couldn't get it to work. A <i>realtime load voicemail mailbox 4200</i> showed me that the table was assigned and bound to Asterisk correctly. <br>But calling the mailbox configured from database kept showing me the message that the mailbox was not available:<br><br>

<i>WARNING30148: app_voicemail.c:2384 leave_voicemail: No entry in voicemail config file for '4200'</i><br><br>

As recommended here <a href="http://astbill.com/node/389">http://astbill.com/node/389</A> I uncommented the option <i>searchcontexts=yes</i> in <i>voicemail.conf</i> and now everything works perfectly.<br>
According to the abovementioned link this is an issue with context management in realtime mode as of Asterisk 1.2.<br>


Conrad
222

333

by mikebwilliams, Thursday 03 of November, 2005 [22:21:56 UTC]
This table worked for me:


CREATE TABLE `voicemail_users` (
`uniqueid` bigint NOT NULL auto_increment,
`customer_id` bigint NOT NULL default '0',
`context` varchar(50) NOT NULL default '',
`mailbox` bigint NOT NULL default '0',
`password` varchar(4) NOT NULL default '0',
`fullname` varchar(50) NOT NULL default '',
`email` varchar(50) NOT NULL default '',
`pager` varchar(50) NOT NULL default '',
`stamp` timestamp(14) NOT NULL,
PRIMARY KEY  (`mailbox`),
KEY `mailbox_context` (`mailbox`,`context`),
KEY `uniqueid` (`uniqueid`)
) TYPE=MyISAM;
222

333MySLQ errors when creating table.

by endtroducing, Tuesday 25 of October, 2005 [02:49:42 UTC]
I was getting an error telling me that uniqueid was supposed to be a key if it was auto_increment. So I looked around and stumbled on this page: http://www.asteriskguru.com/tutorials/realtime_pgsql.html

Here is the code I used to go around this error:

CREATE TABLE `voicemail_users` (
`id` serial NOT NULL,
`customer_id` bigint NOT NULL default '0',
`context` varchar(50) NOT NULL default '',
`mailbox` bigint NOT NULL default '0',
`password` varchar(4) NOT NULL default '0',
`fullname` varchar(50) NOT NULL default '',
`email` varchar(50) NOT NULL default '',
`pager` varchar(50) NOT NULL default '',
`stamp` timestamp(14) NOT NULL,
PRIMARY KEY  (`mailbox`),
KEY `mailbox_context` (`mailbox`,`context`)
) TYPE=MyISAM;
222

333MySLQ errors when creating table.

by endtroducing, Tuesday 25 of October, 2005 [02:46:56 UTC]
I was getting an error telling me that uniqueid was supposed to be a key if it was auto_increment. So I looked around and stumbled on this page: http://www.asteriskguru.com/tutorials/realtime_pgsql.html

Here is the code I used to go around this error:

CREATE TABLE `voicemail_users` (
`id` serial NOT NULL,
`customer_id` bigint NOT NULL default '0',
`context` varchar(50) NOT NULL default '',
`mailbox` bigint NOT NULL default '0',
`password` varchar(4) NOT NULL default '0',
`fullname` varchar(50) NOT NULL default '',
`email` varchar(50) NOT NULL default '',
`pager` varchar(50) NOT NULL default '',
`stamp` timestamp(14) NOT NULL,
PRIMARY KEY  (`mailbox`),
KEY `mailbox_context` (`mailbox`,`context`)
) TYPE=MyISAM;