Flask Component Broadsoft - QuinnBast/SaskTel-Communication-Portal GitHub Wiki

Broadsoft

BroadsoftResource

The Broadsoft component is the major component of the backend that does all of the work for sending off requests to the API server for consuming user services. The BroadsoftResource is an inherited class which defines the base url for REST endpoints to access. This endpoint is set based on the broadsoft_uri setting within the config file.

BroadsoftConnector

The Broadsoft Connector is the module that makes and sends all REST API requests. This module is configured within Flask to receive any incoming requests made to the /rest/broadsoft endpoint. The module will log to the output.log file when a request is received, and will then try to verify if the request has been made by an authenticated user. Once verified, the parameters of the REST endpoint are evaluated (endpoint, method, data) to ensure that the arguments are valid. After determining the valid inputs, a request to the API servers is created and executed. The response from the API server is simply relayed back to the frontend. This allows the frontend to be able to access any API endpoint from the server without having to format or parse any of the data that is received in the backend.