create or replace view centile_call_control.v_in_centile_user_account as select * from user_account_centile.user_account;


create or replace view centile_call_control.v_in_customer_account_alive as select * from centile_daemon_phone.v_in_customer_account_alive;


create or replace view centile_call_control.v_in_line_phone as select * from centile_daemon_phone.out_line_phone;

create or replace view centile_call_control.v_in_extension_line as select * from centile_daemon_phone.extension_line;



create or replace view centile_call_control.v_in_last_call_active as SELECT vlp.id, vlp.call_id, tmp.maxdate as date_time, tmp.selfcare_user_id
                                                                     FROM v_in_line_phone vlp
    INNER JOIN (SELECT MAX(vlptmp.date) as maxdate, vlptmp.selfcare_user_id FROM v_in_line_phone vlptmp
    GROUP BY vlptmp.selfcare_user_id) tmp ON vlp.date = tmp.maxdate WHERE 1;



