[asterisk-dev] PJSIP CLI and AMI organization thoughts

George Joseph george.joseph at fairview5.com
Mon Dec 9 14:41:46 CST 2013


On Mon, Dec 9, 2013 at 10:15 AM, Kevin Harwell <kharwell at digium.com> wrote:

> On Mon, 2013-12-09 at 09:17 -0700, George Joseph wrote:
> >
> > If Asterisk were completely OO we could create object factories,
> > interfaces and implementation classes that hide all of that.
> >  Unfortunately, it's not.   Also unfortunately, the needs of human
> > clients are different than system clients.   Back to identify as the
> > example...  Even though endpoint doesn't have a pointer to the
> > identify, the endpoint formatter still has to know about it
> > specifically because it has to place its output in a consistent place
> > relative to other objects.  It can't just iterate through a list of
> > formatters because the order could be different based on module load
> > order.   That'd be OK for a system client but not for a human client.
>
> This is true.  With AMI the order doesn't matter, but I can see how it
> would with CLI stuff.  Sounds like an ordered list of some sort is
> warranted.
> >
>
> Exactly, now who determines the order?  I think it has to be the parent
because the parent determines the context in which the children are
displayed and the parent has to provide the child objects anyway.  The
children can't determine order relative to each other without knowing way
more than they should.

So, for the CLI I'll move to the registration scheme where objects register
their handlers and the CLI processes the handlers top-down in a manner that
provides deterministic and consistent ordering.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20131209/3ab5cac7/attachment.html>


More information about the asterisk-dev mailing list