[Asterisk-Dev] Real time call control

Alex Smirnov ( DigitalXXI ) smirnov at digitalxxi.ru
Wed Oct 26 05:18:07 MST 2005


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