core/AmConfig.h
a2a334f1
 /*
  * $Id: AmConfig.h,v 1.12 2004/08/13 13:50:38 rco Exp $
  *
  * Copyright (C) 2002-2003 Fhg Fokus
  *
  * This file is part of sems, a free SIP media server.
  *
  * sems is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version
  *
  * For a license to use the ser software under conditions
  * other than those described here, or to purchase support for this
  * software, please contact iptel.org by e-mail at the following addresses:
  *    info@iptel.org
  *
  * sems is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License 
  * along with this program; if not, write to the Free Software 
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 #ifndef _AmConfig_h_
 #define _AmConfig_h_
 
 #include "AmSdp.h"
 
 #include <string>
 #include <map>
 using std::string;
 using std::map;
 
37abd537
 class AmSessionTimerConfig;
 
a2a334f1
 /**
7c16a0f5
  * \brief holds the current configuration.
  *
a2a334f1
  * This Structure holds the current configuration.
  */
 struct AmConfig
 {
     /** Name of the main configuration file. */
     static string ConfigurationFile;
37abd537
     /** Path to the plug-in configuration files. */
     static string ModConfigPath;
     /** Name of our unix socket file for requests. */
a2a334f1
     static string SocketName;
37abd537
     /** Name of our unix socket file for replies. */
     static string ReplySocketName;
a2a334f1
     /** Name of the Ser unix socket file. */
     static string SerSocketName;
     /** Send method: 'fifo' or 'unix_socket' */
     static string SendMethod;
     /** After server start, IP of the SMTP server. */
     static string SmtpServerAddress;
     /** SMTP server port. */
     static unsigned int SmtpServerPort;
     /** Path where the plug-ins are. */
     static string PlugInPath;
     //static unsigned int MaxRecordTime;
     /** run the programm in daemon mode? */
     static int DaemonMode;
     /** local IP for SDP media advertising */
     static string LocalIP;
     /** Separator character for uri application prefix (ex: voicemail+jiri@iptel.org) */
37abd537
     static string PrefixSep;
a2a334f1
     /** Lowest local RTP port */
37abd537
     static int RtpLowPort;
a2a334f1
     /** Highest local RTP port */
37abd537
     static int RtpHighPort;
     /* Session Timer: -ssa */
     static AmSessionTimerConfig defaultSessionTimerConfig;
     /** number of session scheduler threads */
bbfe61da
     static int MediaProcessorThreads;
37abd537
 
a2a334f1
     /** Init function. Resolves SMTP server address. */
     static int init();
 
     /** Read global configuration file and insert values. Maybe overwritten by
      * command line arguments */
     static int readConfiguration();
 
     /* following setters are used to fill config from config file */    
     /** Setter for SmtpServer Port, returns 0 on invalid value */
37abd537
     static int setSmtpPort(const string& port);
a2a334f1
     /** Setter for RtpLowPort, returns 0 on invalid value */
37abd537
     static int setRtpLowPort(const string& port);
a2a334f1
     /** Setter for RtpHighPort, returns 0 on invalid value */
37abd537
     static int setRtpHighPort(const string& port);
a2a334f1
     /** Setter for Loglevel, returns 0 on invalid value */
37abd537
     static int setLoglevel(const string& level);
a2a334f1
     /** Setter for parameter fork, returns 0 on invalid value */
37abd537
     static int setFork(const string& fork);
a2a334f1
     /** Setter for parameter stderr, returns 0 on invalid value */
37abd537
     static int setStderr(const string& s);
bbfe61da
     /** Setter for parameter MediaProcessorThreads, returns 0 on invalid value */
     static int setMediaProcessorThreads(const string& th);
37abd537
 };
 
 class AmConfigReader;
809a2727
 /** \brief config for the session timer */
37abd537
 class AmSessionTimerConfig {
   /** Session Timer: enable? */
   int EnableSessionTimer;
   /** Session Timer: Desired Session-Expires */
   unsigned int SessionExpires;
   /** Session Timer: Minimum Session-Expires */
   unsigned int MinimumTimer;
     
 public:
   AmSessionTimerConfig();
   ~AmSessionTimerConfig();
   
 
   /** Session Timer: Enable Session Timer?
       returns 0 on invalid value */
   int setEnableSessionTimer(const string& enable);
   /** Session Timer: Setter for Desired Session-Expires, 
       returns 0 on invalid value */
   int setSessionExpires(const string& se);
   /** Session Timer: Setter for Minimum Session-Expires, 
       returns 0 on invalid value */
   int setMinimumTimer(const string& minse);
 
   bool getEnableSessionTimer() { return EnableSessionTimer; }
   unsigned int getSessionExpires() { return SessionExpires; }
   unsigned int getMinimumTimer() { return MinimumTimer; }
 
   int readFromConfig(AmConfigReader& cfg);
a2a334f1
 };
 
 #endif
 
 // Local Variables:
 // mode:C++
 // End: