Skip to content

Latest commit

 

History

History
2097 lines (1328 loc) · 63.9 KB

REFERENCE.md

File metadata and controls

2097 lines (1328 loc) · 63.9 KB

Reference

Table of Contents

Classes

Public Classes

  • asterisk: Install and configure an asterisk server.
  • asterisk::dahdi: Requirements for the asterisk dahdi module to work

Private Classes

  • asterisk::config: asterisk basic configuration files.
  • asterisk::install: Install packages that are necessary for an asterisk server.
  • asterisk::service: Ensure the Asterisk service is running.

Defined types

Public Defined types

Private Defined types

  • asterisk::dotd::file: Create a file inside a .d directory and set its permissions correctly.

Data types

Classes

asterisk

Install and configure an asterisk server.

Examples

simple install
class { 'asterisk': }

Parameters

The following parameters are available in the asterisk class:

manage_service

Data type: Boolean

Set this to false to avoid managing the asterisk service. By default puppet will enable the service and ensure that it is running.

manage_package

Data type: Boolean

Set this to false to avoid installing the asterisk package.

package_name

Data type: Variant[String, Array[String]]

Name or array of the package(s) being installed for asterisk.

service_name

Data type: String

Name of the asterisk service.

confdir

Data type: Stdlib::Absolutepath

Absolute path to the asterisk configuration directory.

purge_confdir

Data type: Boolean

Set this to true to enable autoremoval of configuration files that are not managed by puppet inside of asterisk's confdir.

iax_general

Data type: Hash

Global configurations for IAX2. Options are set in the file as key = value in the [general] section of iax.conf.

iax_contexts

Data type: Stdlib::CreateResources

Hash of resource_name => params used to instantiate asterisk::iax defined types.

iax_registries

Data type: Stdlib::CreateResources

Hash of resource_name => params used to instantiate asterisk::registry::iax defined types.

sip_general

Data type: Hash

Global configurations for SIP. Options are set in the file as key = value in the [general] section of the sip.conf file.

sip_peers

Data type: Stdlib::CreateResources

Hash of resource_name => params used to instantiate asterisk::sip defined types.

sip_registries

Data type: Stdlib::CreateResources

Hash of resource_name => params used to instantiate asterisk::registry::sip defined types.

voicemail_general

Data type: Hash

Global configurations for voicemail. Options are set in the file as key = value in the [general] section of the voicemail.conf file.

voicemails

Data type: Stdlib::CreateResources

Hash of resource_name => params used to instantiate asterisk::voicemail defined types.

extensions_general

Data type: Hash

Global configurations for the dialplan. Options are set in the file as key = value in the [general] section of the extensions.conf file.

extensions_globals

Data type: Asterisk::ExtGlobalVars

Hash of global variables for the dialplan, placed in the [globals] section of the extensions.conf file.

WARNING: If you load any other extension configuration engine, such as pbx_ael.so, your global variables may be overridden by that file. Please take care to use only one location to set global variables, and you will likely save yourself a ton of grief.

The variables defined here can be accessed throughout the dialplan with the GLOBAL() function. Global variables can make dialplans reusable by different servers with different use cases.

They also make dialplans easier to maintain by concentrating certain information in one location (e.g. to avoid having to modify the same value through many contexts and macros).

Global variables can also be used for hiding passwords from Asterisk logs, for example for register lines or calls to Dial() where information about the provider is combined with username and password: when using a global variable, the variable name will be shown in logs, not the actual password.

Variables are set in the file as key=value. If you pass in a Sensitive type as the value, it will be unwrapped for outputting in the configuration file: this can avoid showing certain sensitive information (as passwords) in puppet logs.

extension_contexts

Data type: Stdlib::CreateResources

Hash of resource_name => params used to instantiate asterisk::extension defined types.

agents_global

Data type: Hash

Global configurations for agents. Options are set in the file as key = value in the [agents] section of the agents.conf file.

agents

Data type: Stdlib::CreateResources

Hash of resource_name => params used to instantiate asterisk::agent defined types.

features_general

Data type: Asterisk::FeaturesGeneral

Global call features. Options are set in the file as key = value in the [general] section of features.conf.

features_featuremap

Data type: Asterisk::Featuremap

Global feature maps. Options are set in the file as key => value in the [featuremap] section of features.conf.

features_applicationmap

Data type: Hash[String,String]

Global application feature maps. Options are set in the file as key => value in the [applicationmap] section of features.conf.

features

Data type: Stdlib::CreateResources

Hash of resource_name => params used to instantiate asterisk::feature defined types.

logger_general

Data type: Hash[String,String]

Global configurations for asterisk logging. Options are set in the file as key=value in the [general] section of logger.conf.

log_files

Data type: Hash[String,Asterisk::Logfile]

A hash defining log files.

Top-level keys set log file names.

Log files can use the special names console or syslog to determine what output is sent to the asterisk CLI console and syslog, respectively.

All other top-level keys represent a file name. File names can be either relative to the asterisk.conf setting astlogdir or an absolute path.

Values associated to the top-level keys should be a hash that contains at least one key, levels. The value for levels should be an array listing logging levels for this log file.

As well as levels, there can be an optional key, formatter. Its value should be a string containing either default or json and it defines which format will be output to the log. If the formatter key is omitted, asterisk's default log format is used.

queues_general

Data type: Hash

Global configurations for queues. Options are set in the file as key => value in the [general] section of the queues.conf file.

queues

Data type: Stdlib::CreateResources

Hash of resource_name => params used to instantiate asterisk::queue defined types.

modules_autoload

Data type: Boolean

Set this to false to avoid having asterisk load modules automatically on an as-needed basis. This can be used to configure modules in a more restrictive manner.

modules_preload

Data type: Array[String]

List of modules that asterisk should load before asterisk core has been initialized. This can be useful if you wish to map all module configuration files into Realtime storage.

modules_noload

Data type: Array[String]

List of modules that asterisk should not load. This can be useful if modules_autoload is set to true.

modules_load

Data type: Array[String]

List of modules that asterisk should load on startup. This is useful if you've set modules_autoload to false.

modules_global

Data type: Hash

Global configurations for modules. Options are set in the file as key => value in the [global] section of the modules.conf file.

manager_enable

Data type: Boolean

Set this to false to disable asterisk manager.

manager_port

Data type: Integer

Port number on which asterisk will listen to for manager connections. Defaults to 5038.

manager_bindaddr

Data type: String

IP address to have asterisk bind to for manager connections. Defaults to binding to localhost.

manager_accounts

Data type: Stdlib::CreateResources

Hash of resource_name => params used to instantiate asterisk::manager defined types.

asterisk::dahdi

DAHDI (Digium/Asterisk Hardware Device Interface) lets you connect your Asterisk PBX to a card, Digium and some other models, that bridges calls with the POTS.

Defined types

asterisk::agent

Configure an asterisk agent

Examples

Basic agent
asterisk::agent { 'provocateur':
  ext        => '700',
  password   => Sensitive.new('supersecret'),
  agent_name => 'provocateur',
}

Parameters

The following parameters are available in the asterisk::agent defined type:

ext

Data type: String

Extension corresponding to the agent.

password

Data type: Sensitive[String]

Login password of the agent.

agent_name

Data type: String

Name by which the agent is referred to within dialplan.

ensure

Data type: Stdlib::Ensure::File::File

Can be set to absent to remove a given agent.

Default value: file

groups

Data type: Array[String[1]]

List of groups to which the agent is associated.

Default value: []

asterisk::extensions

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

The following parameters are available in the asterisk::extensions defined type:

ensure

Data type: Stdlib::Ensure::File::File

Set this to false to remove the corresponding configuration file.

Default value: file

source

Data type: Optional[Stdlib::Filesource]

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

Default value: undef

content

Data type: Optional[String]

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

Default value: undef

asterisk::feature

This resource will define an application map grouping. It can be used to set dynamic features with the DYNAMIC_FEATURES variable: instead of listing all of the application maps that need to be enabled in DYNAMIC_FEATURES, you can use the name of a group to enable them all.

To configure global features, see the features_general parameter to the main class, asterisk.

Examples

feature configuration
asterisk::feature { 'shifteight':
  options => {
    unpauseMonitor => '*1',
    pauseMonitor   => '*2',
  }
}

Parameters

The following parameters are available in the asterisk::feature defined type:

options

Data type: Hash

Hash of options with keys being option names and values their values.

ensure

Data type: Stdlib::Ensure::File::File

Set this to absent to remove the feature.

Default value: file

asterisk::iax

A context named after $name will be created. You can configure iax2 users, peers or the special context callnumberlimits that lets you override limits to call numbers per IP address range.

Parameters

The following parameters are available in the asterisk::iax defined type:

ensure

