|
@@ -625,11 +625,15 @@ class BotAgent:
|
|
def _create_pjsua2(self, timeout_sec=86400):
|
|
def _create_pjsua2(self, timeout_sec=86400):
|
|
start_time = time.time()
|
|
start_time = time.time()
|
|
try:
|
|
try:
|
|
|
|
+ self.logger.info('11111111111')
|
|
self.cache.set_register_per_hours(expire=timeout_sec - (60*3))
|
|
self.cache.set_register_per_hours(expire=timeout_sec - (60*3))
|
|
# Create and initialize the library
|
|
# Create and initialize the library
|
|
ep_cfg = build_ep_config()
|
|
ep_cfg = build_ep_config()
|
|
|
|
+ self.logger.info('222222222222')
|
|
self.ep.libCreate()
|
|
self.ep.libCreate()
|
|
|
|
+ self.logger.info('333333333333')
|
|
self.ep.libInit(ep_cfg)
|
|
self.ep.libInit(ep_cfg)
|
|
|
|
+ self.logger.info('444444444')
|
|
|
|
|
|
aud_dev_mgr = self.ep.audDevManager()
|
|
aud_dev_mgr = self.ep.audDevManager()
|
|
aud_dev_mgr.setNullDev() # 使用虚拟音频设备(如果没有实际设备)
|
|
aud_dev_mgr.setNullDev() # 使用虚拟音频设备(如果没有实际设备)
|
|
@@ -643,6 +647,7 @@ class BotAgent:
|
|
self.ep.transportCreate(pj.PJSIP_TRANSPORT_UDP, sipTpConfig)
|
|
self.ep.transportCreate(pj.PJSIP_TRANSPORT_UDP, sipTpConfig)
|
|
# Start the library
|
|
# Start the library
|
|
self.ep.libStart()
|
|
self.ep.libStart()
|
|
|
|
+ self.logger.info('55555555555')
|
|
|
|
|
|
for user_part in self.user_part_range:
|
|
for user_part in self.user_part_range:
|
|
acfg = build_account_config(self.host, self.port, user_part, self.password, timeout_sec)
|
|
acfg = build_account_config(self.host, self.port, user_part, self.password, timeout_sec)
|
|
@@ -664,13 +669,13 @@ class BotAgent:
|
|
# registry.BOT_AGENT_LIVES.set(self.user_part_pool.qsize())
|
|
# registry.BOT_AGENT_LIVES.set(self.user_part_pool.qsize())
|
|
# self.ep.libHandleEvents(200)
|
|
# self.ep.libHandleEvents(200)
|
|
|
|
|
|
- self.logger.info('2222222222222222222222')
|
|
|
|
- self.call_players.clear()
|
|
|
|
- self.accounts.clear()
|
|
|
|
- self.calls.clear()
|
|
|
|
- # Destroy the library
|
|
|
|
- self.logger.info('3333333333333333333')
|
|
|
|
- self.ep.libDestroy()
|
|
|
|
|
|
+ # self.logger.info('2222222222222222222222')
|
|
|
|
+ # self.call_players.clear()
|
|
|
|
+ # self.accounts.clear()
|
|
|
|
+ # self.calls.clear()
|
|
|
|
+ # # Destroy the library
|
|
|
|
+ # self.logger.info('3333333333333333333')
|
|
|
|
+ # self.ep.libDestroy()
|
|
self.logger.info("create pjsua already shutdown")
|
|
self.logger.info("create pjsua already shutdown")
|
|
|
|
|
|
|
|
|