Asterisk
0
Вклад в тег
context Incoming {
_X. => {
Answer();
Ringing();
Wait(2);
agi(incoming.agi,${CALLERID(num)},${EXTEN});
};
#!/usr/bin/env perl
use Asterisk::AGI;
my $AGI = new Asterisk::AGI;
$|=1;
my ($callerid, $exten) = @ARGV;
print STDOUT "SET MUSIC ON HOLD DEFAULT\n" # Запускаем музочку
while(1){
$AGI->exec("Dial","SIP/1001,15,Ttgm");
my $availstat1 = $AGI->get_variable('DIALSTATUS');
$AGI->exec("Dial","SIP/1002,15,Ttgm");
my $availstat2 = $AGI->get_variable('DIALSTATUS');
$AGI->exec("Wait","7");
$AGI->exec("Background","message_try_again");
print STDOUT "SET MUSIC ON HOLD DEFAULT\n";
};
print STDOUT "SET MUSIC ON HOLD OFF\n";