AmCtrlInterface Class Reference

Base class for the control interfaces. More...

#include <AmCtrlInterface.h>

Inheritance diagram for AmCtrlInterface:

AmFifoCtrlInterface AmUnixCtrlInterface

Public Member Functions

virtual int init (const string &addr)=0
virtual int sendto (const string &addr, const char *buf, unsigned int len)=0
int wait4data (int timeout)
int getFd () const
virtual int cacheMsg ()=0
int getLine (string &line)
int getLines (string &lines)
int getParam (string &param)
virtual void consume ()
virtual void close ()

Static Public Member Functions

static AmCtrlInterfacegetNewCtrl ()

Protected Member Functions

virtual int get_line (char *lb, unsigned int lbs)=0
virtual int get_lines (char *lb, unsigned int lbs)=0
virtual int get_param (string &p, char *lb, unsigned int lbs)=0
 AmCtrlInterface (int fd)

Protected Attributes

int fd
bool close_fd
char buffer [CTRL_MSGBUF_SIZE]

Detailed Description

Base class for the control interfaces.

The AmCtrlInterface defines the interface for SER-SEMS communication interface (unix socket/fifo).

The FIFO / Unix socket Server.

Enables Ser to send request throught FIFO file.

Syntax for FIFO commands:

   version  EOL // 'x.x'
   command  EOL // fct_name.{plugin_name,'bye'}
   method   EOL
   user     EOL 
   dstip    EOL // important for the RTP connection IP
   from     EOL
   to       EOL
   call-id  EOL
   from-tag EOL
   [to-tag] EOL
   cseq     EOL
   transid  EOL // Ser's tranction ID
   [body]   EOL
   .EOL
   EOL
   


Member Function Documentation

virtual int AmCtrlInterface::cacheMsg (  )  [pure virtual]

Returns:
-1 on error, 0 if success

Implemented in AmFifoCtrlInterface, and AmUnixCtrlInterface.

virtual int AmCtrlInterface::get_line ( char *  lb,
unsigned int  lbs 
) [protected, pure virtual]

Returns:
-1 on error, 0 if success

virtual int AmCtrlInterface::init ( const string &  addr  )  [pure virtual]

Open a server control interface. This must be called before everything else

Parameters:
addr local address for server behavior
Returns:
-1 on error, 0 if success

Implemented in AmFifoCtrlInterface, and AmUnixCtrlInterface.

virtual int AmCtrlInterface::sendto ( const string &  addr,
const char *  buf,
unsigned int  len 
) [pure virtual]

Send a message.

Parameters:
addr destination address.
Returns:
-1 on error, 0 if success.

Implemented in AmFifoCtrlInterface, and AmUnixCtrlInterface.

int AmCtrlInterface::wait4data ( int  timeout  ) 

Return: -1 if error. 0 if timeout. 1 if there some datas ready.


The documentation for this class was generated from the following files:
Generated on Thu Mar 8 00:12:46 2007 for Sems by  doxygen 1.4.7
Home |  Recent changes |  Search |  Glossary |  Sitemap |  Login