davidliu hace 4 meses
padre
commit
058b361c72
Se han modificado 3 ficheros con 5 adiciones y 4 borrados
  1. 1 1
      src/core/callcenter/acd.py
  2. 1 1
      src/core/callcenter/api.py
  3. 3 2
      src/core/voip/bot.py

+ 1 - 1
src/core/callcenter/acd.py

@@ -29,7 +29,7 @@ class AcdService:
         self.checkIdleScheduler.add_job(self.try_transfer_agent, 'interval', seconds=2, max_instances=1)
         self.checkIdleScheduler.start()
 
-    def transfer_to_agent(self, call_id, device_id, service_id, user_part):
+    def transfer_to_agent(self, call_id, device_id, service_id):
         call_info = self.cache.get_call_info(call_id)
         self.logger.info('debugger::transfer_to_agent, come in, call_id:%s, call_info:%s'%(call_id, call_info))
         if not call_info:

+ 1 - 1
src/core/callcenter/api.py

@@ -310,7 +310,7 @@ class SipURI:
         self.uri_parameters = {}
 
         scheme = f"{self.SIP_SCHEME}{self.SCHEME_SEPARATOR}"
-        print('------->', sip_uri, sip_uri.startswith(scheme))
+        # print('------->', sip_uri, sip_uri.startswith(scheme))
         sys.stdout.flush()  # 强制刷新输出缓冲区
         if not sip_uri.startswith(scheme):
             raise SipUriSyntaxException(f"SIP URI must start with {scheme}")

+ 3 - 2
src/core/voip/bot.py

@@ -361,7 +361,7 @@ class MyCall(pj.Call):
             self.agent.hangup(self.user_part)
         elif action_code == 'transfer':  # 转人工
             print('todo 转人工')
-            self.agent.transfer(self.user_part, self.session_id, self.device_id)
+            self.agent.transfer(user_part=self.user_part, call_id=self.session_id, device_id=self.device_id)
 
 class ToTextBotAgent:
     def __init__(self, user_asr_text, call_agent):
@@ -549,8 +549,9 @@ class BotAgent:
             self.ep.libHandleEvents(100)
 
     def transfer(self, user_part, call_id, device_id, service_id='00000000000000000'):
+        print(f"Transfer {user_part} to {call_id}", flush=True)
         if self.acd_service:
-            self.acd_service.transfer_to_agent(call_id, device_id, service_id, user_part)
+            self.acd_service.transfer_to_agent(call_id, device_id, service_id)
         # sip_headers = {'P-LIBRA-HangUpReason': 'transferToAgent', 'P-LIBRA-ServiceId': service_id}
         try_count = 100
         while try_count >0: