コード例 #1
0
        public Hashtable FreeSwitchConfigHTTPHandler(Hashtable request)
        {
            Hashtable response = new Hashtable();

            response["str_response_string"] = string.Empty;
            response["content_type"]        = "text/plain";
            response["keepalive"]           = false;
            response["int_response_code"]   = 500;

            Hashtable requestBody = ParseRequestBody((string)request["body"]);

            string section = (string)requestBody["section"];

            if (section == "directory")
            {
                response = m_FreeswitchService.HandleDirectoryRequest(requestBody);
            }
            else if (section == "dialplan")
            {
                response = m_FreeswitchService.HandleDialplanRequest(requestBody);
            }
            else
            {
                m_log.WarnFormat("[FreeSwitchVoice]: section was {0}", section);
            }

            return(response);
        }
コード例 #2
0
        public Hashtable FreeSwitchConfigHTTPHandler(Hashtable request)
        {
            Hashtable response = new Hashtable();

            response["str_response_string"] = string.Empty;
            response["content_type"]        = "text/plain";
            response["keepalive"]           = false;
            response["int_response_code"]   = 500;

            Hashtable requestBody = ParseRequestBody((string)request["body"]);

            string section = (string)requestBody["section"];

            if (section == "directory")
            {
                string eventCallingFunction = (string)requestBody["Event-Calling-Function"];
                m_log.DebugFormat(
                    "[FreeSwitchVoice]: Received request for config section directory, event calling function '{0}'",
                    eventCallingFunction);

                response = m_FreeswitchService.HandleDirectoryRequest(requestBody);
            }
            else if (section == "dialplan")
            {
                m_log.DebugFormat("[FreeSwitchVoice]: Received request for config section dialplan");

                response = m_FreeswitchService.HandleDialplanRequest(requestBody);
            }
            else
            {
                m_log.WarnFormat("[FreeSwitchVoice]: Unknown section {0} was requested from config.", section);
            }

            return(response);
        }
コード例 #3
0
        public byte[] FreeSwitchConfigHTTPHandler(string path, Stream request, OSHttpRequest httpRequest,
                                                  OSHttpResponse httpResponse)
        {
            Hashtable requestBody = ParseRequestBody(HttpServerHandlerHelpers.ReadString(request));

            string section = httpRequest.QueryString["section"];

            if (section == "directory")
            {
                return(m_FreeswitchService.HandleDirectoryRequest(requestBody, httpRequest, httpResponse));
            }
            else if (section == "dialplan")
            {
                return(m_FreeswitchService.HandleDialplanRequest(requestBody, httpRequest, httpResponse));
            }
            else
            {
                MainConsole.Instance.WarnFormat("[FreeSwitchVoice]: section was {0}", section);
            }

            return(MainServer.BadRequest);
        }