Table of Contents

sip.conf

Sekce:

Pořadí v jakém asterisk načítá parametry:

  1. Sekce konkrétního kanálu
  2. Šablona sekce
  3. Sekce [general]
  4. Defaultní nastavení

Příklad konfigurace:

[general]
context=unauthenticated     ;default context for incoming calls
allowguest=no               ;disable unauthenticated calls
srvlookup=yes               ;enabled DNS SRV record lookup on outbound calls
udpbindaddr=0.0.0.0         ;listen for UDP requests on all interfaces
tcpenable=no                ;disable TCP support

[office-phone](!)           ;create a template for our devices
type=friend                 ;the channel driver will match on username first, IP second
context=LocalSets           ;this is where calls from the device will enter the dialplan
host=dynamic                ;the device will register with asterisk
nat=yes                     ;assume device is behind NAT
secret=s3CuR#p@s5           ;a secure password for this device
dtmfmode=auto               ;accept touch-tones from the devices, negotiated automatically
disallow=all                ;reset which voice codecs this device will accept or offer
allow=ulaw                  ;which audio codecs to accept from, and request to, the device
allow=alaw                  ;in the order we prefer


; define a device name and use the office-phone template
[0000FFFF0001](office-phone)

; define another device name using the same template
[0000FFFF0002](office-phone)

[general]

[šablona](!) nebo [kanál]

:!: Pozor některé hodnoty šablony lze v kanálu bez problému přepsat, kromě type,allow,disallow!

Vztah se souborem extensions.conf

Aplikace změn:

$ sudo asterisk -r
*CLI> module reload chan_sip.so

nebo

*CLI> sip reload
*CLI> sip show peers
*CLI> sip show peers
Name/username              Host            Dyn Nat ACL Port     Status
0000FFFF0001/0000FFFF0001    192.168.1.100    D   N      5060     Unmonitored
0000FFFF0002/0000FFFF0002    192.168.1.101    D   N      5060     Unmonitored

;Status - Unmonitored, znamená, že jsme nepoužili v konfiguraci direktivu qualify=yes
*CLI> sip show users

Registrace vs. Autentikace