Defined Type: asterisk::registry::sip

Defined in:
manifests/registry/sip.pp

Summary

Configure a SIP registry

Overview

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

Parameters:

  • server (Stdlib::Host)

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

  • user (String[1])

    User id for the local server.

  • ensure (Any) (defaults to: present)

    Set to absent in order to remove the registry.

  • password (Optional[Sensitive[String[1]]]) (defaults to: undef)

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

  • authuser (Optional[String[1]]) (defaults to: undef)

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

  • port (Optional[Integer]) (defaults to: undef)

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

  • extension (Optional[String[1]]) (defaults to: undef)

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



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'manifests/registry/sip.pp', line 25

define asterisk::registry::sip (
  Stdlib::Host                   $server,
  String[1]                      $user,
  $ensure                                   = present,
  Optional[Sensitive[String[1]]] $password  = undef,
  Optional[String[1]]            $authuser  = undef,
  Optional[Integer]              $port      = undef,
  Optional[String[1]]            $extension = undef
) {

  if $password =~ Undef and $authuser !~ Undef {
    fail('authuser was specified but no value was given for password. You need both to authenticate.')
  }

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

}