[asterisk-dev] Applicationmap and multiple Key/ActivatedBy entries.

Atis atis at BEST.eu.org
Mon Sep 17 11:21:04 CDT 2007


Hi,

What i basically want - is to limit nway_start for local users only.
So, oi've been trying to include in applicationmap the following code:

[applicationmap]
nway_start_target => 00,self/callee,Macro,nway_start
nway_start_source => 00,self/caller,Macro,nway_start

So,  when local extension calls, i set DYNAMIC_FEATURES to
nway_start_source, and when call goes to local extension - i add
nway_start_target.

The problem is, that it doesn't matter for res_features that
nway_start_source and nway_start_target are used for different
combinations of ActivatedBy - res_features just grabs first, and
executes it. Digging into code showed me that:

if (!strcmp(feature->exten, code)) {
  if (option_verbose > 2)
    ast_verbose(VERBOSE_PREFIX_3 " Feature Found: %s exten:
%s\n",feature->sname, tok);
  res = feature->operation(chan, peer, config, code, sense, feature);
  AST_LIST_UNLOCK(&feature_list);
  break;

So, it just calls first feature and activatedby checking is done
inside. I would be willing to play with this, but my C experience is
quite limited. So, how should this be best done - create function for
checking that feature can be used, and do operation() only then. Or
check some result codes of operation() (for now i got 21 and 23 - they
are meaningless to me).

Maybe this should be done in some incompletely different way - adding
some parameter to feature - that it can only be used by registered
peers (i didn't find anything like that).

Anyway - i want your opinions on this, so i can open issue on this (if
i should at all). But for now, i will try some workarounds, with more
complex composition of DYNAMIC_FEATURES.

Regards,
Atis

-- 
Atis Lezdins,
IT Responsible of BEST Riga,
atis at BEST.eu.org
ICQ: 142239285
Skype: atis.lezdins
Cell Phone: +371 28806004 [Tele2, Latvia]
Work phone: +1 800 7502835 [Toll free, USA]
?BEST? -> www.BEST.eu.org



More information about the asterisk-dev mailing list