[Asterisk-Dev] ast_flags question

Russell Bryant russelb at clemson.edu
Sat Jan 8 21:48:54 MST 2005


> A really good example would be converting chan_sip to this model...
> 
> Declare
> 
> struct sip_flags {
>    int alreadygone:1;
>    int needdestroy:1;
>    int novideo:1;
>    ...
> }
> 
> struct sip_peer {
>    ...
>    struct sip_flags flags;
> };
> 
> I suspect much of the code in chan_sip that deals with these flags
would
> be much less cumbersome and easier to read using this model.

You think that ...

peer->flags.alreadygone = 1;

would be easier to read than ...

ast_set_flag(peer, SIP_ALREADYGONE);

?

Russell Bryant




More information about the asterisk-dev mailing list