Fix unsynced prov-kam databases for gws

If there are unsynced gws in kamailio database 
because the db schema was corrupt this rev 
should align the existing group_id fields and 
remove the orphaned ones.

Thx agranig
2.6
Jon Bonilla 14 years ago
parent 9dde866355
commit fef13ad29c

@ -0,0 +1,5 @@
#Sync group_id between provisioning hosts and lcr hosts
UPDATE kamailio.lcr_gw lg, provisioning.voip_peer_hosts vph SET lg.group_id = vph.group_id WHERE vph.ip = lg.ip_addr AND vph.port = lg.port;
#Remove orphaned ones
DELETE FROM kamailio.lcr_gw WHERE ip_addr NOT IN (select ip from provisioning.voip_peer_hosts);
Loading…
Cancel
Save