· 7 years ago · Nov 30, 2018, 06:06 PM
1drop table if exists call_recording
2set @numberdialed = '4073461117' COLLATE utf8_unicode_ci
3create table if not exists call_recording(select 'OUTBOUND' AS direction,
4 c.type,
5 r.start_time,
6 c.number_dialed,
7 r.location as URL,
8 r.extension,
9 r.user
10 from call_log c
11 join recording_log r on c.uniqueid = r.vicidial_id
12 where type in ('Local')
13 #AND c.number_dialed in ('4073461117')
14 order by user);
15
16insert into call_recording
17select 'INBOUND' AS direction,
18 c.type,
19 r.start_time,
20 c.number_dialed,
21 r.location as URL,
22 r.extension,
23 r.user
24from call_log c
25join recording_log r on c.uniqueid = r.vicidial_id
26where type in ('SIP')
27#AND c.number_dialed in ('')
28order by user;
29
30
31select direction, type, start_time, number_dialed, URL, extension, user from call_recording where direction = 'OUTBOUND'
32union
33select direction, type, start_time, number_dialed, URL, extension, user from call_recording where direction = 'INBOUND'
34order by extension