Fri Aug 13 18:21:06 2010

Asterisk developer's documentation


agi.h File Reference

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

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

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

01730 {
01731    int x;
01732    for (x=0; x<MAX_COMMANDS - 1; x++) {
01733       if (commands[x].cmda[0] == agi->cmda[0]) {
01734          ast_log(LOG_WARNING, "Command already registered!\n");
01735          return -1;
01736       }
01737    }
01738    for (x=0; x<MAX_COMMANDS - 1; x++) {
01739       if (!commands[x].cmda[0]) {
01740          commands[x] = *agi;
01741          return 0;
01742       }
01743    }
01744    ast_log(LOG_WARNING, "No more room for new commands!\n");
01745    return -1;
01746 }

void ast_agi_unregister ( agi_command cmd  ) 

Definition at line 1748 of file res_agi.c.

References agi_command::cmda, commands, and MAX_COMMANDS.

01749 {
01750    int x;
01751    for (x=0; x<MAX_COMMANDS - 1; x++) {
01752       if (commands[x].cmda[0] == agi->cmda[0]) {
01753          memset(&commands[x], 0, sizeof(agi_command));
01754       }
01755    }
01756 }


Generated on Fri Aug 13 18:21:06 2010 for Asterisk - the Open Source PBX by  doxygen 1.4.7