|
@@ -16,8 +16,8 @@ import concurrent.futures
|
|
|
from apscheduler.schedulers.background import BackgroundScheduler
|
|
|
|
|
|
import src.core.callcenter.cache as Cache
|
|
|
-from src.core.callcenter.api import MakeCallContext, DelayAction
|
|
|
-from src.core.callcenter.constant import SK, EMPTY, CTI_ENGINE_DELAY_ACTION_LOCK, HOLD_MUSIC_PATH
|
|
|
+from src.core.callcenter.api import MakeCallContext, DelayAction, CallInfo, DeviceInfo, NextCommand
|
|
|
+from src.core.callcenter.constant import SK, EMPTY, CTI_ENGINE_DELAY_ACTION_LOCK, HOLD_MUSIC_PATH, saasId
|
|
|
from src.core.callcenter.esl.constant.esl_constant import BRIDGE_VARIABLES, BRIDGE, HANGUP, NORMAL_CLEARING, SIP_HEADER, SPACE, SPLIT, SOFIA, \
|
|
|
ORIGINATE, PARK, SET, EAVESDROP, SMF_ALEG, EXECUTE, PLAYBACK, PAUSE, TRANSFER, UUID_TRANSFER, UUID_BROADCAST, UUID_BREAK, UUID_HOLD, \
|
|
|
UUID_RECORD, UUID_SETVAR, UUID_GETVAR
|
|
@@ -518,7 +518,7 @@ class OutboundClient:
|
|
|
kwargs = json.loads(info.serialize('json'))
|
|
|
kwargs['variable_sip_h_P-LIBRA-CallId'] = call_id
|
|
|
destination = self.server.agent.register(**kwargs)
|
|
|
- self.server.logger.info("device_id=%s, destination=%s", device_id, destination)
|
|
|
+ self.server.logger.info("device_id=%s, destination=%s, kwargs=%s", device_id, destination, json.dumps(kwargs))
|
|
|
|
|
|
Cache.add_device_user_part(device_id, destination)
|
|
|
con.execute("bridge", "{sip_h_P-LIBRA-CallId=%s,sip_h_P-LIBRA-DeviceId=%s,origination_uuid=%s}user/%s"%(call_id, new_device_id, new_device_id, destination), device_id)
|
|
@@ -545,10 +545,9 @@ class OutboundClient:
|
|
|
except:
|
|
|
traceback.print_exc()
|
|
|
|
|
|
- def build_call_info(self, info):
|
|
|
- pass
|
|
|
- # agent = Cache.get_agent_info(Saas, request.agent_id)
|
|
|
- # route_gateway = Cache.get_route_gateway(request.saas_id)
|
|
|
+ def build_call_info(self, call_id, device_id, new_device_id, destination, **kwargs):
|
|
|
+ agent = Cache.get_agent_info(saasId, destination)
|
|
|
+ route_gateway = Cache.get_route_gateway(saasId)
|
|
|
# call_info = CallInfo(cti_flow_id=request.cti_flow_id, call_id=call_id, agent_key=agent.agent_number,
|
|
|
# sip_server=agent.sip_server,
|
|
|
# caller=agent.agent_number, called=request.called, direction=Direction.INBOUND.code,
|