[Asterisk-Dev] rfc: loader tweak: optional subdir

Tzafrir Cohen tzafrir.cohen at xorcom.com
Wed Jul 13 00:12:37 MST 2005


Hi

Following I will describe something that I feel is missing in Asterisk
and I'd like to get your input on how to implement it.

As you know, I am one of those who distribute a binary distribution of
Asterisk. Actually I currently follow Debian's policy for binary
compatibility, which generally states "Debian should work on 386".

This is generally not as bad as it sounds: as we all know, in order to
optimize the system it is generally enough to optimize the 5%/10% of the
code that does 80% of the work. Kernel, maybe glibc. openssl already has
some optimizations. 

One of the most CPU-intensive parts of Asterisk is the codec
transcoding. At this point I'd appreciate anybody who has already done
some profiling/testing to identify the CPU-intesive parts: is it the
codec itself or the underlying library?


Anyway, a relatively simple change to implement is something along the
lines of the 'language' concept of the sounds: Find a way to pass a
value called "arch" to ast_load_resource , and then, when loading the
module $module_name:

  if defined $arch and exists $base_modules_dir/$arch/$module
	then
	  $filename=$base_modules_dir/$arch/$module
	else
	  $filename=$base_modules_dir/$module

Implementing that part in loader.c seems rather simple, once I figure
out how exactly I want to pass the value. loader.c does not have its own
config file and I don't suppose that there's any sense in adding one
just for that. An extra value in asterisk.conf? env var? both sound a
bit extreme.

-- 
Tzafrir Cohen     icq#16849755  +972-50-7952406
tzafrir.cohen at xorcom.com  http://www.xorcom.com



More information about the asterisk-dev mailing list