While debugging some changes I'm making to sipXconfig I made this query that 
has been generally useful, especially when trying to port configuration between 
test systems. It dumps the configuration settings for all the phones including 
the local ones and the ones related to phone groups ordered by their precedence.

'scope' means the phone group name or 'private' for settings that are local to 
the phone.

-Eric

PROD pbx ~$ psql -U postgres SIPXCONFIG
psql (8.4.2)
Type "help" for help.

SIPXCONFIG=# select p.description as "Phone", p.serial_number as "Serial", 
s.path as "Setting", s.value as "Value", 'private' as "Scope", 999 as "Weight" 
from setting_value s, phone p where p.value_storage_id = s.value_storage_id 
union select p.description, p.serial_number, s.path, s.value, gs.name, 
gs.weight from setting_value s, phone p, phone_group g, group_storage gs where 
s.value_storage_id = gs.group_id and g.phone_id = p.phone_id and gs.group_id = 
g.group_id order by 2 asc, 6 desc;
  Phone  |    Serial    |         Setting          |             Value          
   |    Scope    | Weight 
---------+--------------+--------------------------+-------------------------------+-------------+--------
 Office2 | 0004f225f4ea | up/analogHeadsetOption   | 1                          
   | private     |    999
 Office2 | 0004f225f4ea | up/useDirectoryNames     | 1                          
   | private     |    999
 Office2 | 0004f225f4ea | tone.dtmf/rfc2833Payload | 101                        
   | rfc2833fix  |     15
 Office2 | 0004f225f4ea | mb/main/statusbar        | 0                          
   | idle_wxnews |     14
 Office2 | 0004f225f4ea | mb/idleDisplay/refresh   | 300                        
   | idle_wxnews |     14
 Office2 | 0004f225f4ea | mb/idleDisplay/home      | http://srv/eric/wxnews.pl  
   | idle_wxnews |     14
 Office2 | 0004f225f4ea | mb/main/home             | 
http://srv/eric/poly650top.pl | App650      |     13
 Office2 | 0004f225f4ea | mb/main/statusbar        | 0                          
   | App650      |     13
 Office2 | 0004f225f4ea | msg/bypassInstantMessage | 1                          
   | msg_center  |     11
 Office2 | 0004f225f4ea | lcl/time/24HourClock     | 1                          
   | 24hr        |      6
 Office  | 0004f22623f4 | tone.dtmf/rfc2833Payload | 101                        
   | rfc2833fix  |     15
 Office  | 0004f22623f4 | mb/idleDisplay/refresh   | 300                        
   | idle_wxnews |     14
 Office  | 0004f22623f4 | mb/idleDisplay/home      | http://srv/eric/wxnews.pl  
   | idle_wxnews |     14
 Office  | 0004f22623f4 | mb/main/statusbar        | 0                          
   | idle_wxnews |     14
 Office  | 0004f22623f4 | mb/main/home             | 
http://srv/eric/poly650top.pl | App650      |     13
 Office  | 0004f22623f4 | mb/main/statusbar        | 0                          
   | App650      |     13
 Office  | 0004f22623f4 | msg/bypassInstantMessage | 1                          
   | msg_center  |     11
 Office  | 0004f22623f4 | lcl/time/24HourClock     | 1                          
   | 24hr        |      6
 Test1   | 0004f22625f3 | tone.dtmf/rfc2833Payload | 101                        
   | rfc2833fix  |     15
 Test1   | 0004f22625f3 | mb/main/home             | 
http://srv/eric/poly650top.pl | App650      |     13
 Test1   | 0004f22625f3 | mb/main/statusbar        | 0                          
   | App650      |     13
 Test1   | 0004f22625f3 | msg/bypassInstantMessage | 1                          
   | msg_center  |     11
 Test1   | 0004f22625f3 | mb/idleDisplay/home      | http://srv/eric/getwx.pl   
   | idle_wx     |      7
 Test1   | 0004f22625f3 | mb/main/statusbar        | 0                          
   | idle_wx     |      7
 Test1   | 0004f22625f3 | mb/idleDisplay/refresh   | 300                        
   | idle_wx     |      7
 Test2   | 0004f2271faf | tone.dtmf/rfc2833Payload | 101                        
   | rfc2833fix  |     15
 Test2   | 0004f2271faf | msg/bypassInstantMessage | 1                          
   | msg_center  |     11
 Test2   | 0004f2271faf | lcl/time/24HourClock     | 1                          
   | 24hr        |      6
 Rec1    | 0004f22721a5 | tone.dtmf/rfc2833Payload | 101                        
   | rfc2833fix  |     15
 Rec1    | 0004f22721a5 | msg/bypassInstantMessage | 1                          
   | msg_center  |     11
 Rec1    | 0004f22721a5 | lcl/time/24HourClock     | 1                          
   | 24hr        |      6
 Caf1    | 0004f2272673 | tone.dtmf/rfc2833Payload | 101                        
   | rfc2833fix  |     15
 Caf1    | 0004f2272673 | msg/bypassInstantMessage | 1                          
   | msg_center  |     11
 Caf1    | 0004f2272673 | lcl/time/24HourClock     | 1                          
   | 24hr        |      6
 Lab     | 0004f227ccb7 | tone.dtmf/rfc2833Payload | 101                        
   | rfc2833fix  |     15
 Lab     | 0004f227ccb7 | msg/bypassInstantMessage | 1                          
   | msg_center  |     11
 Lab     | 0004f227ccb7 | lcl/time/24HourClock     | 1                          
   | 24hr        |      6
 Guest   | 0004f227ce2c | tone.dtmf/rfc2833Payload | 101                        
   | rfc2833fix  |     15
 Guest   | 0004f227ce2c | msg/bypassInstantMessage | 1                          
   | msg_center  |     11
(39 rows)

_______________________________________________
sipx-users mailing list [email protected]
List Archive: http://list.sipfoundry.org/archive/sipx-users
Unsubscribe: http://list.sipfoundry.org/mailman/listinfo/sipx-users
sipXecs IP PBX -- http://www.sipfoundry.org/

Reply via email to