- [conferencesys]
- exten=>_x.,1,Answer()
- ;same=>n,System(php /var/www/html/conference/insert.php ${UNIQUEID} ${CDR(billsec)} ${CALLERID(num)} ${UNIQUEID})
- same=>n,Set(Id=${SHELL(php /var/www/html/conference/insert.php ${UNIQUEID} ${CDR(billsec)} ${CALLERID(num)} ${UNIQUEID})})
- same=>n,Playback(confirm-number-is)
- same=>n,Saydigits(${Id})
- same=>n,Set(CONFBRIDGE(bridge,record_conference)=yes)
- same=>n,Set(CONFBRIDGE(bridge,record_file)=/var/www/html/conference/${UNIQUEID}.wav)
- same=>n,Set(CONFBRIDGE(bridge,max_members)=1)
- same=>n,ConfBridge(${UNIQUEID})
- same=>n,hangup()
- exten=>h,1,Noop(${UNIQUEID} ..)
- same=>n,Set(path=${SHELL(find /var/www/html/conference -name ${UNIQUEID}*)})
- same=>n,System(mysql --user=root --password='1234' conferences -e "update recordings set path='${path:0:-1}',duration='${CDR(billsec)}' where Id='${Id}'")
- [listenrec]
- exten=>_x.,1,Answer()
- same=>n,read(idnum,enter-conf-call-number)
- same=>n,Set(Id=${SHELL(mysql --user=root --password='1234' --skip-column-names conferences -e "select path from recordings where Id='${idnum}'")})
- same=>n,Noop(${Id:0:-5})
- same=>n,Playback(${Id:0:-5})
- <?php
- $link = mysqli_connect("localhost", "root", "1234", "conferences");
- /* check connection */
- if (mysqli_connect_errno()) {
- printf("Connect failed: %s\n", mysqli_connect_error());
- exit();
- }
- $conf_name=$argv[1];
- $duration=$argv[2];
- $cid=$argv[3];
- $path="/var/www/html/conference/$argv[4]";
- $query = "INSERT INTO `conferences`.`recordings` (
- `id` ,
- `path` ,
- `conference_name` ,
- `duration` ,
- `callerid` ,
- `date` ,
- `reserved1` ,
- `reserved2`
- )
- VALUES (
- NULL , '$path', '$conf_name', '$duration', '$cid',
- CURRENT_TIMESTAMP , NULL , NULL
- )";
- if(mysqli_query($link, $query)) {
- printf(mysqli_insert_id($link));
- exit();
- }
- else {
- printf("Error: %s\n", mysqli_error($link));
- }
- /* close connection */
- mysqli_close($link);
- ?>
- Creating table
CREATE TABLE IF NOT EXISTS `recordings` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`path` varchar(150) DEFAULT NULL,
`conference_name` varchar(20) NOT NULL,
`duration` varchar(10) NOT NULL,
`callerid` varchar(20) DEFAULT NULL,
`date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`reserved1` varchar(20) DEFAULT NULL,
`reserved2` varchar(20) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `id` (`id`,`conference_name`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=14 ;
RAW Paste Data
No hay comentarios:
Publicar un comentario