[asterisk-dev] amaflags

Richard Lyman pchammer at dynx.net
Thu Apr 13 09:37:19 MST 2006


Ron McCarthy wrote:
> Hello, I think this is the right list for this question!
> 
> I want to add some more amaflags to what is defined, so I thought I 
> would just modify this function:
> /*! Converts AMA flag to printable string */
> char *ast_cdr_flags2str(int flag)
> {
>         switch(flag) {
>         case AST_CDR_OMIT:
>                 return "OMIT";
>         case AST_CDR_BILLING:
>                 return "BILLING";
>         case AST_CDR_DOCUMENTATION:
>                 return "DOCUMENTATION";
>         case AST_CDR_NEWFLAG:
>                 return "NEWFLAG";
>         }
>         return "Unknown";
> }
> 
> and
> 
> int ast_cdr_amaflags2int(const char *flag)
> {
>         if (!strcasecmp(flag, "default"))
>                 return 0;
>         if (!strcasecmp(flag, "omit"))
>                 return AST_CDR_OMIT;
>         if (!strcasecmp(flag, "billing"))
>                 return AST_CDR_BILLING;
>         if (!strcasecmp(flag, "documentation"))
>                 return AST_CDR_DOCUMENTATION;
>         if (!strcasecmp(flag, "newflag"))
>                 return AST_CDR_NEWFLAG;
>         return -1;
> }
> 
> so i added the "newflag" part, which seemed to right to me (im not a c++ 
> guru by any means), and now i get this when I try to make *,
> 
> cdr.c: In function `ast_cdr_flags2str':
> cdr.c:694: error: `AST_CDR_NEWFLAG' undeclared (first use in this function)
> cdr.c:694: error: (Each undeclared identifier is reported only once
> cdr.c:694: error: for each function it appears in.)
> cdr.c: In function `ast_cdr_amaflags2int':
> cdr.c:799: error: `AST_CDR_NEWFLAG' undeclared (first use in this function)
> gmake: *** [cdr.o] Error 1
> 
> any ideals?!!? I have grep'ed and search for anymore references of where 
> this would go, im clueless!
> 
> Any help would be great!
> 
> Thanks
> Ron
> 
> 
you forgot about asterisk/include/asterisk/cdr.h

/*! AMA Flags */
#define AST_CDR_OMIT                            (1)
#define AST_CDR_BILLING                         (2)
#define AST_CDR_DOCUMENTATION                   (3)

you need to add

#define AST_CDR_NEWFLAG	                        (4)









More information about the asterisk-dev mailing list