1 Star 0 Fork 3

usench/freeswitch-incall

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
InCallApplication.py 1.14 KB
一键复制 编辑 原始数据 按行查看 历史
chentong-dev 提交于 2022-01-25 11:20 . Initial commit
# -*- coding:utf-8 -*-
# Author: ChenTong
# Date: 2021/11/10 10:18
import os
import signal
import socket
import socketserver
from loguru import logger
from common.ImportInitialization import ImportInitialization
from common.LogInitialization import LogInitialization
class InCallApplication:
"""服务启动类"""
# 初始化项目路径
ImportInitialization()
# 初始化日志处理器
LogInitialization()
@staticmethod
def start():
try:
from settings import config
from InCallHandler import InCallHandler
with socketserver.ThreadingTCPServer((config.IN_CALL_HOST, config.IN_CALL_PORT), InCallHandler) as server:
server.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1)
logger.info(f"Application HTTP On: {config.IN_CALL_HOST} Port: {config.IN_CALL_PORT}...")
server.serve_forever()
except Exception as e:
logger.exception(f"Application status: {e}")
os.kill(os.getpid(), signal.SIGKILL)
if __name__ == '__main__':
inCallApplication = InCallApplication()
inCallApplication.start()
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/usench/freeswitch-incall.git
git@gitee.com:usench/freeswitch-incall.git
usench
freeswitch-incall
freeswitch-incall
main

搜索帮助