[asterisk-dev] ast_category_root is the same as ast_variable_browse!

Tilghman Lesher tilghman at mail.jeffandtilghman.com
Wed Nov 14 10:14:16 CST 2007

On Wednesday 14 November 2007 09:33:41 Luigi Rizzo wrote:
> If there is a difference, it is that ast_variable_browse() has an
> optimization (but probably a broken one) to avoid scanning the
> list of categories on repeated searches: if you look at the
> line marked "--->" below, the comparison is made just on the
> pointer and not on the content of the string.

Correct.  It is due to the fact that there may be multiple instances of
the same context name in a config file.  For example, iax.conf may have
separate definitions for type=peer and type=user, for the same host.  We use
the context pointer to ensure that when we seek the next context, we don't
ever end up in an infinite loop, when we're walking the tree.


More information about the asterisk-dev mailing list