Guest User

Untitled

a guest
Dec 19th, 2018
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.17 KB | None | 0 0
  1. [conferencesys]
  2. exten=>_x.,1,Answer()
  3. same=>n,Set(Id=${SHELL(php /var/www/html/conference/insert.php ${UNIQUEID} ${CDR(billsec)} ${CALLERID(num)} ${UNIQUEID})})
  4. same=>n,Playback(confirm-number-is)
  5. same=>n,Saydigits(${Id})
  6. same=>n,Set(CONFBRIDGE(bridge,record_conference)=yes)
  7. same=>n,Set(CONFBRIDGE(bridge,record_file)=/var/www/html/conference/${UNIQUEID}.wav)
  8. same=>n,Set(CONFBRIDGE(bridge,max_members)=1)
  9. same=>n,ConfBridge(${UNIQUEID})
  10. same=>n,hangup()
  11. exten=>h,1,Noop(${UNIQUEID} ..)
  12. same=>n,Set(path=${SHELL(find /var/www/html/conference -name ${UNIQUEID}*)})
  13. same=>n,System(mysql --user=root --password='1234' conferences -e "update recordings set path='${path:0:-1}',duration='${CDR(billsec)}' where Id='${Id}'")
  14. [listenrec]
  15. exten=>_x.,1,Answer()
  16. same=>n,read(idnum,enter-conf-call-number)
  17. same=>n,Set(Id=${SHELL(mysql --user=root --password='1234' --skip-column-names conferences -e "select path from recordings where Id='${idnum}'")})
  18. same=>n,Noop(${Id:0:-5})
  19. same=>n,Playback(${Id:0:-5})
  20.  
  21.  
  22. <?php
  23. $link = mysqli_connect("localhost", "root", "1234", "conferences");
  24. /* check connection */
  25. if (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. )
  43. VALUES (
  44. NULL , '$path', '$conf_name', '$duration', '$cid',
  45. CURRENT_TIMESTAMP , NULL , NULL
  46. )";
  47. if(mysqli_query($link, $query)) {
  48. printf(mysqli_insert_id($link));
  49. exit();
  50. }
  51. else {
  52. printf("Error: %s\n", mysqli_error($link));
  53. }
  54. /* close connection */
  55. mysqli_close($link);
  56. ?>
  57. CREATE 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 ;
Add Comment
Please, Sign In to add comment