Data type: Stdlib::Ensure::File::File

Set this to absent to remove the configuration file.

Default value: file

source

Data type: Optional[Stdlib::Filesource]

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

Default value: undef

content

Data type: Optional[String]

Textual contents of the file being created. This option is mutually exclusive with $source. The content is placed after the name of the context (which is $name) and so it should not include the context name definition.

Default value: undef

asterisk::language

The name of the resource is the name of a language pack.

The language packs defined here were taken directly from packages available on debian and so this might not work for other distros.

Examples

installing two language packs
asterisk::language { ['de', 'es']: }

asterisk::manager

Configure an asterisk manager

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

The following parameters are available in the asterisk::manager defined type:

secret

Data type: Sensitive[String[1]]

Authentication password for the manager.

ensure

Data type: Stdlib::Ensure::File::File

Set to absent to remove the manager.

Default value: file

manager_name

Data type: String[1]

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

Default value: $name

deny

Data type: Array[String[1]]

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.

Default value: ['0.0.0.0/0.0.0.0']

permit

Data type: Array[String[1]]

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

Default value: ['127.0.0.1/255.255.255.255']

read

Data type: Array[Asterisk::ManagerPerms]

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

Default value: ['system', 'call']

write

Data type: Array[Asterisk::ManagerPerms]

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

Default value: ['system', 'call']

writetimeout

Data type: Integer

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

Default value: 100

displayconnects

Data type: Boolean

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

Default value: true

eventfilter

Data type: Optional[String]

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.

Default value: undef

asterisk::queue

This resource presents a multitude of options, corresponding to different options that can be configured for queues.

Examples

create a queue with 10 max callers and strategy random
asterisk::queue { 'shortq':
  stragegy => 'random',
  maxlen   => 10,
}

Parameters

The following parameters are available in the asterisk::queue defined type:

ensure

Data type: Stdlib::Ensure::File::File

Set this to absent in order to remove a queue.

Default value: file

strategy

Data type: Optional[String[1]]

Name of the queue strategy that determines which member phones are ringing when there is a call in the queue that needs answering. If this parameter is not defined, the strategy defaults to 'ringall'.

Default value: undef

context

Data type: Optional[String[1]]

Name of a dialplan context. Allows a caller to exit the queue by pressing a single DTMF digit. If a context is specified and the caller enters a number, that digit will attempt to be matched in the context specified, and dialplan execution will continue there.

Default value: undef

defaultrule

Data type: Optional[String[1]]

Associates a queue rule as defined in queuerules.conf to this queue, which is used to dynamically change the minimum and maximum penalties, which are then used to select an available agent.

Default value: undef

maxlen

Data type: Optional[Integer]

Maximum number of allowed callers in the queue. A value of 0 allows an unlimited number of callers in the queue. If unspecified, defaults to 0.

Default value: undef

musicclass

Data type: Optional[String[1]]

Name of a music class as defined in musiconhold.conf to be used for this particular queue. You can also override this value with the CHANNEL(musicclass) channel variable.

Default value: undef

servicelevel

Data type: Optional[String[1]]

Threshold in seconds for queue waiting time. This can be then used in statistics to determine the number of calls that have passed the servicelevel threshold.

Default value: undef

members

Data type: Array[String[1]]

List of static members of this queue. Each member should be specified a Technology/Device_ID.

Default value: []

memberdelay

Data type: Optional[Integer]

Optional number of seconds to add as delay before the caller and member get connected to each other.

Default value: undef

penaltymemberslimit

Data type: Optional[String[1]]

Optional lower bound to start disregarding penalty if number of members in the queue is lower than this number.

Default value: undef

membermacro

Data type: Optional[String[1]]

Name of a macro to be executed just prior to bridging the caller and the queue member.

Default value: undef

membergosub

Data type: Optional[String[1]]

If set, run this gosub when connected to the queue member you can override this gosub by setting the gosub option on the queue application

Default value: undef

setinterfacevar

Data type: Optional[String[1]]

If set to yes, the channel variables MEMBERINTERFACE, MEMBERNAME, MEMBERCALLS, MEMBERLASTCALL, MEMBERPENALTY, MEMBERDYNAMIC and MEMBERREALTIME will be set just prior to connecting the caller with the queue member.

Default value: undef

setqueuevar

Data type: Optional[String[1]]

