[Serusers] Cutomize usr_preferences

Roderick roderick at vivophone.com
Tue Oct 23 17:52:43 CEST 2007


Hello list,

 

We are using SER usr_preferences table for handling a large number of
preferences for each user, the problem is that if we use the default form of
the MySQL table we would have several (around 10) records for each client
(and maybe more as we develop new services). As we have a fixed number of
preferences I'd prefer to change the table so it wouldn't be:

 

CREATE TABLE `usr_preferences` (

  `uuid` varchar(64) NOT NULL default '',

  `username` varchar(100) NOT NULL default '0',

  `domain` varchar(128) NOT NULL default '',

  `attribute` varchar(32) NOT NULL default '',

  `value` varchar(128) NOT NULL default '',

  `type` int(11) NOT NULL default '0',

  `modified` timestamp NOT NULL default CURRENT_TIMESTAMP on update
CURRENT_TIMESTAMP,

  PRIMARY KEY  (`attribute`,`username`,`domain`)

) ENGINE=ndbcluster DEFAULT CHARSET=latin1 |

 

But instead it would be something like

 

CREATE TABLE `usr_preferences` (

  `uuid` varchar(64) NOT NULL default '',

  `username` varchar(100) NOT NULL default '0',

  `domain` varchar(128) NOT NULL default '',

  `call_forward_on_busy` varchar(32) NOT NULL default '',

  ` call_forward_on_no_available` varchar(32) NOT NULL default '',

  ` call_forward_on_no_available` varchar(32) NOT NULL default '',

  ` call_forward_on_no_response` varchar(32) NOT NULL default '',

  ` language` varchar(32) NOT NULL default '',

  `type` int(11) NOT NULL default '0',

  `modified` timestamp NOT NULL default CURRENT_TIMESTAMP on update
CURRENT_TIMESTAMP,

  PRIMARY KEY  (`attribute`,`username`,`domain`)

) ENGINE=ndbcluster DEFAULT CHARSET=latin1 |

 

Can this be done, and if so, how can I handle the attribute-value pairs for
each different column????

 

Thanks for any help you can provide,

 

Roderick

 

Click <http://www.vivophone.com/vivosoft/index.php?idm=Eng&promo=SR0979>
here to get your own VIVOphone Account with 30 free minutes to the US and
Canada and start calling NOW!!!!

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20071023/4a9183fd/attachment.htm>


More information about the sr-users mailing list