[Asterisk-Users] Limit call length, whisper time remaining?

Michael Manousos manousos at inaccessnetworks.com
Fri May 16 05:20:37 MST 2003


Garry Adkins wrote:
> Hi,
>  
> We've been evaluating the use of * in our company, and so far, I'm 
> impressed....
>  
> There is one thing I'd like to do, but haven't been able to figure out:
>  
> We'd like to provide people (e.g. travelling employees, etc) the ability 
> to call in via 800 number, and call back out to their homes.  However, 
> we'd like to limit the length of the person's usage in a certain 
> timeframe.  Ideally, we'd like to "whisper" a comment like "You have 8 
> minutes remaining".  This lets us limit abuse, etc.
>  
> I was just thinking... This would work very much like a calling card 
> works now.  (i.e. call into main number, enter PIN, call out but be time 
> limited to X minutes)
>  
> I understand how to set up and retrieve the persons information (via PIN 
> # or whatever) from a database via AGI.. That's fairly straigtforward.
>  
> For the whisper, I thought I might be able to put the call in a 
> "conference room", and then play an MP3 of the whisper message...  Not 
> sure how well that would work and how you would time it appropriately.
>  
> I can't figure out any way to limit the call length and terminate the 
> call forcibly if necessary.
>  
> Anyone have any ideas?

This is, indeed, an extremely nice thing to have. Doing some
code browsing, it seems that Asterisk already has this capability.
The struct of each channel has a "whentohangup" (time_t type) variable.
An absolute timestamp can be stored in there and when the current
time exceeds this timestamp, the channel will be released.

The problem is that (possibly) there is no way to set this timestamp
from inside the extensions.conf, e.g. when you place the call with
"Dial" application. If, indeed, there is no such capability, then
an additional parameter in "Dial" will do the job. This extra
parameter could be, for example, the call duration. (Mark?)
I could also add it myself and post a patch, if this is the
right way to do it and not already implemented :)

Michael.

>  
> Thanks!
>  
> -Garry
>  
>  





More information about the asterisk-users mailing list