<div>
<p>Hi, Kaloyan</p>
<p>Can you please give me the last diff or tell me where to get it?<br>Please also give me some tips to configure it.<br>The <a href="http://asterisk-backports.org">asterisk-backports.org</a> seems be closed. </p>
<p>And can I ask some questions about the non-curl version?</p>
<p>1. Can I only set the results as channel variable instead of global variable?<br>2. Is the unit of RTCC_INTERVAL 1/1000 second(ms) not 1 second ?<br>3. Assume that orginal the first parameter TimeLimit of L option is 120000(120 seconds). Then, RTCC_APP should recheck the URL(test.php) after ${LIMIT_RECHECK_INTERVAL} milliseconds such as 6000 is 6 sec. <br>
Does it mean the TimeLimit will be added 10 sec if the result of URL(test.php) is 10? And the TimeLimit is 130 sec.</p>
<p>Best regards,<br>Charles</p><br><br> </div>
<div><span class="gmail_quote">2008/3/27, Kaloyan Kovachev <<a href="mailto:kkovachev@varna.net">kkovachev@varna.net</a>>:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hi,<br>the curl version was provided from greyvoip, so probably he will be able to<br>tell you more about it.<br>
If you use some of the non curl versions (i may send you the latest diff if<br>you wish), you may achieve the same results by setting in advance (as global<br>variable):<br><br>LIMIT_RECHECK_APP=$<br>LIMIT_RECHECK_APP=${LIMIT_RECHECK_APP}{CURL(<a href="http://127.0.0.1/test.php">http://127.0.0.1/test.php</a>?<br>
LIMIT_RECHECK_APP=${LIMIT_RECHECK_APP}app=rtcc&accountcode=$<br>LIMIT_RECHECK_APP=${LIMIT_RECHECK_APP}{ACCOUNTCODE}&dst=$<br>LIMIT_RECHECK_APP=${LIMIT_RECHECK_APP}{EXTEN}&channelid=$<br>LIMIT_RECHECK_APP=${LIMIT_RECHECK_APP}{UNIQUEID}&seqnum=1)}<br>
<br>and you change your dial command to:<br><br>exten => _X.,n,Dial(SIP/1025,,L(${TimeLimit}:${RTCC_INTERVAL}))<br><br>it should work, but keep in mind that it requires at least parameters to L()<br>and that 60000 is 60sec not 6sec.<br>
As your script is returning fixed number (120 or 80 which for the curl<br>version is in milliseconds, but in seconds for the non curl version) this will<br>cause your call duration to be increased with that amount of<br>milliseconds/seconds each time. I would suggest for the tests to start with<br>
${TimeLimit} set to 120000, ${RTCC_INTERVAL} being 10000 and your script<br>returning '-10'.<br><br><br>On Thu, 27 Mar 2008 18:10:40 +0800, Charles Wang wrote<br>> Hi all,<br>><br>> I tried to using rtcc-curl-1.4.13.patch in bug id 6335<br>
<a href="http://bugs.digium.com/view.php?id=6335">http://bugs.digium.com/view.php?id=6335</a> reported by KNK. I patch it to<br>asterisk <a href="http://1.4.18.1">1.4.18.1</a> and it seems work.<br>><br>> My extensions.conf lists below:<br>
><br>> exten =><br>_X.,1,Set(TimeLimit=${CURL(<a href="http://127.0.0.1/test.php?app=rtcc&accountcode=${ACCOUNTCODE}&dst=${EXTEN}&channelid=${UNIQUEID}&seqnum=1)}">http://127.0.0.1/test.php?app=rtcc&accountcode=${ACCOUNTCODE}&dst=${EXTEN}&channelid=${UNIQUEID}&seqnum=1)}</a>)<br>
<br>> exten => _X.,n,Set(TimeLimit=${MATH(${TimeLimit}+5,int)})<br>> exten => _X.,n,Set(TimeLimit=${MATH(${TimeLimit}*1000,int)})<br>> exten => _X.,n,Set(dst=${EXTEN})<br>> exten => _X.,n,NoOp(Initial time limit for ${ACCOUNTCODE} and ${EXTEN} set<br>
at ${TimeLimit})<br>> exten => _X.,n,Set(RTCC_START_SEQNUM=2)<br>> exten => _X.,n,Set(RTCC_INTERVAL=60000)<br>> exten => _X.,n,Dial(SIP/1025,,L(${TimeLimit}:::<a href="http://127.0.0.1/test.php)">http://127.0.0.1/test.php)</a>)<br>
> exten => _X.,n,Hangup<br>><br>> My URL test.php always reponses interger 120. It is pure text format without<br>any symbol before/after it.<br>><br>> My test.php: ( one row only )<br>> 120<br>><br>
> -- Accepting AUTHENTICATED call from XXX.XXX.XXX.XXX:<br>> > requested format = ilbc,<br>> > requested prefs = (),<br>> > actual format = ilbc,<br>> > host prefs = (ilbc),<br>
> > priority = mine<br>> -- Executing [_X.@default:1] Set("SIP/2922-10", "TimeLimit=120") in new<br>stack<br>> -- Executing [_X.@default:2] Set("SIP/2922-10", "TimeLimit=125") in new<br>
stack<br>> -- Executing [_X.@default:3] Set("SIP/2922-10", "TimeLimit=125000") in<br>new stack<br>> -- Executing [_X.@default:4] Set("SIP/2922-10", "dst=295") in new stack<br>
> -- Executing [_X.@default:5] NoOp("SIP/2922-10", "Initial time limit<br>for and 295 set at 45000") in new stack<br>> -- Executing [_X.@default:6] Set("SIP/2922-10", "RTCC_START_SEQNUM=2")<br>
in new stack<br>> -- Executing [_X.@default:7] Set("SIP/2922-10", "RTCC_INTERVAL=60000")<br>in new stack<br>> -- Executing [_X.@default:8] Dial("SIP/2922-10",<br>"SIP/1025||L(125000::<a href="http://127.0.0.1/test.php)">http://127.0.0.1/test.php)</a>") in new stack<br>
> -- Limit Data for this call:<br>> > timelimit = 125000<br>> > play_warning = 0<br>> > play_to_caller = yes<br>> > play_to_callee = no<br>> > warning_freq = 0<br>
> > rtcc url = //127.0.0.1/test.php<br>> > rtcc interval = 60000<br>> > rtcc exp intvl = 0<br>> > rtcc seqnum = 2<br>> > start_sound = (null)<br>
> > warning_sound = timeleft<br>> > end_sound = (null)<br>><br>> During the period, I trace the /var/log/httpd/access_log. I can't find any<br>request to test.php. Should it be visited each 6 sec ?<br>
><br>> (Only this line)<br>> <a href="http://127.0.0.1">127.0.0.1</a> - - [27/Mar/2008:17:51:54 +0800] "GET<br>/test.php?app=rtcc&accountcode=&dst=295&channelid=1206611514.2&seqnum=1<br>HTTP/1.1" 200 3 "-" "asterisk-libcurl-agent/1.0"<br>
><br>> Then, I tried to reduce the integer number 120 to 80. I wish it can be<br>hunup when 80 seconds reached. But the answer was NO. It made my asterisk<br>crashed. I got this message in debug mode.<br>><br>> [Mar 27 17:52:58] DEBUG[32053]: app_dial.c:877 rtcccallback: call control<br>
accountcode=2922, dst=295.<br>> asterisk: symbol lookup error: /usr/lib/asterisk/modules/app_dial.so:<br>undefined symbol: curl_easy_init<br>><br>> Can anyone kindly give me any idea?<br>><br>> Best regards,<br>
> Charles<br>><br>> 2007/7/15, Grey Man <<a href="mailto:greyvoip@yahoo.com.au">greyvoip@yahoo.com.au</a>>:<br>><br>> ----- Original Message ----<br>> From: Kaloyan Kovachev <<a href="mailto:kkovachev@varna.net">kkovachev@varna.net</a>><br>
> To: Asterisk Developers Mailing List <<a href="mailto:asterisk-dev@lists.digium.com">asterisk-dev@lists.digium.com</a>><br>> Sent: Sunday, 15 July, 2007 10:50:29 AM<br>> Subject: Re: [asterisk-dev] Real-time call control for Dial app<br>
><br>> On Sat, 14 Jul 2007 14:36:27 -0700 (PDT), Grey Man wrote<br>> > ----- Original Message ----<br>> > >From: Kaloyan Kovachev <<a href="mailto:kkovachev@varna.net">kkovachev@varna.net</a>><br>
> > >To: Asterisk Developers Mailing List <<a href="mailto:asterisk-dev@lists.digium.com">asterisk-dev@lists.digium.com</a>><br>> > >Sent: Saturday, 14 July, 2007 3:00:54 PM<br>> > >Subject: Re: [asterisk-dev] Real-time call control for Dial app<br>
> > ><br>> > >Hi again,<br>> > >i guess Asterisk is not used for prepaid applications too much, or more<br>> > >likely the risk of overused account is just ignored (there are providers<br>
with<br>> > >'pay as go' services with which i had negative balance for a while).<br>> > >Even separate thread for each call bridge is not the best way and adding<br>> > >another one is not a good idea - agree, but the call control thread is<br>
> > >sleeping most of the time, so it shouldn't cause too much problems.<br>> > >Unfortunately my C skills (and available time) are not enough to make (my<br>> > >long term idea) a single call control thread for which each call will just<br>
> > >register and which will also be responsible for the warning messages on that<br>> > >call instead of the bridging thread itself. I think this is the way to<br>go, but<br>> > >for now this is at least some way to control the call duration after it has<br>
> > >started.<br>> ><br>> > Hi Kaloyan,<br>> ><br>> > My idea is to put the real-time call control onto the the thread in<br>> channel.c that is already monitoring the bridge. You already nicely slotted in<br>
> the "recheck" thread into this main bridge thread with your patch by using the<br>> nexteventts property and I think I might be able to do call control I need on<br>> the bridge thread and remove the need for the "recheck" thread.<br>
> ><br>> > The problem with doing things on channel.c is it rightly doesn't know<br>> anything about applications, dialplans or specific channel properties. However<br>> the more I've played around with real-time call control the more I'm thinking<br>
> the main requirement is to have a clean scalable way to update the call time<br>> and not so much about being able to periodically call more involved<br>> applications on an in progress calls. For example my requirement would be<br>
> satisifed by having the bridge thread on channel.c send the accountcode, call<br>> destination and call time to an external IP socket and get back a single<br>> integer that specifies any adjustment that should be made to the call time.<br>
><br>> > Can't you do this via Manager? By leaving blank the LIMIT_RECHECK_APP, but<br>> > setting LIMIT_RECHECK_INTERVAL and LIMIT_RECHECK_DELAY you will get Manager<br>> > event and then you may have enough time (LIMIT_RECHECK_DELAY) to proces it<br>
and<br>> > to set CALL_LIMIT variable to that channel back from Manager. As you need the<br>> > acount code you will need to add it to the event field.<br>><br>> MAPI is an option but it would result in another moving part to be able to<br>
control calls and would still need the extra thread per bridged call to fire<br>the events. If the real-time call control mechanism was a request approach<br>from channel.c then there is need to use MAPI or any additional threads. The<br>
bridge thread in channel.c doesn't seem to be doing much at all, just waiting<br>for the call time limit to expire, so giving it an extra task would give<br>better utilisation of that thread.<br>><br>> Regards,<br>
><br>> Greyman.<br>><br>><br>____________________________________________________________________________________<br>Yahoo!7 Mail has just got even bigger and better with unlimited storage on all<br>webmail accounts.<br>
> <a href="http://au.docs.yahoo.com/mail/unlimitedstorage.html">http://au.docs.yahoo.com/mail/unlimitedstorage.html</a><br>><br>> _______________________________________________<br>> --Bandwidth and Colocation Provided by <a href="http://www.api-digital.com--">http://www.api-digital.com--</a><br>
><br>> asterisk-dev mailing list<br>> To UNSUBSCRIBE or update options visit:<br>> <a href="http://lists.digium.com/mailman/listinfo/asterisk-dev">http://lists.digium.com/mailman/listinfo/asterisk-dev</a><br>
><br>><br>> --<br>><br>> Best Regards<br>> Charles<br><br><br>_______________________________________________<br>--Bandwidth and Colocation Provided by <a href="http://www.api-digital.com--">http://www.api-digital.com--</a><br>
<br>asterisk-dev mailing list<br>To UNSUBSCRIBE or update options visit:<br> <a href="http://lists.digium.com/mailman/listinfo/asterisk-dev">http://lists.digium.com/mailman/listinfo/asterisk-dev</a><br></blockquote></div>
<br><br clear="all"><br>-- <br><br>Best Regards<br>Charles