[asterisk-dev] [RFC] Audiohooks

Kaloyan Kovachev kkovachev at varna.net
Mon Mar 2 06:45:35 CST 2009


On Sun, 1 Mar 2009 18:58:12 -0600, Tilghman Lesher wrote
> On Sunday 01 March 2009 06:35:52 Kaloyan Kovachev wrote:
> > Hello list,
> >  there are two volume audiohooks: inside the audiohooks.c which is still
> > unused (i think) and another one in function volume. The difference is that
> > the function allows the volume to be adjusted during the call (not
> > specified in the description) with '*' and '#'.
> >  I am about to try and remove the duplication, but i would like get some
> > comments on the direction:
> >   1. Just remove the audiohook from main as it is not used
> >   2. Leave the audiohook in main making it available to all users of
> > audiohooks.h and just call it from the function
> >   3. Convert the function to res_volume together with the audiohook and add
> > cli and manager commands
> >
> > My personal vote is for 3. so it can be used as optional from other modules
> > too, but as it will take more time and changes, wouldn't want to do it, if
> > it is unacceptable/wrong.
> >
> > If 3. is the way to go, the same can be done for the wishper_file too, by
> > leaving in the audiohooks.c only the API and not adding a bunch of hooks
> > there that someone may (not) need
> 
> I'd go with 4:  add an API to manipulate those values to audiohook.h
> implemented in audiohook.c and adjust func_volume to point to that API.

This is what i meant with 2. actually - sorry if i wasn't clear.

> If you wanted to add manager commands, I'd do so directly in audiohook.c,
> with no need for a resource module.  I'd also avoid the CLI command, as it is
> of limited usefulness.
> 

 The disadvantage here is that audiohook.c will contain all the audiohooks
(not talking for just volume here, but also about possibly many future
audiohooks) and will create all the manager commands even if one does not
need/want them, while with a resource module they can be optional (thinking of
like AGI is for app_stack) or mandatory for other modules.

May be an example of 3. will make it clearer what i am thinking of:
  res_volume - implements the audiohook API only (and optionaly AMI command)
  func_volume - only calls that api for a _simple_ volume increase/decrease or
status.
  app_volume - in addition to what func_volume does, allows setting the keys
to adjust the volume during the call separately for caller or callee via
additional options.

but instead of having 3 files i meant to put everything in res_volume

> -- 
> Tilghman
> 
> _______________________________________________
> --Bandwidth and Colocation Provided by http://www.api-digital.com--
> 
> asterisk-dev mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-dev




More information about the asterisk-dev mailing list