Fri May 26 01:45:39 2006

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

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

01679 {
01680    int x;
01681    for (x=0; x<MAX_COMMANDS - 1; x++) {
01682       if (commands[x].cmda[0] == agi->cmda[0]) {
01683          ast_log(LOG_WARNING, "Command already registered!\n");
01684          return -1;
01685       }
01686    }
01687    for (x=0; x<MAX_COMMANDS - 1; x++) {
01688       if (!commands[x].cmda[0]) {
01689          commands[x] = *agi;
01690          return 0;
01691       }
01692    }
01693    ast_log(LOG_WARNING, "No more room for new commands!\n");
01694    return -1;
01695 }

void agi_unregister agi_command cmd  ) 
 

Definition at line 1697 of file res_agi.c.

References agi_command::cmda, commands, and MAX_COMMANDS.

01698 {
01699    int x;
01700    for (x=0; x<MAX_COMMANDS - 1; x++) {
01701       if (commands[x].cmda[0] == agi->cmda[0]) {
01702          memset(&commands[x], 0, sizeof(agi_command));
01703       }
01704    }
01705 }


Generated on Fri May 26 01:45:39 2006 for Asterisk - the Open Source PBX by  doxygen 1.4.6