– Kamailio SIP Server –

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

old-content:openser_to_asterisk_realtime_mysql_views [2006/08/26 02:00] (current)
Line 1: Line 1:
 +===== Alter the OpenSER Tables to Work with Asterisk =====
 +This is the easiest way to integrate them, in the future I will change this to use groups.
 +
 +<​code>​
 +USE openser;
 +ALTER TABLE subscriber
 +ADD vmail_password varchar(40) NULL,
 +ADD vmail BOOL DEFAULT TRUE;
 +</​code>​
 +
 +===== Create the Asterisk Database =====
 +<​code>​
 +CREATE DATABASE asterisk;
 +USE asterisk;
 +</​code>​
 +
 +===== Grant Permissions to Asterisk User =====
 +This allows asterisk to log in per your settings in the asterisk configuration.
 +<​code>​
 +GRANT ALL ON asterisk.* to asterisk@yourhostoriphere IDENTIFIED BY '​passwordhere';​
 +</​code>​
 +
 +===== Voicemail Users View =====
 +This creates a view that maps every user with the vmail column set to true in openser.subscriber have access to voicemail.
 +<​code>​
 +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;
 +</​code>​
 +
 +===== SIP Users View =====
 +In this view, you can change the type from a static '​friend'​ to whatever you need this to be. You can do the same to other options.
 +<​code>​
 +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;​
 +</​code>​
 +
 +
 +Mail me at mikebwilliams@gmail.com.
 +