1
General Asterisk configuration / Re: FreePBX 2.9 + Asterisk 1.8.8 + Hotdesking (devicesandusers) Auto Rewrite (works)
« on: March 22, 2012, 04:11:44 »
This is even more radical!
Code: [Select]
delimiter |
DROP TRIGGER `queuemetrics`.`self_update_qlog_rewrite_insert`|
DROP TRIGGER `queuemetrics`.`self_update_qlog_rewrite_update`|
DROP TRIGGER `queuemetrics`.`self_update_qlog_rewrite_delete`|
CREATE TRIGGER self_update_qlog_rewrite_insert AFTER INSERT ON agenti_noti FOR EACH ROW BEGIN
DELETE FROM qlog_rewrite;
INSERT INTO qlog_rewrite ( ag_from, ag_rewritten, last_upd )
SELECT descr_agente, nome_agente, NOW() FROM agenti_noti;
END;
|
CREATE TRIGGER self_update_qlog_rewrite_update AFTER UPDATE ON agenti_noti FOR EACH ROW BEGIN
DELETE FROM qlog_rewrite;
INSERT INTO qlog_rewrite ( ag_from, ag_rewritten, last_upd )
SELECT descr_agente, nome_agente, NOW() FROM agenti_noti;
END;
|
CREATE TRIGGER self_update_qlog_rewrite_delete AFTER DELETE ON agenti_noti FOR EACH ROW BEGIN
DELETE FROM qlog_rewrite;
INSERT INTO qlog_rewrite ( ag_from, ag_rewritten, last_upd )
SELECT descr_agente, nome_agente, NOW() FROM agenti_noti;
END;
|