[asterisk-users] Realtime Extensions -- Comments?

Douglas Garstang dgarstang at oneeighty.com
Tue Aug 22 09:19:55 MST 2006


> -----Original Message-----
> From: Matthew Crocker [mailto:matthew at crocker.com]
> Sent: Tuesday, August 22, 2006 10:03 AM
> To: Asterisk Users Mailing List - Non-Commercial Discussion
> Subject: Re: [asterisk-users] Realtime Extensions -- Comments?
> 
> 
> Add a boolean field to the table then create a view based on the  
> value of that field
> 
> >>> CREATE TABLE `extensions_table_data` (
> >>>  `id` int(11) NOT NULL auto_increment,
> 	   'isActive' boolean NOT NULL default 'True',
> >>>  `context` varchar(20) NOT NULL default '',
> >>>  `exten` varchar(20) NOT NULL default '',
> >>>  `priority` tinyint(4) NOT NULL default '0',
> >>>  `app` varchar(20) NOT NULL default '',
> >>>  `appdata` varchar(128) NOT NULL default '',
> >>>  PRIMARY KEY  (`context`,`exten`,`priority`),
> >>>  KEY `id` (`id`)
> >>> ) TYPE=MyISAM;
> >>>
> >>> Uhm... what abouts comments? What if I wanted to temporarily
> >>> deactivate a couple of extensions? Without a comment flag,
> >> I'd have
> >>> to completely remove those entries from the extensions table!
> >>> That's not very friendly is it... Is there a better way?
> 
> Then
> 
> Create view extensions_table as SELECT  
> id,context,exten,priority,app,appdata from extensions_table_data  
> where IsActive = True;
> 
> Then you can just flip the IsActive bit on/off to remove extensions

That's the workaround I've implemented.



More information about the asterisk-users mailing list