|
@@ -2,6 +2,7 @@
|
|
# encoding:utf-8
|
|
# encoding:utf-8
|
|
|
|
|
|
import json
|
|
import json
|
|
|
|
+import src.core.callcenter.cache as Cache
|
|
from src.core.callcenter.esl.annotation import EslEventName
|
|
from src.core.callcenter.esl.annotation import EslEventName
|
|
from src.core.callcenter.esl.constant.event_names import CHANNEL_PARK
|
|
from src.core.callcenter.esl.constant.event_names import CHANNEL_PARK
|
|
from src.core.callcenter.esl.handler.esl_event_handler import EslEventHandler
|
|
from src.core.callcenter.esl.handler.esl_event_handler import EslEventHandler
|
|
@@ -19,18 +20,18 @@ class ChannelParkHandler(EslEventHandler):
|
|
self.process_fxo_calling(event)
|
|
self.process_fxo_calling(event)
|
|
return
|
|
return
|
|
|
|
|
|
-
|
|
|
|
def process_fxo_calling(self, event):
|
|
def process_fxo_calling(self, event):
|
|
kwargs = json.loads(event.serialize('json'))
|
|
kwargs = json.loads(event.serialize('json'))
|
|
destination = self.bot_agent.register(**kwargs)
|
|
destination = self.bot_agent.register(**kwargs)
|
|
# destination = '1001'
|
|
# destination = '1001'
|
|
# 获取通话的 UUID
|
|
# 获取通话的 UUID
|
|
- call_uuid = event.getHeader("Unique-ID")
|
|
|
|
|
|
+ device_id = event.getHeader("Unique-ID")
|
|
service = event.getHeader("variable_service")
|
|
service = event.getHeader("variable_service")
|
|
- print(f"Incoming call with UUID: {call_uuid} {service} is transfer to {destination}")
|
|
|
|
|
|
+ print(f"Incoming call with UUID: {device_id} {service} is transfer to {destination}")
|
|
# self.inbound_client.con.execute("transfer", f"{destination} XML default", call_uuid)
|
|
# self.inbound_client.con.execute("transfer", f"{destination} XML default", call_uuid)
|
|
# self.con.execute("answer", "", call_uuid)
|
|
# self.con.execute("answer", "", call_uuid)
|
|
- self.inbound_client.con.execute("bridge", f"user/{destination}", call_uuid)
|
|
|
|
|
|
+ Cache.add_device_user_part(device_id, destination)
|
|
|
|
+ self.inbound_client.con.execute("bridge", f"user/{destination}", device_id)
|
|
|
|
|
|
# destination = "user/1001"
|
|
# destination = "user/1001"
|
|
# msg = ESL.ESLevent("sendmsg", call_uuid)
|
|
# msg = ESL.ESLevent("sendmsg", call_uuid)
|