If set to yes, the channel variables QUEUENAME, QUEUEMAX, QUEUESTRATEGY, QUEUECALLS, QUEUEHOLDTIME, QUEUECOMPLETED, QUEUEABANDONED, QUEUESRVLEVEL and QUEUESRVLEVELPERF will be set just prior to the call being bridged.

Default value: undef

setqueueentryvar

Data type: Optional[String[1]]

If set to yes, the channel variables QEHOLDTIME and QEORIGINALPOS will be set just prior to the call being bridged.

Default value: undef

weight

Data type: Optional[Integer]

The weight of a queue. A queue with a higher weight defined will get first priority when members are associated with multiple queues.

Default value: undef

reportholdtime

Data type: Optional[String[1]]

If set to yes, enables reporting of the caller’s hold time to the queue member prior to bridging.

Default value: undef

ringinuse

Data type: Optional[String[1]]

If set to no, avoid sending calls to members whose status is In Use. Only the SIP channel driver is currently able to accurately report this status.

Default value: undef

wrapuptime

Data type: Optional[Integer]

Number of seconds to keep a member unavailable in a queue after completing a call.

Default value: undef

timeout

Data type: Optional[Integer]

Number of seconds to ring a member’s device. Also see timeoutpriority.

Default value: undef

timeoutrestart

Data type: Optional[String[1]]

If set to yes, resets the timeout for an agent to answer if either a BUSY or CONGESTION status is received from the channel. This can be useful if the agent is allowed to reject or cancel a call.

Default value: undef

timeoutpriority

Data type: Optional[String[1]]

Define which value of timeout takes precedence in case of a conflict. Set to conf to have the value configured with timeout on this resource take precedence. Defaults to app, which means the timeout value from the Queue() application will take precedence.

Default value: undef

retry

Data type: Optional[String[1]]

Number of seconds to wait before attempting the next member in the queue if the timeout value is exhausted while attempting to ring a member of the queue.

Default value: undef

autopause

Data type: Optional[String[1]]

Set this to yes to enable the automatic pausing of members who fail to answer a call. A value of all causes this member to be paused in all queues they are a member of.

Default value: undef

joinempty

Data type: Array[String[1]]

Controls whether a caller is added to the queue when no members are available. Comma-separated options can be included to define how this option determines whether members are available. See reference Definitions of options to see what possible values this can take and what they mean.

Default value: []

leavewhenempty

Data type: Array[String[1]]

control whether callers are kicked out of the queue when members are no longer available to take calls. This can take values similar to joinempty.

Default value: []

eventwhencalled

Data type: Optional[String[1]]

If set to yes manager events AgentCalled, AgentDump, AgentConnect and AgentComplete will be sent to the Asterisk Manager Interface (AMI). If set to vars, all channel variables associated with the agent will also be sent to the AMI. Defaults to no.

Default value: undef

eventmemberstatus

Data type: Optional[String[1]]

If set to yes, the QueueMemberStatus event will be sent to AMI. Note that this may generate a lot of manager events.

Default value: undef

monitor_type

Data type: Optional[String[1]]

If set to MixMonitor, the MixMonitor() application will be used for recording calls within the queue. If not specified, the Monitor() application will be used instead. This setting applies specifically for this queue and overrides the general option with the same name.

Default value: undef

monitor_format

Data type: Array[String[1]]

File format to use when recording. If unspecified, calls will not be recorded.

Default value: []

autofill

Data type: Optional[String[1]]

If set to no, the queue application will attempt to deliver calls to agents in a serial manner. This means only one call is attempted to be distributed to agents at a time. Additional callers are not distributed to agents until that caller is connected to an agent. If set to yes, callers are distributed to available agents simultaneously. This value overrides the value from the general section for this particular queue.

Default value: undef

announce

Data type: Optional[String[1]]

Filename of an announcement played to the agent that answered the call, typically to let them know what queue the caller is coming from. Useful when the agent is in multiple queues, especially when set to auto-answer the queue.

Default value: undef

announce_frequency

Data type: Optional[Integer]

Number of seconds to wait for before we should announce the caller’s position and/or estimated hold time in the queue. Set this value to zero or let the parameter unspecified to disable.

Default value: undef

min_announce_frequency

Data type: Optional[Integer]

Minimum amount of time, in seconds, that must pass before we announce the caller’s position in the queue again. This is used when the caller’s position may change frequently, to prevent the caller hearing multiple updates in a short period of time.

Default value: undef

announce_holdtime

Data type: Optional[String[1]]

