Thu May 24 14:21: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 agi_register (agi_command *cmd)
void 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 agi_register ( agi_command cmd  ) 

Definition at line 1688 of file res_agi.c.

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

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

void agi_unregister ( agi_command cmd  ) 

Definition at line 1707 of file res_agi.c.

References agi_command::cmda, and commands.

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


Generated on Thu May 24 14:21:14 2007 for Asterisk - the Open Source PBX by  doxygen 1.4.7