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

Kaloyan Kovachev kkovachev at varna.net
Fri Dec 23 01:40:55 MST 2005


Hi again,
 here is the patch i've made. It adds two new variables to the L() option of
the Dialapp:
   LIMIT_RECHECK_INTERVAL - if not defined L works as before - no changes in
the old dialplans are needed
   LIMIT_RECHECK_APP - if not defined simply sends a Manager Event
"RecheckTimeLimit" with info for both legs of the call
                     - if defined should start that app every
LIMIT_RECHECK_INTERVAL ms, which is not yet completed, but this patch should
be enough to
reread the new timelimit if changed via Manager.


On Thu, 22 Dec 2005 13:59:01 +0100, [UTF-8?]HГҐkon [UTF-8?]NessjГёen wrote
> Hi,
> 
> Thats exactly what I am doing too.. I am monitoring calls with a 
> perlscript using a Manager connection, and I want to be able to 
> change the timelimit or warningtime if a second call is made.
> 
> My aproach so far has been to add a "bridge_config" variable in the 
> ast_channel struct, which holds the current config variable of the 
> bridge, if the channel has been bridged. Then I am able to change 
> this with the new Manager-function that I called changetime. Which 
> you feed with the channel being bridged.
> 
> So far, this works. I'm just stuck in channels.c. About making it re-
> read it. Hm.. Does it poll "nexteventts"? Maybe I should have 
> changed that variable too.
> 
> Anyways. Anyone who can help me with changing the warning- and 
> timelimit time on a live call?
> 
> [UTF-8?]HГҐkon
> 
> -----Opprinnelig melding-----
> Fra: asterisk-dev-bounces at lists.digium.com [mailto:asterisk-dev-
> bounces at lists.digium.com] [UTF-8?]PГҐ vegne av Kaloyan Kovachev Sendt: 22. 
> desember 2005 12:41 Til: Asterisk Developers Mailing List Emne: Re: 
> [Asterisk-Dev] Change 'timelimit' on 'config' in a bridge.
> 
> 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
> 
> _______________________________________________
> --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
> 
> _______________________________________________
> --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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: timelimit_recheck.patch
Type: text/x-patch
Size: 5682 bytes
Desc: not available
Url : http://lists.digium.com/pipermail/asterisk-dev/attachments/20051223/bbad830b/timelimit_recheck.bin


More information about the asterisk-dev mailing list