Set to yes to play the estimated hold time along with the periodic announcements. If set to once, the estimated hold time will be played only once. Defaults to no.

Default value: undef

announce_position

Data type: Optional[String[1]]

Set to yes to have periodic announcements always mention current position in the queue. If set to limit announcements will only mention the position in the queue if it is within the limit defined by announce_position_limit. If set to more, announcements will only mention the position in the queue if it is beyond the number in announce_position_limit. Defaults to no.

Default value: undef

announce_position_limit

Data type: Optional[Integer]

Position in the queue that represents a threshold for announcements if announce_position was set to limit or more.

Default value: undef

announce_round_seconds

Data type: Optional[Integer]

If set to a non-zero value, announcements will mention seconds as well, rounded to the value specified in this parameter.

Default value: undef

periodic_announce

Data type: Array[String[1]]

List of file names of periodic announcements to be played. Prompts are played in the order they are defined. If unset, defaults to queue-periodic-announce.

Default value: []

periodic_announce_frequency

Data type: Optional[Integer]

Time in seconds between periodic announcements to the caller.

Default value: undef

random_periodic_announce

Data type: Optional[String[1]]

If set to yes, will play the defined periodic announcements in a random order.

Default value: undef

relative_periodic_announce

Data type: Optional[String[1]]

If set to yes, the periodic_announce_frequency timer will start from when the end of the file being played back is reached, instead of from the beginning. Defaults to no.

Default value: undef

queue_youarenext

Data type: Optional[String]

Filename of a prompt to play when caller reaches first position in queue. If not defined, will play the default value (“You are now first in line”). If set to an empty value, the prompt will not be played at all.

Default value: undef

queue_thereare

Data type: Optional[String]

Filename of a prompt to play in announcements when mentioning how much people are before the caller. If not defined, will play the default value (“There are”). If set to an empty value, the prompt will not be played at all.

Default value: undef

queue_callswaiting

Data type: Optional[String]

Filename of a prompt to play in announcements after saying number of calls before caller. If not defined, will play the default value (“calls waiting”). If set to an empty value, the prompt will not be played at all.

Default value: undef

queue_holdtime

Data type: Optional[String]

Filename of a prompt to play when starting to announce estimated wait time. If not defined, will play the default value (“The current estimated hold time is”). If set to an empty value, the prompt will not be played at all.

Default value: undef

queue_minute

Data type: Optional[String]

Filename of a prompt to play after stating number of estimated minutes, if the number is 1. If not defined, will play the default value (“minute”). If set to an empty value, the prompt will not be played at all.

Default value: undef

queue_minutes

Data type: Optional[String]

Filename of a prompt. This is the same as queue_minute but for when the number of minutes is more than 1.

Default value: undef

queue_seconds

Data type: Optional[String]

Filename of a prompt to play after stating number of estimated seconds. If not defined, will play the default value (“seconds”). If set to an empty value, the prompt will not be played at all.

Default value: undef

queue_thankyou

Data type: Optional[String]

Filename of a prompt. If not defined, will play the default value (“Thank you for your patience”). If set to an empty value, the prompt will not be played at all.

Default value: undef

queue_reporthold

Data type: Optional[String]

Filename of a prompt. If not defined, will play the default value (“Hold time”). If set to an empty value, the prompt will not be played at all.

Default value: undef

asterisk::registry::iax

This makes it possible to register to an IAX2 peer for authenticated connections.

Parameters

The following parameters are available in the asterisk::registry::iax defined type:

server

Data type: Stdlib::Host

Hostname or IP address of the server to which Asterisk should register.

user

Data type: String[1]

User name used for authenticating with the distant server.

password

Data type: Sensitive[String[1]]

Password used for authenticating.

ensure

Data type: Stdlib::Ensure::File::File

Set to absent in order to remove the registry.

Default value: file

asterisk::registry::sip

This makes it possible to register to a SIP peer for authenticated connections.

Parameters

The following parameters are available in the asterisk::registry::sip defined type:

server

Data type: Stdlib::Host

Hostname or IP address of the server to which Asterisk should register.

user

Data type: String[1]

User id for the local server.

ensure

Data type: Stdlib::Ensure::File::File

Set to absent in order to remove the registry.

Default value: file

password

Data type: Optional[Sensitive[String[1]]]

Optional password used for authenticating. This is required if our peer does not match connections only on IP/port.

Default value: undef

authuser

Data type: Optional[String[1]]

