[Serusers] Cutomize usr_preferences

Jiri Kuthan jiri at iptel.org
Tue Oct 23 19:44:20 CEST 2007


Have you had mysql issues with large attr table?

I think it would take some hacking to do it the way you are suggesting,
but it should not be so hard. Basically it should query * and generate
AVPs named as the columns.

The downside is 
a) wheneever you crreate a new service, you have to change the structure
b) you get to a bigger distance from mainstream -- serweb won't work,
   and you have to maintain the patches (unless they make it mainstream
   too)

-jiri

At 17:52 23/10/2007, Roderick wrote:
>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
> 
><http://www.vivophone.com/vivosoft/index.php?idm=Eng&promo=SR0979>Click here to get your own VIVOphone Account with 30 free minutes to the US and Canada and start calling NOW!!!!
> 
>_______________________________________________
>Serusers mailing list
>Serusers at lists.iptel.org
>http://lists.iptel.org/mailman/listinfo/serusers



--
Jiri Kuthan            http://iptel.org/~jiri/




More information about the sr-users mailing list