reSIProcate/DialogUsageManager  9694
Defines | Functions | Variables
limpc.cxx File Reference
#include <cstring>
#include <cassert>
#include "UserAgent.hxx"
#include "resip/stack/SipStack.hxx"
#include "resip/stack/Uri.hxx"
#include "rutil/Logger.hxx"
#include <signal.h>
Include dependency graph for limpc.cxx:

Go to the source code of this file.

Defines

#define RESIPROCATE_SUBSYSTEM   Subsystem::SIP

Functions

static void signalHandler (int signo)
int main (int argc, char *argv[])

Variables

bool TRUE = true
bool FALSE = false
static bool finished = false

Define Documentation

#define RESIPROCATE_SUBSYSTEM   Subsystem::SIP

Definition at line 27 of file limpc.cxx.


Function Documentation

int main ( int  argc,
char *  argv[] 
)

Definition at line 39 of file limpc.cxx.

References ErrLog, finished, InfoLog, resip::UserAgent::process(), signalHandler(), resip::UserAgent::startup(), and WarningLog.

{
#ifndef _WIN32
   if ( signal( SIGPIPE, SIG_IGN) == SIG_ERR)
   {
      cerr << "Couldn't install signal handler for SIGPIPE" << endl;
      exit(-1);
   }
#endif

   if ( signal( SIGINT, signalHandler ) == SIG_ERR )
   {
      cerr << "Couldn't install signal handler for SIGINT" << endl;
      exit( -1 );
   }

   if ( signal( SIGTERM, signalHandler ) == SIG_ERR )
   {
      cerr << "Couldn't install signal handler for SIGTERM" << endl;
      exit( -1 );
   }

   try
   {
      UserAgent ua(argc, argv);
      ua.startup();
      
      InfoLog(<< argv[0] << " starting");
      while(!finished)
      {
         ua.process();
      }
   }
   catch (BaseSecurity::Exception& e)
   {
      WarningLog (<< "Couldn't set up security object");
      exit(-1);
   }
   catch (BaseException& e)
   {
      ErrLog (<< "Caught: " << e);
      exit(-1);
   }
   catch( ... )
   {
      ErrLog( << "Caught non-resip exception" );
      exit(-1);
   }

   return 0;
}

Here is the call graph for this function:

static void signalHandler ( int  signo) [static]

Definition at line 32 of file limpc.cxx.

References finished.

{
   std::cerr << "Shutting down" << endl;
   finished = true;
}

Variable Documentation

bool FALSE = false

Definition at line 10 of file limpc.cxx.

bool finished = false [static]

Definition at line 29 of file limpc.cxx.

Referenced by main(), and signalHandler().

bool TRUE = true

Definition at line 9 of file limpc.cxx.