CREATE VIEW `outbound_report_contact_callbell`  AS SELECT `log_outbound`.`id_client` AS `id_contacto_callbell`, `ip_contacto_callbell`.`uuid_contact` AS `uuid_contacto_callbell`, `ip_contacto_callbell`.`name` AS `nombre_contacto_callbell`, `ip_contacto_callbell`.`phonenumber_contact` AS `telefono_movil`, `log_outbound`.`id_outbound` AS `id_outbound`, `ip_outbound_plantillas_callbell`.`name` AS `nombre_outbound`, `ip_outbound_plantillas_callbell`.`fecha_inicio` AS `fecha_inicio`, `ip_outbound_plantillas_callbell`.`fecha_fin` AS `fecha_fin`, `ip_outbound_plantillas_callbell`.`estado` AS `estado`, `ip_outbound_plantillas_callbell`.`url_adjunto` AS `url_adjunto`, `ip_outbound_plantillas_callbell_cstm`.`ip_plantillas_callbell_id_c` AS `id_plantilla`, `ip_plantillas_callbell`.`name` AS `nombre_plantilla`, `ip_plantillas_callbell`.`type_template` AS `tipo_plantilla`, `ip_plantillas_callbell`.`uuid_template` AS `uuid_plantilla`, `log_outbound`.`id` AS `id_log`, `log_outbound`.`fecha` AS `fecha_log`, `log_outbound`.`proceso` AS `proceso_log`, `log_outbound`.`observaciones` AS `observaciones_log`, `log_outbound`.`type_client` AS `tipo_log`, `log_outbound`.`uuid_message` AS `uuid_mensaje`, `log_outbound`.`status_message` AS `estado_mensaje` FROM (((((`log_outbound` left join `ip_contacto_callbell` on(`log_outbound`.`id_client` = `ip_contacto_callbell`.`id`)) left join `ip_contacto_callbell_cstm` on(`ip_contacto_callbell`.`id` = `ip_contacto_callbell_cstm`.`id_c`)) left join `ip_outbound_plantillas_callbell` on(`log_outbound`.`id_outbound` = `ip_outbound_plantillas_callbell`.`id`)) left join `ip_outbound_plantillas_callbell_cstm` on(`ip_outbound_plantillas_callbell`.`id` = `ip_outbound_plantillas_callbell_cstm`.`id_c`)) left join `ip_plantillas_callbell` on(`ip_outbound_plantillas_callbell_cstm`.`ip_plantillas_callbell_id_c` = `ip_plantillas_callbell`.`id`)) WHERE `log_outbound`.`type_client` = 'Contact_Callbell' AND `ip_plantillas_callbell`.`deleted` = 0 ;