Optional user name used for authenticating with the remote server. This is required if our peer does not match connections only on IP/port.

Default value: undef

port

Data type: Optional[Integer]

Numerical port with which a connection will be established to the remote server.

Default value: undef

extension

Data type: Optional[String[1]]

Extension that is used when calls are received from the remote server. When not set, extension will be 's'.

Default value: undef

asterisk::sip

Configure a SIP peer, a user or a template for the previous.

Examples

create sip peer of providerZ
asterisk::sip { 'providerZ':
  account_type => 'peer',
  disallow     => ['all'],
  allow        => ['ulaw'],
  host         => 'sip-host.local',
  secret       => Sensitive.new('callthisasecret'),
}

Parameters

The following parameters are available in the asterisk::sip defined type:

ensure

Data type: Stdlib::Ensure::File::File

Set this to absent in order to remove SIP configuration.

Default value: file

template_name

Data type: Optional[String[1]]

Set this to ! if you are creating a template. Set this to any name of a template section to inherit options from it.

Default value: undef

account_type

Data type: Optional[String[1]]

Define how calls are handled. Roughly, peer handles outbound and inbound calls matches calls by ip/port. user handles only inbound calls and matches calls by authname and secret. friend handles both inbound and outbound calls where inbound calls are matched by authname and secret (like a user) but outbound calls are matched by ip and port like a peer.

Default value: 'friend'

username

Data type: Optional[String[1]]

Deprecated option in asterisk. You probably want to use defaultuser instead.

Default value: undef

defaultuser

Data type: Optional[String[1]]

Authentication user name.

Default value: undef

secret

Data type: Optional[Sensitive[String[1]]]

Authentication secret for inbound connections.

Default value: undef

md5secret

Data type: Optional[String[1]]

MD5-Hash of <user>:==SIP_realm==:<secret> (can be used instead of secret). Default for authenticating to an Asterisk server when SIP realm is not explicitly declared is <user>:asterisk:<secret>.

Default value: undef

remotesecret

Data type: Optional[Sensitive[String[1]]]

Authentication secret for outbound connections. If this is not set, $secret is used for outbound connections.

Default value: undef

context

Data type: Optional[String[1]]

Name of the dialplan context that is used as starting point when an inbound call is received through this peer/user.

Default value: undef

canreinvite

Data type: Optional[String[1]]

Deprecated option in asterisk: was renamed to directmedia. Whether or not to issue a reinvite to the client unless really necessary. This is used to interoperate with some (buggy) hardware that crashes if we reinvite, such as the common Cisco ATA 186. Setting this to nonat will allow reinvite when local, deny reinvite when NAT. Finally setting this to update will use UPDATE instead of INVITE.

Default value: undef

directmedia

Data type: Optional[String[1]]

By default, Asterisk tries to re-invite media streams to an optimal path. If there's no reason for Asterisk to stay in the media path, the media will be redirected. This does not really work well in the case where Asterisk is outside and the clients are on the inside of a NAT. In that case, you want to set this parameter to nonat. nonat will allow media path redirection (reinvite) but only when the peer where the media is being sent is known to not be behind a NAT (as the RTP core can determine it based on the apparent IP address the media arrives from). If you set this parameter to update, Asterisk will use an UPDATE command instead of an INVITE command to redirect media. update can also be combined with nonat with the value nonat,update.

Default value: 'no'

directrtpsetup

Data type: Optional[Boolean]

Set this to true to enable the new experimental direct RTP setup. This sets up the call directly with media peer-2-peer without re-invites. Will not work for video and cases where the callee sends RTP payloads and fmtp headers in the 200 OK that does not match the callers INVITE. This will also fail if directmedia is enabled when the device is actually behind NAT.

Default value: true

directmediadeny

Data type: Array[String[1]]

List of CIDR prefixes (e.g. of the form prefix/number of bits for mask -- for example 172.16.0.0/16) that should be denied passing directmedia to other peers. You can use this if some of your phones are on IP addresses that can not reach each other directly. This way you can force RTP to always flow through asterisk in such cases. See also directmediapermit.

Default value: []

directmediapermit

Data type: Array[String[1]]

List of CIDR prefixes that should be allowed passing directmedia to other peers. See directmediadeny.

Default value: []

host

Data type: Optional[String[1]]

Set this to dynamic to require the device to register itself before authenticating. Set to a hostname or IP address to match only for this host or IP address.

Default value: 'dynamic'

insecure

Data type: Optional[String[1]]

