暫無描述
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

vag.js 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. const NodeAPIServer = require('./api/server');
  2. const NodeGB28181Server = require('./GB28181Server');
  3. const NodeStreamServer = require('./stream/server');
  4. //const config = require('./config');
  5. const { json } = require('body-parser');
  6. const conf_file = '/etc/noveltv/mserver/conf/sipserver.conf';
  7. const fs = require('fs');
  8. try {
  9. console.log("---------------------------------");
  10. console.log("Starting gb28181 sip server...");
  11. console.log("Version=1.1.0");
  12. console.log("Powered by BEIJING NOVEL-TV Inc.");
  13. console.log("http://www.ruiboyun.com");
  14. console.log("---------------------------------");
  15. const data = fs.readFileSync(conf_file, 'utf-8');
  16. var config = JSON.parse(data);
  17. if(!config){
  18. console.log("解析配置文件失败!");
  19. }else{
  20. //信令服务
  21. let vagSignalService = new NodeGB28181Server(config);
  22. vagSignalService.run();
  23. //网关API服务
  24. let vagAPIService = new NodeAPIServer(config);
  25. vagAPIService.run();
  26. //流媒体服务
  27. if (config.GB28181.streamServer.enable) {
  28. let vagStreamService = new NodeStreamServer(config);
  29. vagStreamService.run();
  30. }
  31. }
  32. } catch(e) {
  33. console.log("读取配置文件失败!");
  34. }