Defined Type: asterisk::manager

Defined in:
manifests/manager.pp

Summary

Configure an asterisk manager

Overview

Examples:

manager with default authorizations that can connect from LAN.

asterisk::manager { 'sophie':
  secret => Sensitive.new('youllneverguesswhatitis'),
  permit => ['192.168.120.0/255.255.255.0'],
}

Parameters:

  • secret (Sensitive[String[1]])

    Authentication password for the manager.

  • ensure (Any) (defaults to: present)

    Set to absent to remove the manager.

  • manager_name (String[1]) (defaults to: $name)

    Can be used to override the name of the manager. By default the name of the manager corresponds to $name.

  • deny (Array[String[1]]) (defaults to: ['0.0.0.0/0.0.0.0'])

    List of IP specifications that are denied access to the manager. Denied IPs can be overridden by $permit. This makes it possible to only permit access to some IP addresses. Default value is to deny access to everybody.

  • permit (Array[String[1]]) (defaults to: ['127.0.0.1/255.255.255.255'])

    List of IP specifications that are permitted access to the manager. Defaults to premitting only localhost.

  • read (Array[Asterisk::ManagerPerms]) (defaults to: ['system', 'call'])

    List of authorizations given to the manager to read certain information or configuration. Defaults to system and call.

  • write (Array[Asterisk::ManagerPerms]) (defaults to: ['system', 'call'])

    List of authorizations given to the manager to write (change) certain information or configuration. Defaults to system and call.

  • writetimeout (Integer) (defaults to: 100)

    Timeout in milliseconds used by Asterisk when writing data to the AMI connection for this user.

  • displayconnects (Boolean) (defaults to: true)

    Set this to no to avoid reporting connections to the AMI as verbose messages printed to the Asterisk console.

  • eventfilter (Optional[String]) (defaults to: undef)

    Whitelist- or blacklist-style filtering of manager events before they are delivered to the AMI client application. Filters are specified using a regular expression. A specified filter is a whitelist filter unless preceded by an exclamation point.

See Also:



44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'manifests/manager.pp', line 44

define asterisk::manager (
  Sensitive[String[1]]          $secret,
  $ensure                                        = present,
  String[1]                     $manager_name    = $name,
  Array[String[1]]              $deny            = ['0.0.0.0/0.0.0.0'],
  Array[String[1]]              $permit          = ['127.0.0.1/255.255.255.255'],
  Array[Asterisk::ManagerPerms] $read            = ['system', 'call'],
  Array[Asterisk::ManagerPerms] $write           = ['system', 'call'],
  Integer                       $writetimeout    = 100,
  Boolean                       $displayconnects = true,
  Optional[String]              $eventfilter     = undef,
) {

  $wo_rights = ['config','command','originate']
  $wo_rights.each |String $right| {
    if $right in $read {
      fail("write-only right '${right}' given to the \$read parameter")
    }
  }

  $ro_rights = ['log','verbose','dtmf','cdr','dialplan','cc']
  $ro_rights.each |String $right| {
    if $right in $write {
      fail("read-only right '${right}' given to the \$write parameter")
    }
  }

  $real_displayconnects = bool2str($displayconnects, 'yes', 'no')

  asterisk::dotd::file { "manager_${name}.conf":
    ensure   => $ensure,
    dotd_dir => 'manager.d',
    content  => template('asterisk/snippet/manager.erb'),
    filename => "${name}.conf",
  }

}