O'Reilly logo

Practical VoIP Using VOCAL by Luan Dang, Cullen Jennings, David Kelly

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Agent API

AgentAPI.*xx is the base class for any application agents. It can be found in the vocal/util directory. An example of an agent is vocal-1.3.0/hb/hbs/HbsAgent.*xx. If you add a new server to the network, add a SIP stack and make an agent for that server.

Let’s have a quick look at some of the code from vocal-1.3.0/util/snmp/AgentApi.hxx:

    typedef enum
    {
        Get = 1,
        Set,
        Trap,
        Response,
        Register,
        Register_Req
    } actionT;

    #define PARM1SIZE 128
    #define PARM2SIZE 1024
    typedef struct
    {
        actionT action;
        AgentApiMibVarT mibVariable;
        unsigned long transactionNumber;
        char parm1[PARM1SIZE];
        char parm2[PARM2SIZE];
    }
    ipcMessage 
;

This is a very simple protocol: there is only one message type, ipcMessage, sent back and forth and a limited number of fields contained within the message. When an SNMPd starts up, it broadcasts an ipcMessage as a Register_Req request. Any servers or SIP stacks that respond also use the same message type with a Register response. When an SNMPd requests system status information, it sends out the ipcMessage with a get command, which is responded to with an ipcMessage containing either a set, trap, or response value.

The parameter parm1[PARM1SIZE] contains the get value. Any received set values are written to the parm2[PARM2SIZE] variable.

Implemented MIBs

The Network Manager application uses the SNMPd and the HBS to manage the VOCAL applications. As stated at the beginning of this chapter, the basic SNMP framework used in VOCAL is taken from the UC Davis SNMP ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required