I think this may be of use to some others who are using openser and asterisk together. Here are the views (you must use MySQL 5.0, or some other database with views) I created to allow asterisk realtime to pull from my openser subscriber list. A little rough, but they function well. You will have to create the asterisk database first, it’s not included in the script. Please post any corrections, or mail them to mwilliams@etc1.net.
USE openser;
ALTER TABLE subscriber
ADD vmail_password varchar(40) NULL,
ADD vmail BOOL DEFAULT TRUE;
USE asterisk;
CREATE VIEW voicemail AS
SELECT phplib_id as uniqueid,
username as customer_id,
‘default’ as context,
username as mailbox,
vmail_password as password,
CONCAT(first_name,’ ',last_name) as fullname,
email_address as email,
NULL as pager,
datetime_created as stamp
FROM openser.subscriber WHERE vmail = TRUE;
CREATE VIEW sip AS
SELECT username as name,
username,
‘friend’ as type,
NULL as secret,
‘dynamic’ as host,
CONCAT(rpid, ’ ‘,’<’,username,’>’) as callerid,
‘default’ as context,
username as mailbox,
‘no’ as nat,
‘no’ as qualify,
NULL as fromuser,
NULL as authuser,
NULL as fromdomain,
NULL as insecure,
‘no’ as canreinvite,
NULL as disallow,
NULL as allow,
NULL as restrictcid,
NULL as ipaddr,
NULL as port,
NULL as regseconds
FROM openser.subscriber;