reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
ConfigParser.hxx
Go to the documentation of this file.
1#if !defined(ConfigParser_hxx)
2#define ConfigParser_hxx
3
4#include <map>
5#include <rutil/Data.hxx>
6#include <rutil/Socket.hxx>
8
9namespace mohparkserver
10{
11
13{
14public:
15 ConfigParser(int argc, char** argv); // Use this constructor to parse command line arguments and read configuration file from disk
16 ConfigParser(); // If you use this constructor you must manually set all configuration values
17 virtual ~ConfigParser();
18
29 typedef std::map<unsigned long , MOHSettings> MOHSettingsMap;
31
47 typedef std::map<unsigned long, ParkSettings> ParkSettingsMap;
49
50 // SIP Settings
53 unsigned short mUdpPort;
54 unsigned short mTcpPort;
55 unsigned short mTlsPort;
60
61 // Media Settings
62 unsigned short mMediaPortRangeStart;
63 unsigned short mMediaPortRangeSize;
65
66 // General Settings
67 unsigned short mHttpPort;
70 unsigned int mLogFileMaxBytes;
71
72 // Store pointer to after socket creation fn - can be used for QOS
74
75private:
76 void parseCommandLine(int argc, char** argv);
77 void parseConfigFile(const resip::Data& filename);
78 bool processOption(const resip::Data& name, const resip::Data& value);
79 bool assignNameAddr(const resip::Data& settingName, const resip::Data& settingValue, resip::NameAddr& nameAddr);
80 bool assignMusicUrl(const resip::Data& settingName, const resip::Data& settingValue, resip::Uri& url);
81};
82
83}
84
85#endif
86
87/* ====================================================================
88
89 Copyright (c) 2010-2016, SIP Spectrum, Inc.
90
91 All rights reserved.
92
93 Redistribution and use in source and binary forms, with or without
94 modification, are permitted provided that the following conditions are
95 met:
96
97 1. Redistributions of source code must retain the above copyright
98 notice, this list of conditions and the following disclaimer.
99
100 2. Redistributions in binary form must reproduce the above copyright
101 notice, this list of conditions and the following disclaimer in the
102 documentation and/or other materials provided with the distribution.
103
104 3. Neither the name of SIP Spectrum nor the names of its contributors
105 may be used to endorse or promote products derived from this
106 software without specific prior written permission.
107
108 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
109 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
110 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
111 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
112 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
113 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
114 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
115 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
116 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
117 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
118 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
119
120 ==================================================================== */
121
Handles cross-platform sockets compatibility.
unsigned short mMediaPortRangeSize
resip::AfterSocketCreationFuncPtr mSocketFunc
unsigned short mMediaPortRangeStart
std::map< unsigned long, ParkSettings > ParkSettingsMap
ParkSettingsMap mParkSettingsMap
std::map< unsigned long, MOHSettings > MOHSettingsMap
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
Definition Data.hxx:90
Represents the "name-addr" and the "addr-spec" elements in the RFC 3261 grammar.
Definition NameAddr.hxx:19
Represents the "SIP-URI" and "SIPS-URI" elements in the RFC 3261 grammar.
Definition Uri.hxx:22
void(* AfterSocketCreationFuncPtr)(Socket s, int transportType, const char *file, int line)
Definition Socket.hxx:107
void list()
Definition userAdmin.cxx:66