5 $AGI = new Asterisk::AGI;
8 my @trusted=("1112223333","2223334444");
9 my $size= scalar @trusted;
14 if ($callerid eq $trusted[$size]) {
20 $AGI->exec('Festival', '"Please. Enter. the. source. number"');
22 my %input = $AGI->ReadParse();
27 my $input = chr($AGI->wait_for_digit('5000'));
28 if ($input =~ /^[0-9\*\#]$/) {
29 if ($input =~ /^[\*\#]$/) {
41 if ( length($code) > 10) {
46 $AGI->exec('Festival', '"Please. Enter. the. destination. number"');
47 `echo "$code">/tmp/code`;
50 `echo "here">/tmp/code`;
52 my $input = chr($AGI->wait_for_digit('5000'));
53 if ($input =~ /^[0-9\*\#]$/) {
54 if ($input =~ /^[\*\#]$/) {
66 if ( length($code2) > 10) {
71 $AGI->setcallback(\&callback);
73 $AGI->exec('Festival', '"I will now dial "');
74 $AGI->exec('Festival', $code2);
75 $AGI->exec('Festival', '"with"');
76 $AGI->exec('Festival', $code);
77 #Your IAX/SIP dialing instruction go here... For Example:
78 #$code2="IAX2/1234\@iax2provider/$code2";
79 #$code2="SIP/$code2\@sipprovider";
81 $AGI->set_callerid($code);
82 $AGI->exec('Dial', $code2);
84 $AGI->exec('Festival', '"Unauthorized. Attempt logged."');
88 warn "The call has ended\n";
89 set_context($context);