⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 b2bconfig.hxx

📁 Vovida 社区开源的 SIP 协议源码
💻 HXX
字号:
#ifndef  B2bConfig_hxx#define  B2bConfig_hxx/* ==================================================================== * The Vovida Software License, Version 1.0  *  * Copyright (c) 2000 Vovida Networks, Inc.  All rights reserved. *  * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: *  * 1. Redistributions of source code must retain the above copyright *    notice, this list of conditions and the following disclaimer. *  * 2. Redistributions in binary form must reproduce the above copyright *    notice, this list of conditions and the following disclaimer in *    the documentation and/or other materials provided with the *    distribution. *  * 3. The names "VOCAL", "Vovida Open Communication Application Library", *    and "Vovida Open Communication Application Library (VOCAL)" must *    not be used to endorse or promote products derived from this *    software without prior written permission. For written *    permission, please contact vocal@vovida.org. * * 4. Products derived from this software may not be called "VOCAL", nor *    may "VOCAL" appear in their name, without prior written *    permission of Vovida Networks, Inc. *  * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND * NON-INFRINGEMENT ARE DISCLAIMED.  IN NO EVENT SHALL VOVIDA * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. *  * ==================================================================== *  * This software consists of voluntary contributions made by Vovida * Networks, Inc. and many individuals on behalf of Vovida Networks, * Inc.  For more information on Vovida Networks, Inc., please see * <http://www.vovida.org/>. * */static const char* const B2bConfig_hxx_Version =    "$Id: B2bConfig.hxx,v 1.4.28.1 2003/01/17 04:16:12 sprajpat Exp $";#include <assert.h>#include "global.h"#include <stdio.h>#include <string>#include "Sptr.hxx"#ifdef MASCARPONE#include "ProvisioningInterface.hxx"#include "PSIFCreator.hxx"#include "PSDBResult.hxx"#endif#include "VXmlParser.hxx"#include "VFile.hxx"enum CfgSrc{    SRC_NONE=0,    SRC_FILE=1,    SRC_PROV=2};///Interface object used to obtain b2b config data either from Provisioning or from a config file.class B2bConfig{    public:        static string B2B_PROV_DOMAIN;        static string PP_OPTIONAL;        static string PP_FREE;        static string PP_MANDATORY;        //Sip spacifics        static string SIP_LOCAL_PORT;        static string SIP_LOCAL_TRANSPORT;        static string SIP_PROXY_ADDR;        static string SIP_PROXY_PORT;        static string SIP_REG_REGISTER;        static string SIP_REG_ADDR;        static string SIP_REG_PORT;        static string SIP_REG_EXPIRE;                //Radius related        static string RAD_LOCAL_AUTH_PORT;        static string RAD_LOCAL_ACCT_PORT;        static string RAD_BILLING_ADDR;        static string RAD_BILLING_PASSWD;        static string RAD_BILLING_AUTH_PORT;        static string RAD_BILLING_ACCT_PORT;        //Prepaid related        static string PP_OPTIONS;        static string PP_REFRESH_TIME;        static string PP_GET_USERID_FROM;        static string PP_USERID_DECODE_SCHEME;        static string PP_USE_SIP_INFO;        static string PP_USE_HTTP;        //Redundancy to come        /// B2bConfig singleton object accessor        static B2bConfig& instance()         {            if ( myInstance == 0 )            {                myInstance = new B2bConfig();                assert( myInstance );            }            return (*myInstance);        }        ///        void initFromFile(const string& fileName);        ///        void initFromProvisioning(const char* psHost, int psPort,                                    const char* altHost, int altPort,                                    int localSipPort=5060 );	/// clean up on exit()        static void destroy( void );        /// assignment operator        B2bConfig& operator=(const B2bConfig& other);        /// output operator        friend ostream& operator<<(ostream& os, const B2bConfig& data);        ///        string getStr(const string& key)const;        ///        int getInt(const string& key)const;        ///        int getLocalSipPort() const;    protected:        ///        void initKeysForProvisioning();        ///        void initKeysForFile();        /// constructor        B2bConfig();        ///        static void notifyUpdate(const string& data,                                    const string& fileName, bool delFlg);    private:        ///        void breakIt(const string& src, string& left,                      string& right) const;        ///        static B2bConfig* myInstance;#ifdef MASCARPONE        ///        Sptr<PSDBResult> myProvHandle;        FieldListtype myFieldList;#endif        ///        Sptr<VXmlParser> myParser;        ///        static CfgSrc myInitFlag;};#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -