[Asterisk-Dev] Real time call control

Kaloyan Kovachev kkovachev at varna.net
Thu Oct 27 23:59:23 MST 2005


Hi,
 i was trying to do the same (calling card too) and here are the ideas:
  1. external application (via manager interface) to check the call status (to
get the call duration) every X seconds and to terminate the call with hangup
(verry limited, but that's what I'm plannig to do for now)
  2. it would be beter if the macro (Dial with M() option) is executed in
res_features.c (ast_bridge_call) so we can change in the macro the x parameter
for L(x,y,z) (and others) passed from Dial(). This would keep the posibility
to play some massage to the caller. This will require an additional parameter
to M() in order to have it repeated each X seconds, but probably should start
in separate thread not to interupt the call.

As web developer (not C programmer) i can only do 1 with some script, but will
be happy to have the second option implemented.

>Hi,
>
>i did also tried this for myself (for the calling card applications) -
>and didn't find a real working solution - so, if you find something, can
>you then please contact me ?
>
>regards,
>Wolfgang
>
>Am Mittwoch, den 26.10.2005, 16:18 +0400 schrieb Alex Smirnov
>( DigitalXXI ):
>> Greetings to community
>>
>> some info:
>> ---------------------------------------------------
>> [root at sipsrv asterisk]# asterisk -V
>> Asterisk CVS HEAD
>> ---------------------------------------------------
>> extensions.conf
>>
>> [macro-test]
>> exten => s,1,Agi(macr.agi|${ARG1})
>> [test]
>> exten => 999,1,DIAL(OUT_CHAN,,M(test^${CHANNEL}))
>> exten => 999,2,Hangup
>> ---------------------------------------------------
>> macr.agi
>> #!/usr/bin/perl
>>
>> use Asterisk::AGI;
>>
>> $AGI = new Asterisk::AGI;
>> my %input = $AGI->ReadParse();
>>
>> $i=0;
>>
>> while (30 > $i ) {
>>     open(FL,">>/var/tmp/debug.log");
>>     $agichan = $AGI->get_variable("CHANNEL");
>>     $realchan = $ARGV[0];
>>     $statorig = $AGI->channel_status($realchan);
>>     $statreal = $AGI->channel_status($agichan);
>>     print FL "Now [".$i."] - Agi Status = [".$statorig."] - Real Status
[".$statreal."]\n";
>>     $i++;
>>     close(FL);
>>     sleep(1);
>> }
>>
>> ---------------------------------------------------
>>
>>  1) in my example i cant catch ( see )  hangup from any side ( manager int, agi
>>     , ast cli )
>>  2) status of agi chan - always 6 and status of real chan - always 4
>>
>>
>> i need to control call duration by myself in real time ,
>> i cant use Dial with time limit
>>
>> so here is the QUESTION :) - any hints/ideas - how to control channel
>> after connection ( and o'coz possibility to clearly hang it ) ???
>>
>> Best Thx/Rgs
>>             Alex Smirnov 




More information about the asterisk-dev mailing list