[ previous ] [ next ] [ threads ]
 To :  Alfred Stainer <alfred.stainer@g...>
 From :  Monica Tepelus <monica@v...>
 Subject :  Re: [yate] Limit number of channels
 Date :  Wed, 21 Apr 2010 10:08:21 +0300
Hi,

Look at register module. It handles both call.route and call.cdr  
messages. I used it for something similar.
What happens if you send a call after the limit is passed? If it fails, 
register module has fallback so you just have to return 2 routes from 
the beginning (in the call.route) and call will go the second provider.

Regards,
Monica Tepelus

Alfred Stainer wrote:
> Hi,
> I want to limit the number of channels for outgoing calls, with a 
> different limit for each provider.
> I have write my routing module in C++ but when I have to choose a 
> provider were send a new call, it's necessary to know how many call 
> are already active with this provider.
>  
> I first tried to use the callcounters module but unsuccessfull because 
> in route.call reception I'm capable to set the "context" parameter but 
> not to get the context count value to use in routing decision.
>  
> So, my idea (reading the callcounters module) was to handle, in my 
> routing module, also call.cdr message and increment/decrement counter 
> based on cdrs.
>  
> The problem that I have is when there is an high call rate because the 
> call.cdr messages are enqueued and consumed asynchronously respect to 
> call.route messages and so, when I'm consuming a call.route 
> message there are some call.cdr messages enqueued (for example with 
> operation='initialize') so the counter that I'm using is not correctly 
> updated.
>  
> Please, can anyone help me?
> Thanks,
>  
> Alfred Stainer
>  
>