| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- /*************************************************************************
- 【文件名】 Config.h
- 【功能模块和目的】 配置信息类头文件
- 【开发者及日期】 郑石诺 2015/03/19
- 【版本】 V1.0.0
- 【版权信息】 Copyright (C)2015 河南华谊网络科技有限公司
- 【更改记录】
- *************************************************************************/
- #pragma once
- #include "CfgSipAccount.h"
- #include "CfgTrunkItem.h"
- #include "CfgTrunkMatch.h"
- /*************************************************************************
- 【类名】 CConfig
- 【功能】
- 【接口说明】 配置信息类
- 【开发者及日期】 郑石诺 2015/03/19
- 【版本】 V1.0.0
- 【版权信息】 Copyright (C)2015 河南华谊网络科技有限公司
- 【更改记录】
- *************************************************************************/
- class CConfig
- {
- public:
- typedef CMap<UINT, UINT, CString, LPCTSTR> ExtenMap;
- public:
- CConfig(void);
- virtual ~CConfig(void) = 0 {}
- static bool load(void);
- static int listenPort(void) { return m_ListenPort; }
- static TTS_TYPE ttsType(void) { return m_TtsType; }
- static LPTSTR mcAddr(void) { return m_McAddr; }
- static int mcPort(void) { return m_McPort; }
- static int digitalTrunkCount(void) { return m_DigitalTrunkCount; }
- static int voipTrunkCount(void) { return m_VoipTrunkCount; }
- static LPCTSTR voipSignallingAddr(void) { return m_VoipSignallingAddr; }
- static LPCTSTR voipMediaAddr(void) { return m_VoipMediaAddr; }
- static LPTSTR faxServerAddr(void) { return m_FaxServerAddr; }
- static int faxServerPort(void) { return m_FaxServerPort; }
- static LPCTSTR logFilePath(void) { return m_LogFilePath; }
- static LPCTSTR ttsPath(void) { return m_TtsPath; }
- static ExtenMap& extenMap(void) { return m_MapExten; }
- static CCfgSipAccount& sipAccount(void) { return m_SipAccount; }
- static CCfgTrunkItem& trunkItem(void) { return m_TrunkItem; }
- static CCfgTrunkMatch& trunkMatch(void) { return m_TrunkMatch; }
- private:
- static int m_ListenPort;
- static TTS_TYPE m_TtsType;
- static TCHAR m_McAddr[IP_PORT_LEN];
- static int m_McPort;
- static int m_DigitalTrunkCount;
- static int m_VoipTrunkCount;
- static TCHAR m_VoipSignallingAddr[IP_PORT_LEN];
- static TCHAR m_VoipMediaAddr[IP_PORT_LEN];
- static TCHAR m_FaxServerAddr[IP_PORT_LEN];
- static int m_FaxServerPort;
- static CString m_LogFilePath;
- static CString m_TtsPath;
- // 分机配置信息
- static ExtenMap m_MapExten;
- // 中继匹配、SIP账号配置信息
- static CCfgSipAccount m_SipAccount;
- static CCfgTrunkItem m_TrunkItem;
- static CCfgTrunkMatch m_TrunkMatch;
- public:
- static bool isContainsExten(char* p_tel);
- static void getCallNumFromSipAddr(char* p_sip_uri, char* p_tel_buf);
- };
|