Sat Apr 12 07:12:28 2008

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 struct 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 1717 of file res_agi.c.

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

01718 {
01719    int x;
01720    for (x=0; x<MAX_COMMANDS - 1; x++) {
01721       if (commands[x].cmda[0] == agi->cmda[0]) {
01722          ast_log(LOG_WARNING, "Command already registered!\n");
01723          return -1;
01724       }
01725    }
01726    for (x=0; x<MAX_COMMANDS - 1; x++) {
01727       if (!commands[x].cmda[0]) {
01728          commands[x] = *agi;
01729          return 0;
01730       }
01731    }
01732    ast_log(LOG_WARNING, "No more room for new commands!\n");
01733    return -1;
01734 }

void ast_agi_unregister ( agi_command cmd  ) 

Definition at line 1736 of file res_agi.c.

References agi_command::cmda, and MAX_COMMANDS.

01737 {
01738    int x;
01739    for (x=0; x<MAX_COMMANDS - 1; x++) {
01740       if (commands[x].cmda[0] == agi->cmda[0]) {
01741          memset(&commands[x], 0, sizeof(agi_command));
01742       }
01743    }
01744 }


Generated on Sat Apr 12 07:12:28 2008 for Asterisk - the Open Source PBX by  doxygen 1.5.5