;===============ENDPOINT SECTION OPTIONS==============================
;[endpoint]
;identify_by=ip

;===============TRANSPORTS============================================

;
; UDP transport
;
;[transport-udp]
;type=transport
;protocol=udp    ;udp,tcp,tls,ws,wss
;bind=0.0.0.0:5060

[transport-udp-192-168-20-42]
type=transport
protocol=udp
bind=192.168.20.42:5060

[transport-udp-20-42]
type=transport
protocol=udp
bind=10.5.20.42:5060

[transport-udp-20-52]
type=transport
protocol=udp
bind=10.5.20.52:5060

[transport-udp-20-62]
type=transport
protocol=udp
bind=10.5.20.62:5060

[transport-udp-20-72]
type=transport
protocol=udp
bind=10.5.20.72:5060

;===============ENDPOINT CONFIGURED AS A TRUNK, OUTBOUND AUTHENTICATION=======

;
; SIP trunk to Swisscom from IP .42
;
;Gateway Adressen Swisscom: 
;IP Adressen
;ESIP-Cluster "1": X.X.X.135
;ESIP-Cluster "2": X.X.X.165
;Ports:
;SIP Signaling:   UDP  5060
;RTP:             UDP  16384  - 65535 

[pjsip-swisscom-1]
type=endpoint
transport=transport-udp-20-42
context=from-pjsip-swisscom
disallow=all
allow=alaw,gsm
;allow=alaw,ulaw,gsm,g722,g723,opus,vp8,h263p
aors=swisscom-aor-1
dtmf_mode=rfc4733
direct_media=no		; Determines whether media may flow directly between endpoints (default: "yes")
rtp_symmetric=yes		; Send media to the address and port from which Asterisk receives it, regardless of where SDP indicates that it should be sent
;force_rport=yes		; Send responses to the source IP address and port as though port were present, even if it's not
;rewrite_contact=yes		; Rewrite SIP Contact to the source address and port of the request so that subsequent requests go to that address and port (necessary if endpoint does not know/register public ip:port)
timers=yes			; Session timers for SIP packets (default: "yes")
timers_min_se=360		; Minimum session timers expiration period (default: "90")
timers_sess_expires=1800	; Maximum session timer expiration period (default: "1800")
;rtp_keepalive=		; Interval, in seconds, between comfort noise RTP packets if RTP is not flowing. This setting is useful for ensuring that holes in NATs and firewalls are kept open throughout a call
;rtp_timeout=			; Hang up channel if RTP is not received for the specified number of seconds when the channel is off hold (default: "0" or not enabled)
;rtp_timeout_hold=		; Hang up channel if RTP is not received for the specified number of seconds when the channel is on hold (default: "0" or not enabled)

[swisscom-ide-1]
type=identify
endpoint=pjsip-swisscom-1
match=X.X.X.135
;match_header=To: /@10\\.5\\.20\\.42/

[swisscom-aor-1]
type=aor
max_contacts=1
contact=sip:X.X.X.135
qualify_frequency=60

[pjsip-swisscom-2]
type=endpoint
transport=transport-udp-20-42
context=from-pjsip-swisscom
disallow=all
allow=alaw,gsm
aors=swisscom-aor-2
dtmf_mode=rfc4733
direct_media=no
rtp_symmetric=yes
timers=yes
timers_min_se=360
timers_sess_expires=1800

[swisscom-ide-2]
type=identify
endpoint=pjsip-swisscom-2
match=X.X.X.165
;match_header=To: /@10\\.5\\.20\\.42/

[swisscom-aor-2]
type=aor
max_contacts=1
contact=sip:X.X.X.165
qualify_frequency=60

; --------------------------------------

[pjsip-swisscom-3]
type=endpoint
transport=transport-udp-20-52
context=from-pjsip-swisscom
disallow=all
allow=alaw,gsm
aors=swisscom-aor-3
dtmf_mode=rfc4733
direct_media=no
rtp_symmetric=yes
timers=yes
timers_min_se=360
timers_sess_expires=1800

[swisscom-ide-3]
type=identify
endpoint=pjsip-swisscom-3
match=X.X.X.135
;match_header=To: /@10\\.5\\.20\\.52/

