· 7 years ago · Nov 30, 2018, 06:10 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 c.length_in_sec
11 from call_log c
12 join recording_log r on c.uniqueid = r.vicidial_id
13 where type in ('Local')
14 #AND c.number_dialed in ('4073461117')
15 order by user);
16
17insert into call_recording
18select 'INBOUND' AS direction,
19 c.type,
20 r.start_time,
21 c.number_dialed,
22 r.location as URL,
23 r.extension,
24 r.user,
25 c.length_in_sec
26from call_log c
27join recording_log r on c.uniqueid = r.vicidial_id
28where type in ('SIP')
29#AND c.number_dialed in ('')
30order by user;
31
32
33select direction, type, start_time, number_dialed, URL, extension, user from call_recording where direction = 'OUTBOUND'
34union
35select direction, type, start_time, number_dialed, URL, extension, user from call_recording where direction = 'INBOUND'
36order by extension