If set to port, allow matching of peer by IP address without matching port number. If set to invite, do not require authentication of incoming INVITEs. If set to no, all connections will be authenticated regardless of port or IP address. Defaults to no.

Default value: 'no'

language

Data type: Optional[String[1]]

Language code to define prompts for this peer/user.

Default value: 'en'

nat

Data type: Optional[String[1]]

Use methods to bypass issues when a phone is behind a NAT. This setting is not useful for when the asterisk server is the one behind the NAT. Set this to yes to ignore the address information in the SIP and SDP headers. Set this to force_rport fore RFC 3581 behavior and disable symmetric RTP support. Set this to comedia to enable RFC 3581 behavior if the remote side requests it and enables symmetric RTP support.

Default value: undef

qualify

Data type: Optional[String[1]]

If set to yes, the check if client is reachable every qualifyfreq seconds (defaults to 60 seconds). If set to an integer number, corresponds to yes and defines the timeout in milliseconds after a check packet is sent: when the timeout is reached, a peer is considered offline. Valid only with type set to peer.

Default value: 'no'

vmexten

Data type: Optional[String[1]]

Name of dialplan extension to reach mailbox. When unspecified, defaults to asterisk. Valid only with type set to peer.

Default value: undef

callerid

Data type: Optional[String[1]]

Caller ID information used when nothing else is available. When unspecified, defaults to asterisk.

Default value: undef

call_limit

Data type: Optional[Integer]

Number of simultaneous calls through this user/peer.

Default value: undef

callgroup

Data type: Optional[String[1]]

Call groups for calls to this device.

Default value: undef

mailbox

Data type: Optional[String[1]]

Voicemail extension (for message waiting indications). Not valid for type set to user.

Default value: undef

pickupgroup

Data type: Optional[String[1]]

Group that can pickup fellow workers’ calls using *8 and the Pickup() application on the *8 extension.

Default value: undef

fromdomain

Data type: Optional[String[1]]

Default From: domain in SIP messages when acting as a SIP UAC (client).

Default value: undef

fromuser

Data type: Optional[String[1]]

User to put in from instead of $CALLERID(number) (overrides the callerid) when placing calls to a peer (another SIP proxy). Valid only with type set to peer.

Default value: undef

outboundproxy

Data type: Optional[String[1]]

SRV name (excluding the _sip._udp prefix), hostname, or IP address of the outbound SIP Proxy. Valid only with type set to peer.

Default value: undef

t38pt_udptl

Data type: Optional[String[1]]

Enable T.83 Fax support. Set to yes to enable T.38 with FEC error correction. Additionally, you can add comma-separated options: redundancy enables redundancy error correction. none disables error correction. maxdatagram=NN overrides the maximum datagram value to NN bytes (useful for some problematic cases like Cisco media gateways).

Default value: undef

disallow

Data type: Array[String[1]]

List of codecs to disallow for this peer/user. The list can contain all to disallow all known codecs. If set to all, codecs that are present in the allow list will override this setting, so this can be used to restrict to a narrow number of codecs.

Default value: []

allow

Data type: Array[String[1]]

List of codecs to allow for this peer/user. The list can contain all to allow all known codecs. If set to all, codecs in disallow will override this setting, so this can be used to blacklist only a narrow set of codecs.

Default value: []

dtmfmode

Data type: Optional[String[1]]

How the client handles DTMF signalling. Defaults to rfc2833. Warning: inband leads to very high CPU load.

Default value: undef

transports

Data type: Array[String[1]]

Accepted transport types for this peer/user. Can be udp, tcp or both with the order defining which is set as default (first value is default).

Default value: []

encryption

Data type: Optional[String]

Set to yes to offer SRTP encrypted media (and only SRTP encrypted media) on outgoing calls to a peer. Calls will fail with HANGUPCAUSE=58 if the peer does not support SRTP. Defaults to no.

Default value: undef

access

Data type: Array[Asterisk::Access]

List of permit/deny rules for CIDR prefixes like prefix/mask. Each element of the list should be a one element hash that specifies either 'permit' or 'deny' as a key and the CIDR prefix as its value. Order Matters! – Rules are placed in the configuration file in the same order as elements were inserted into the list. The last matching deny/permit rule is the one used. If no rule matches, then the connection is permitted.

Default value: []

trustrpid

Data type: Optional[Enum['yes', 'no']]

If a Remote-Party-ID SIP header should be sent. Defaults to no.

Default value: undef

sendrpid

Data type: Optional[Enum['yes', 'no', 'pai', 'rpid']]

If Remote-Party-ID SIP header should be trusted. Defaults to no.

Default value: undef

asterisk::voicemail

Configure a voicemail

Examples

voicemail with email address
asterisk::voicemail { 'taro':
  context  => 'support2',
  password => Sensitive.new('557722981749'),
  email    => '[email protected]',
}

Parameters

The following parameters are available in the asterisk::voicemail defined type:

context

Data type: String[1]

Name of the context in which the voicemail is assigned.

password

Data type: Sensitive[String[1]]

Authentication password set for accessing the voicemail. This is usually a series of numbers so that phones can dial the password, but it can be a textual password as well.

ensure

Data type: Stdlib::Ensure::File::File

Set to absent to remove the voicemail.

Default value: file

user_name

Data type: Optional[String[1]]

Name assigned to the voicemail, usually the name of the person using it.

Default value: undef

email

Data type: Optional[String[1]]

Email address to which voicemail message sounds will be sent.

Default value: undef

pager_email

Data type: Optional[String[1]]

Email address to which a page will be sent upon receiving a voicemail.

Default value: undef

options

Data type: Hash[String,String]

Hash containing options that are set for the voicemail. For example, a specific timezone can be set on individual voicemails with the 'tz' option. Options are set in the file as key = value.

Default value: {}

Data types

Asterisk::Access

A couple of configuration files let administrators configure accesses. They are usually order-dependent so one can interleave permit and deny lines to create complex permissions.

Alias of Hash[Enum['permit','deny'], String[1], 1, 1]

Asterisk::ExtGlobalVars

A hash of global variables for the dialplan

Alias of Hash[String, Variant[String,Sensitive]]

Asterisk::Featuremap

Those are the possible values that one could find in the [featuremap] section of features.conf.

Alias of

Struct[{
  Optional[blindxfer]  => String[1],
  Optional[disconnect] => String[1],
  Optional[automon]    => String[1],
  Optional[atxfer]     => String[1],
  Optional[parkcall]   => String[1],
  Optional[automixmon] => String[1],
}]

Asterisk::Featuresgeneral

Possible values for the [general] section of features.conf

Alias of

Struct[{
  Optional[parkext]               => String[1],
  Optional[parkpos]               => String[1],
  Optional[context]               => String[1],
  Optional[parkinghints]          => Enum['yes','no'],
  Optional[parkingtime]           => Integer,
  Optional[comebacktoorigin]      => Enum['yes','no'],
  Optional[courtesytone]          => String[1],
  Optional[parkedplay]            => Enum['callee','caller','both','no'],
  Optional[parkedcalltransfers]   => Enum['callee','caller','both','no'],
  Optional[parkedcallreparking]   => Enum['callee','caller','both','no'],
  Optional[parkedcallhangup]      => Enum['callee','caller','both','no'],
  Optional[parkedcallrecording]   => Enum['callee','caller','both','no'],
  Optional[parkeddynamic]         => Enum['yes','no'],
  Optional[adsipark]              => Enum['yes','no'],
  Optional[findslot]              => Enum['first','next'],
  Optional[parkedmusicclass]      => String[1],
  Optional[transferdigittimeout]  => Integer,
  Optional[xfersound]             => String[1],
  Optional[xferfailsound]         => String[1],
  Optional[pickupexten]           => String[1],
  Optional[pickupsound]           => String[1],
  Optional[pickupfailsound]       => String[1],
  Optional[featuredigittimeout]   => Integer,
  Optional[atxfernoanswertimeout] => Integer,
  Optional[atxferdropcall]        => Enum['yes','no'],
  Optional[atxferloopdelay]       => Integer,
  Optional[atxfercallbackretries] => Integer,
}]

Asterisk::Logfile

Options that can be set for a log file

Alias of

Struct[{
  Optional[formatter] => Enum['default','json'],
  levels => Array[
            Variant[
              Enum['debug','notice','warning','error','dtmf','fax','security','verbose'],
              Pattern[/^verbose\([1-9]\d*\)$/]]
            ,1],
}]

Asterisk::ManagerPerms

Possible permissions given to AMI users

Alias of Enum['all', 'system', 'call', 'log', 'verbose', 'agent', 'user', 'config', 'command', 'dtmf', 'reporting', 'cdr', 'dialplan', 'originate', 'agi', 'cc', 'aoc']