[swisscom-aor-3]
type=aor
max_contacts=1
contact=sip:X.X.X.135
qualify_frequency=60

[pjsip-swisscom-4]
type=endpoint
transport=transport-udp-20-52
context=from-pjsip-swisscom
disallow=all
allow=alaw,gsm
aors=swisscom-aor-4
dtmf_mode=rfc4733
direct_media=no
rtp_symmetric=yes
timers=yes
timers_min_se=360
timers_sess_expires=1800

[swisscom-ide-4]
type=identify
endpoint=pjsip-swisscom-4
match=X.X.X.165
;match_header=To: /@10\\.5\\.20\\.52/

[swisscom-aor-4]
type=aor
max_contacts=1
contact=sip:X.X.X.165
qualify_frequency=60

; --------------------------------------

[pjsip-swisscom-5]
type=endpoint
transport=transport-udp-20-62
context=from-pjsip-swisscom
disallow=all
allow=alaw,gsm
aors=swisscom-aor-5
dtmf_mode=rfc4733
direct_media=no
rtp_symmetric=yes
timers=yes
timers_min_se=360
timers_sess_expires=1800

[swisscom-ide-5]
type=identify
endpoint=pjsip-swisscom-5
match=X.X.X.135
;match_header=To: /@10\\.5\\.20\\.62/

[swisscom-aor-5]
type=aor
max_contacts=1
contact=sip:X.X.X.135
qualify_frequency=60

[pjsip-swisscom-6]
type=endpoint
transport=transport-udp-20-62
context=from-pjsip-swisscom
disallow=all
allow=alaw,gsm
aors=swisscom-aor-6
dtmf_mode=rfc4733
direct_media=no
rtp_symmetric=yes
timers=yes
timers_min_se=360
timers_sess_expires=1800

[swisscom-ide-6]
type=identify
endpoint=pjsip-swisscom-6
match=X.X.X.165
;match_header=To: /@10\\.5\\.20\\.62/

[swisscom-aor-6]
type=aor
max_contacts=1
contact=sip:X.X.X.165
qualify_frequency=60

; --------------------------------------

[pjsip-swisscom-7]
type=endpoint
transport=transport-udp-20-72
context=from-pjsip-swisscom
disallow=all
allow=alaw,gsm
aors=swisscom-aor-7
dtmf_mode=rfc4733
direct_media=no
rtp_symmetric=yes
timers=yes
timers_min_se=360
timers_sess_expires=1800

[swisscom-ide-7]
type=identify
endpoint=pjsip-swisscom-7
match=X.X.X.135
;match_header=To: /@10\\.5\\.20\\.72/

[swisscom-aor-7]
type=aor
max_contacts=1
contact=sip:X.X.X.135
qualify_frequency=60

[pjsip-swisscom-8]
type=endpoint
transport=transport-udp-20-72
context=from-pjsip-swisscom
disallow=all
allow=alaw,gsm
aors=swisscom-aor-8
dtmf_mode=rfc4733
direct_media=no
rtp_symmetric=yes
timers=yes
timers_min_se=360
timers_sess_expires=1800

[swisscom-ide-8]
type=identify
endpoint=pjsip-swisscom-8
match=X.X.X.165
;match_header=To: /@10\\.5\\.20\\.72/

[swisscom-aor-8]
type=aor
max_contacts=1
contact=sip:X.X.X.165
qualify_frequency=60

; ------------------------

; SIP trunk to Doing's local Brekeke SIP Server

[pjsip-brekeke]
type=endpoint
transport=transport-udp-192-168-20-42
context=from-pjsip-brekeke
disallow=all
allow=alaw,ulaw,gsm
aors=brekeke-aor
dtmf_mode=rfc4733
direct_media=no
rtp_symmetric=yes
timers=yes
timers_min_se=360
timers_sess_expires=1800

[brekeke-ide]
type=identify
endpoint=pjsip-brekeke
match=10.0.20.6

[brekeke-aor]
type=aor
max_contacts=1
contact=sip:10.0.20.6
qualify_frequency=60
