[Asterisk-Dev] Change 'timelimit' on 'config' in a bridge.

Kaloyan Kovachev kkovachev at varna.net
Thu Dec 22 04:41:26 MST 2005


Hi,
 i am trying to do something similar, as i want to chechk the client's debit
during the call in case a second call from the same client (diferent number)
had started. Here is what i was planning try (as i am not C programmer):

 1. Add another option to the dialapp OR store a global/channel variable in
the dialplan with the time between the checks, which will be read in channel.c
(line 3377 in v1.2.1) into 'nexteventts' if less than play_warning or timelimit.
 2. Again via the same option of dialapp OR another variable - the name of the
application to execute at that time.
/* up to here i will manage it, but here comes the problem */
 3. If it is not yet time to hangup or to play warning () start a new thread
with the application from 2, which should return 0 (keep talking), -1 (hangup
the call) or +x (extend the time with x seconds) OR directly change the status
(via manager or else). This will hapend every N seconds and may take quite
long, so it should be separate thread and the next 'nexteventts' should be
also updated at the end of the 'if (!to) {' check (line 3414).

Hope this helps and any other ideas are welcome.

On Thu, 22 Dec 2005 11:48:15 +0100, Hеkon Nessjшen wrote
> Hi,
> 
> I have made a change to manager.c, to include an action called "ChangeTime".
> This will change the 'timelimit' variable on the config variable of a
> bridge.
> 
> My only problem is that this variable is just read when the first
> bridge-event is
> happening. Like when it is supposed to warn you about little time.
> 
> I have looked in channel.c at the funtion: ast_channel_bridge
> The for(ever) loop is where the config->timelimit is read to figure 
> out when to warn. But it is waiting somewhere inside the loop before 
> the loop is read the second(or more) times. This waiting-time is 
> equal to the time it should wait for the first warning.
> 
> Where in this for loop does it "sleep", and how can I make it to 
> read the loop again (and then re-read the config->timelimit variable)?
> 
> The changetime-concept of mine works when the first warning sound is
> scheduled. I can then
> increase the time, or decrease.
> 
> My goal is to be able to change 'timelimit' on a live bridge. And I 
> feel so close, I just need it to re-read it somewhat more frequent.
> 
> Anyone have any tips for me?
> 
> Hеkon Nessjшen
> 
> _______________________________________________
> --Bandwidth and Colocation provided by Easynews.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