|
@@ -5,13 +5,14 @@ from src.core.callcenter.agent import AgentService, AgentOperService
|
|
|
from src.core.callcenter.constant import success_response, error_response
|
|
|
from src.core.callcenter.enumeration import CallType
|
|
|
from src.core.callcenter.esl.client import InboundClient, OutboundClient
|
|
|
-from flask import Flask, request, render_template_string
|
|
|
+from flask import Flask, request, render_template_string, Response
|
|
|
|
|
|
from src.core.callcenter.call import CallService
|
|
|
from src.core.callcenter.api import AgentCallRequest, AgentActionRequest, HangupCallRequest, \
|
|
|
HumanServiceQueryRequest
|
|
|
from src.core.voip.bot import BotAgent
|
|
|
from .acd import AcdService
|
|
|
+from src.core.registry import generate_latest
|
|
|
|
|
|
agent = BotAgent(app)
|
|
|
inbound_client = InboundClient(agent,app)
|
|
@@ -21,6 +22,8 @@ agent_service = AgentService(app)
|
|
|
agent_oper_service = AgentOperService(app)
|
|
|
acd_service = AcdService(inbound_client, app)
|
|
|
agent.acd_service = acd_service
|
|
|
+CONTENT_TYPE_LATEST = str('text/plain; version=0.0.4; charset=utf-8')
|
|
|
+
|
|
|
|
|
|
|
|
|
@app.route('/')
|
|
@@ -190,3 +193,7 @@ def num_generate():
|
|
|
return success_response(flow_id)
|
|
|
|
|
|
|
|
|
+@app.route('/metrics', methods=['GET'])
|
|
|
+def get_data():
|
|
|
+ """Returns all data as plaintext."""
|
|
|
+ return Response(generate_latest(), mimetype=CONTENT_TYPE_LATEST)
|