File Coverage

lib/Asterisk/Conf/IAX.pm
Criterion Covered Total %
statement 18 18 100.0
branch n/a
condition 1 3 33.3
subroutine 3 3 100.0
pod 0 1 0.0
total 22 25 88.0


line stmt bran cond sub pod time code
1             package Asterisk::Conf::IAX;
2              
3             require 5.004;
4              
5             =head1 NAME
6              
7             Asterisk::Config::IAX - IAX configuration stuff
8              
9             =head1 SYNOPSIS
10              
11             stuff goes here
12              
13             =head1 DESCRIPTION
14              
15             description
16              
17             =over 4
18              
19             =cut
20              
21 1     1   566 use Asterisk;
  1         2  
  1         19  
22 1     1   280 use Asterisk::Conf;
  1         1  
  1         207  
23             @ISA = ('Asterisk::Conf');
24              
25             $VERSION = '0.01';
26              
27             $DEBUG = 5;
28              
29             sub new {
30 1     1 0 281 my ($class, %args) = @_;
31 1         2 my $self = {};
32 1         2 $self->{'name'} = 'IAX';
33 1         1 $self->{'description'} = 'IAX Channel Driver Configuration';
34 1         1 $self->{'configfile'} = '/etc/asterisk/iax.conf';
35 1         2 $self->{'config'} = {};
36 1         1 $self->{'configtemp'} = {};
37 1         1 $self->{'contextorder'} = ( 'general' );
38 1         2 $self->{'channelgroup'} = {};
39              
40 1         18 $self->{'variables'} = {
41             #this stuff can only be in general context
42              
43             #need to put together some list of codecs somewhere
44             'allow' => { 'default' => 'gsm', 'type' => 'multitext', 'contextregex' => '^general$' },
45             'disallow' => { 'default' => 'lpc10', 'type' => 'multitext', 'contextregex' => '^general$' },
46             'bindaddr' => { 'default' => undef, 'type' => 'text', 'regex' => '^\w*$', 'contextregex' => '^general$' },
47             'bandwidth' => { 'default' => 'low', 'type' => 'one', 'values' => [ 'low', 'medium', 'high' ], 'contextregex' => '^general$' },
48             'jitterbuffer' => { 'default' => 'yes', 'type' => 'one', 'values' => [ 'yes', 'no' ], 'contextregex' => '^general$' },
49             'dropcount' => { 'default' => '3', 'type' => 'text', 'regex' => '^\d*$', 'contextregex' => '^general$' },
50              
51             'permit' => { 'default' => undef, 'type' => 'multitext' },
52             'deny' => { 'default' => undef, 'type' => 'multitext', 'negcontextregex' => '^general$' },
53             'context' => { 'default' => 'default', 'type' => 'multitext' },
54             'port' => { 'default' => undef, 'type' => 'text', 'regex' => '^\d*$' },
55             'type' => { 'default' => 'user', 'type' => 'one', 'values' => [ 'user', 'peer', 'friend'] },
56             'context' => { 'default' => 'default', 'type' => 'multitext' },
57             'secret' => { 'default' => undef, 'type' => 'text', 'regex' => '^\w*$', 'negcontextregex' => '^general$' },
58             'username' => { 'default' => undef, 'type' => 'text', 'regex' => '^\w*$', 'negcontextregex' => '^general$' },
59            
60              
61              
62             };
63              
64              
65 1   33     6 bless $self, ref $class || $class;
66 1         2 return $self;
67             }
68              
69              
70             1;