All pastes #17475 Raw Edit

Someone

public text v1 · immutable
#17475 ·published 2005-07-11 20:12 UTC
rendered paste body
#!/usr/bin/perl -w
use strict;

use Asterisk::AGI;

my $agi = new Asterisk::AGI;
my %in = $agi->ReadParse();

my $position = int(rand(5)) + 5;

while(1) {
  $agi->stream_file('you-are-curr-call-num') < 0 && last;
  $agi->say_number($position) < 0 && last;
  $agi->stream_file('in-the-line') < 0 && last;
  $agi->stream_file('pls-stay-on-line') < 0 && last;
  $agi->exec('WaitMusicOnHold', '30') < 0 &&  last;

  $position += int(rand(5));
}