· 7 years ago · Dec 19, 2018, 07:10 AM
1[conferencesys]
2exten=>_x.,1,Answer()
3same=>n,Set(Id=${SHELL(php /var/www/html/conference/insert.php ${UNIQUEID} ${CDR(billsec)} ${CALLERID(num)} ${UNIQUEID})})
4same=>n,Playback(confirm-number-is)
5same=>n,Saydigits(${Id})
6same=>n,Set(CONFBRIDGE(bridge,record_conference)=yes)
7same=>n,Set(CONFBRIDGE(bridge,record_file)=/var/www/html/conference/${UNIQUEID}.wav)
8same=>n,Set(CONFBRIDGE(bridge,max_members)=1)
9same=>n,ConfBridge(${UNIQUEID})
10same=>n,hangup()
11exten=>h,1,Noop(${UNIQUEID} ..)
12same=>n,Set(path=${SHELL(find /var/www/html/conference -name ${UNIQUEID}*)})
13same=>n,System(mysql --user=root --password='1234' conferences -e "update recordings set path='${path:0:-1}',duration='${CDR(billsec)}' where Id='${Id}'")
14[listenrec]
15exten=>_x.,1,Answer()
16same=>n,read(idnum,enter-conf-call-number)
17same=>n,Set(Id=${SHELL(mysql --user=root --password='1234' --skip-column-names conferences -e "select path from recordings where Id='${idnum}'")})
18same=>n,Noop(${Id:0:-5})
19same=>n,Playback(${Id:0:-5})
20
21
22<?php
23$link = mysqli_connect("localhost", "root", "1234", "conferences");
24/* check connection */
25if (mysqli_connect_errno()) {
26 printf("Connect failed: %s\n", mysqli_connect_error());
27 exit();
28}
29$conf_name=$argv[1];
30$duration=$argv[2];
31$cid=$argv[3];
32$path="/var/www/html/conference/$argv[4]";
33$query = "INSERT INTO `conferences`.`recordings` (
34`id` ,
35`path` ,
36`conference_name` ,
37`duration` ,
38`callerid` ,
39`date` ,
40`reserved1` ,
41`reserved2`
42)
43VALUES (
44NULL , '$path', '$conf_name', '$duration', '$cid',
45CURRENT_TIMESTAMP , NULL , NULL
46)";
47if(mysqli_query($link, $query)) {
48printf(mysqli_insert_id($link));
49exit();
50}
51else {
52 printf("Error: %s\n", mysqli_error($link));
53}
54/* close connection */
55mysqli_close($link);
56?>
57CREATE TABLE IF NOT EXISTS `recordings` (
58 `id` int(11) NOT NULL AUTO_INCREMENT,
59 `path` varchar(150) DEFAULT NULL,
60 `conference_name` varchar(20) NOT NULL,
61 `duration` varchar(10) NOT NULL,
62 `callerid` varchar(20) DEFAULT NULL,
63 `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
64 `reserved1` varchar(20) DEFAULT NULL,
65 `reserved2` varchar(20) DEFAULT NULL,
66 PRIMARY KEY (`id`),
67 UNIQUE KEY `id` (`id`,`conference_name`)
68) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=14 ;