31.07.2015 Views

Download

Download

Download

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

338 Chapter 11 • Asterisk Hardware Ninjutsu# search for.my $device = "/dev/ttyS1"; # Serial device used.my $welcomefile = "welcome-serial";# This file is played at the# beginning of the call. It# explains that some form of# authentication is needed.my $grantedfile = "granted-serial"; # If authentication succeeds, we# play this and continue through# the extensions.conf.my $deniedfile = "denied-serial"; # If the authentication fails,# we'll play this.my $timeoutfile = "timeout-serial"; # If we don't see any action on the# serial port for $timeout seconds,# we play this file and hang up.my $errorfile = "error-serial"; # This is only played in the event# of a serial error.my $serial = Device::SerialPort->new ($device) ||die "Can't open serial port $device: $!";# These are the settings for the serial port. You'll probably want to alter# these to match whatever type of equipment you're using.$serial->baudrate(9600) ||die "Can't set baud rate";$serial->parity("none") ||die "Can't set parity";$serial->databits(8) ||die "Can't set data bits";$serial->stopbits(1) ||die "Can't set stop bits";

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!