|
reSIProcate/repro
9694
|
#include <ProxyConfig.hxx>


Public Member Functions | |
| ProxyConfig () | |
| ProxyConfig (int argc, char **argv, const resip::Data &defaultConfigFilename) | |
| virtual | ~ProxyConfig () |
| virtual void | printHelpText (int argc, char **argv) |
| void | createDataStore (AbstractDb *db) |
| Store * | getDataStore () |
| bool | getConfigValue (const resip::Data &name, resip::Uri &value) |
| resip::Uri | getConfigUri (const resip::Data &name, const resip::Uri defaultValue, bool useDefaultIfEmpty=false) |
Protected Attributes | |
| Store * | mStore |
Definition at line 13 of file ProxyConfig.hxx.
| repro::ProxyConfig::ProxyConfig | ( | ) |
Definition at line 26 of file ProxyConfig.cxx.
: mStore(0) { }
| repro::ProxyConfig::ProxyConfig | ( | int | argc, |
| char ** | argv, | ||
| const resip::Data & | defaultConfigFilename | ||
| ) |
Definition at line 22 of file ProxyConfig.cxx.
: ConfigParse(argc, argv, defaultConfigFilename), mStore(0) { }
| repro::ProxyConfig::~ProxyConfig | ( | ) | [virtual] |
Definition at line 30 of file ProxyConfig.cxx.
| void repro::ProxyConfig::createDataStore | ( | AbstractDb * | db | ) |
Definition at line 99 of file ProxyConfig.cxx.
| resip::Uri repro::ProxyConfig::getConfigUri | ( | const resip::Data & | name, |
| const resip::Uri | defaultValue, | ||
| bool | useDefaultIfEmpty = false |
||
| ) |
Definition at line 78 of file ProxyConfig.cxx.
{
Uri ret(defaultValue);
if(getConfigValue(name, ret) && ret.host().empty() && useDefaultIfEmpty)
{
return defaultValue;
}
return ret;
}
| bool repro::ProxyConfig::getConfigValue | ( | const resip::Data & | name, |
| resip::Uri & | value | ||
| ) |
Definition at line 37 of file ProxyConfig.cxx.
{
Data lowerName(name); lowerName.lowercase();
ConfigValuesMap::iterator it = mConfigValues.find(lowerName);
if(it != mConfigValues.end())
{
try
{
if(!it->second.empty())
{
NameAddr tempNameAddr(it->second);
value = tempNameAddr.uri();
return true;
}
else
{
value = Uri(); // return an empty Uri
return true;
}
}
catch(resip::BaseException& e)
{
// Try adding sip: to value to see if it will be valid
try
{
NameAddr tempNameAddr(Data("sip:" + it->second));
value = tempNameAddr.uri();
return true;
}
catch(resip::BaseException&)
{
cerr << "Invalid Uri setting: " << name << " = " << it->second << ": " << e << endl;
return false;
}
}
}
// Not found
return false;
}
| Store* repro::ProxyConfig::getDataStore | ( | ) | [inline] |
Definition at line 23 of file ProxyConfig.hxx.
{ return mStore; }
| void repro::ProxyConfig::printHelpText | ( | int | argc, |
| char ** | argv | ||
| ) | [virtual] |
Implements resip::ConfigParse.
Definition at line 89 of file ProxyConfig.cxx.
{
cout << "Command line format is:" << endl;
cout << " " << argv[0] << " [<ConfigFilename>] [--<ConfigValueName>=<ConfigValue>] [--<ConfigValueName>=<ConfigValue>] ..." << endl;
cout << "Sample Command lines:" << endl;
cout << " " << argv[0] << "repro.config --RecordRouteUri=sip:proxy.sipdomain.com --ForceRecordRouting=true" << endl;
cout << " " << argv[0] << "repro.config /RecordRouteUri:sip:proxy.sipdomain.com /ForceRecordRouting:true" << endl;
}
Store* repro::ProxyConfig::mStore [protected] |
Definition at line 32 of file ProxyConfig.hxx.
1.7.5.1