1234567891011121314151617181920212223242526272829303132333435363738 |
- const NodeAPIServer = require('./api/server');
- const NodeGB28181Server = require('./GB28181Server');
- const NodeStreamServer = require('./stream/server');
- //const config = require('./config');
- const { json } = require('body-parser');
- const conf_file = '/etc/noveltv/mserver/conf/sipserver.conf';
-
- const fs = require('fs');
- try {
- console.log("---------------------------------");
- console.log("Starting gb28181 sip server...");
- console.log("Version=1.1.0");
- console.log("Powered by BEIJING NOVEL-TV Inc.");
- console.log("http://www.ruiboyun.com");
- console.log("---------------------------------");
-
- const data = fs.readFileSync(conf_file, 'utf-8');
- var config = JSON.parse(data);
- if(!config){
- console.log("解析配置文件失败!");
- }else{
- //信令服务
- let vagSignalService = new NodeGB28181Server(config);
- vagSignalService.run();
-
- //网关API服务
- let vagAPIService = new NodeAPIServer(config);
- vagAPIService.run();
-
- //流媒体服务
- if (config.GB28181.streamServer.enable) {
- let vagStreamService = new NodeStreamServer(config);
- vagStreamService.run();
- }
- }
- } catch(e) {
- console.log("读取配置文件失败!");
- }
|