Sat Nov 25 00:45:43 2006

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

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

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

void agi_unregister agi_command cmd  ) 
 

Definition at line 1715 of file res_agi.c.

References agi_command::cmda, commands, and MAX_COMMANDS.

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


Generated on Sat Nov 25 00:45:43 2006 for Asterisk - the Open Source PBX by  doxygen 1.4.6