[Asterisk-Dev] LOCAL_USER_ADD / LOCAL_USER_REMOVE semantics ?

Russell Bryant russell at digium.com
Sat Dec 31 11:10:05 MST 2005


On Dec 31, 2005, at 7:23 AM, Luigi Rizzo wrote:
> I suppose a better option would be to put the
> LOCAL_USER_ADD and LOCAL_USER_REMOVE calls around
> the call to the module's handler in pbx_exec(),
> ast_func_read() and ast_func_write() (if i haven't
> missed other places).

I think this is a great idea, and I wonder why nobody ever thought of  
it before.  I wonder if we are missing something.

> Of course this would require to put the localuser
> stuff into the module/function descriptor, but in addition
> to giving correct behaviour,
> this change would also give a huge simplification
> in the module's code because there would be no need to
> replicate the LOCALUSER calls all over the place.

I suppose the ast_app and ast_custom_function structures could  
maintain a reference to the corresponding module structure, and add  
the use count and localusers list to the module structure.  I suppose  
we'd have to take the same approach with registered CLI commands and  
manager actions as well.

Then, we could add the equivalent of STANDARD_HANGUP_LOCALUSERS to  
ast_unload_resource().

Is that pretty much what you were thinking?

-- 
Russell Bryant





More information about the asterisk-dev mailing list