Defined Type: asterisk::extensions

Defined in:
manifests/extensions.pp

Summary

Configure a dialplan context and extensions within that context

Overview

This can be used to configure your different contexts with extensions, but it can also be used to create macros that can be called in other contexts.

Examples:

basic context with one extension

asterisk::extensions { 'basic':
  content => 'exten => 666,1,Hangup()',
}

Parameters:

  • ensure (Any) (defaults to: present)

    Set this to false to remove the corresponding configuration file.

  • source (Any) (defaults to: undef)

    Puppet file source where the contents of the file can be found.

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

    Textual contents of the file. This option is mutually exclusive with $source.

See Also:



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'manifests/extensions.pp', line 22

define asterisk::extensions (
  $ensure  = present,
  $source  = undef,
  # Only enforcing type for this param since we're using its value
  Optional[String] $content = undef
) {

  if $content !~ Undef {
    $real_content = "[${name}]\n${content}"
  }
  else {
    $real_content = $content
  }

  asterisk::dotd::file { "extensions_${name}.conf":
    ensure   => $ensure,
    dotd_dir => 'extensions.d',
    source   => $source,
    content  => $real_content,
    filename => "${name}.conf",
  }

}