[asterisk-dev] amaflags

Ron McCarthy ronmccar at gmail.com
Thu Apr 13 10:01:41 MST 2006


Excllent, works great now!

Thanks!

On 4/13/06, Richard Lyman <pchammer at dynx.net> wrote:
>
> 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)
>
>
>
>
>
>
> _______________________________________________
> --Bandwidth and Colocation provided by Easynews.com --
>
> asterisk-dev mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20060413/c23c67ad/attachment.htm


More information about the asterisk-dev mailing list