Mon May 14 04:43:14 2007

Asterisk developer's documentation


agi.h File Reference

AGI Extension interfaces - Asterisk Gateway Interface. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  agi_command
struct  agi_state

Typedefs

typedef agi_state AGI

Functions

int ast_agi_register (agi_command *cmd)
void ast_agi_unregister (agi_command *cmd)


Detailed Description

AGI Extension interfaces - Asterisk Gateway Interface.

Definition in file agi.h.


Typedef Documentation

typedef struct agi_state AGI


Function Documentation

int ast_agi_register ( agi_command cmd  ) 

Definition at line 1692 of file res_agi.c.

References ast_log(), agi_command::cmda, commands, LOG_WARNING, and MAX_COMMANDS.

01693 {
01694    int x;
01695    for (x=0; x<MAX_COMMANDS - 1; x++) {
01696       if (commands[x].cmda[0] == agi->cmda[0]) {
01697          ast_log(LOG_WARNING, "Command already registered!\n");
01698          return -1;
01699       }
01700    }
01701    for (x=0; x<MAX_COMMANDS - 1; x++) {
01702       if (!commands[x].cmda[0]) {
01703          commands[x] = *agi;
01704          return 0;
01705       }
01706    }
01707    ast_log(LOG_WARNING, "No more room for new commands!\n");
01708    return -1;
01709 }

void ast_agi_unregister ( agi_command cmd  ) 

Definition at line 1711 of file res_agi.c.

References agi_command::cmda, and commands.

01712 {
01713    int x;
01714    for (x=0; x<MAX_COMMANDS - 1; x++) {
01715       if (commands[x].cmda[0] == agi->cmda[0]) {
01716          memset(&commands[x], 0, sizeof(agi_command));
01717       }
01718    }
01719 }


Generated on Mon May 14 04:43:14 2007 for Asterisk - the Open Source PBX by  doxygen 1.5.1