Davidliu 1 month ago
parent
commit
2ad19423bf
2 changed files with 8 additions and 6 deletions
  1. 1 0
      src/core/callcenter/constant.py
  2. 7 6
      src/core/callcenter/esl/client.py

+ 1 - 0
src/core/callcenter/constant.py

@@ -43,6 +43,7 @@ READY_TIMES = "readyTimes"
 SEREVICE_TIMES = "serviceTimes"
 SEREVICE_TIMES = "serviceTimes"
 
 
 HOLD_MUSIC_PATH = '/freeswitch/music/hold.wav'
 HOLD_MUSIC_PATH = '/freeswitch/music/hold.wav'
+AGENT_BUSY_MUSIC_PATH = '/freeswitch/music/agent_busy.wav'
 WaitingHangupMusicPath = '/freeswitch/music/sorry.wav'
 WaitingHangupMusicPath = '/freeswitch/music/sorry.wav'
 
 
 BASE_RECORD_PATH = '/freeswitch/record/'
 BASE_RECORD_PATH = '/freeswitch/record/'

+ 7 - 6
src/core/callcenter/esl/client.py

@@ -17,7 +17,8 @@ from src.core.callcenter import BizException
 from src.core.callcenter.cache import Cache
 from src.core.callcenter.cache import Cache
 from src.core.callcenter.api import MakeCallContext, DelayAction, CallInfo, DeviceInfo, NextCommand
 from src.core.callcenter.api import MakeCallContext, DelayAction, CallInfo, DeviceInfo, NextCommand
 from src.core.callcenter.callback import Callback
 from src.core.callcenter.callback import Callback
-from src.core.callcenter.constant import SK, EMPTY, WaitingHangupMusicPath, SAAS_ID, HOLD_MUSIC_PATH
+from src.core.callcenter.constant import SK, EMPTY, WaitingHangupMusicPath, SAAS_ID, HOLD_MUSIC_PATH, \
+    AGENT_BUSY_MUSIC_PATH
 from src.core.callcenter.esl.constant.esl_constant import BRIDGE_VARIABLES, BRIDGE, HANGUP, NORMAL_CLEARING, SIP_HEADER, \
 from src.core.callcenter.esl.constant.esl_constant import BRIDGE_VARIABLES, BRIDGE, HANGUP, NORMAL_CLEARING, SIP_HEADER, \
     SPACE, SOFIA, \
     SPACE, SOFIA, \
     ORIGINATE, PARK, SET, EAVESDROP, SMF_ALEG, EXECUTE, PLAYBACK, PAUSE, TRANSFER, UUID_TRANSFER, UUID_BROADCAST, \
     ORIGINATE, PARK, SET, EAVESDROP, SMF_ALEG, EXECUTE, PLAYBACK, PAUSE, TRANSFER, UUID_TRANSFER, UUID_BROADCAST, \
@@ -203,22 +204,22 @@ class InboundClient:
             self.logger.info("exec_when_acd_timeout callInfo为空 callId: %s", call_id)
             self.logger.info("exec_when_acd_timeout callInfo为空 callId: %s", call_id)
             return
             return
 
 
-        def play_sorry():
-            self.hold_play(device_id, WaitingHangupMusicPath)
+        def play_sorry(music_file):
+            self.hold_play(device_id, music_file)
             self.play_timeout(call_id, timeout=30)
             self.play_timeout(call_id, timeout=30)
             next_command = NextCommand(device_id = device_id, next_type=NextType.NEXT_HANGUP.code)
             next_command = NextCommand(device_id = device_id, next_type=NextType.NEXT_HANGUP.code)
             call_info.next_commands = [next_command]
             call_info.next_commands = [next_command]
             self.cache.add_call_info(call_info)
             self.cache.add_call_info(call_info)
             # self.dataHandleServer.update_record(call_id, status= 0)
             # self.dataHandleServer.update_record(call_id, status= 0)
             self.logger.info("waitingTimeOut 开始播放结束音乐 callId:%s customerDeviceId:%s playFile:%s", call_id,
             self.logger.info("waitingTimeOut 开始播放结束音乐 callId:%s customerDeviceId:%s playFile:%s", call_id,
-                             device_id, WaitingHangupMusicPath)
+                             device_id, music_file)
 
 
         next_cmd = call_info.next_commands[0] if call_info.next_commands and len(call_info.next_commands) >0 else None
         next_cmd = call_info.next_commands[0] if call_info.next_commands and len(call_info.next_commands) >0 else None
         self.logger.info("do_delay_action:exec_when_acd_timeout:next_cmd=%s, call_info=%s", next_cmd, call_info)
         self.logger.info("do_delay_action:exec_when_acd_timeout:next_cmd=%s, call_info=%s", next_cmd, call_info)
         if next_cmd and next_cmd.next_type == NextType.NEXT_TRANSFER_CALL.code:
         if next_cmd and next_cmd.next_type == NextType.NEXT_TRANSFER_CALL.code:
             device_id = next_cmd.next_value
             device_id = next_cmd.next_value
             self.break0(device_id)
             self.break0(device_id)
-            play_sorry()
+            play_sorry(AGENT_BUSY_MUSIC_PATH)
 
 
         device_list = [v for k,v in call_info.device_info_map.items() if v.device_type == DeviceType.CUSTOMER]
         device_list = [v for k,v in call_info.device_info_map.items() if v.device_type == DeviceType.CUSTOMER]
         self.logger.info("do_delay_action:exec_when_acd_timeout:device_list=%s, call_info=%s", device_list, call_info)
         self.logger.info("do_delay_action:exec_when_acd_timeout:device_list=%s, call_info=%s", device_list, call_info)
@@ -228,7 +229,7 @@ class InboundClient:
             if not WaitingHangupMusicPath:
             if not WaitingHangupMusicPath:
                 self.hangup_call(call_id, device_id, CallCause.WAITING_TIMEOUT)
                 self.hangup_call(call_id, device_id, CallCause.WAITING_TIMEOUT)
                 return
                 return
-            play_sorry()
+            play_sorry(WaitingHangupMusicPath)
 
 
     def make_call(self, context: MakeCallContext):
     def make_call(self, context: MakeCallContext):
         # self.logger.info("拨打测试context:%s", context.__dict__)
         # self.logger.info("拨打测试context:%s", context.__dict__)