;; ==========================
[general]
;; ==========================
context=serve_call
;context=maintenance
bindport=5060
bindaddr=0.0.0.0
srvlookup=yes
;;allow=all
disallow=all
;allow=g722
allow=ulaw
useragent=zenoradioCPE
dtmfmode=auto
reinvite=yes
sipdebug=no
nat=yes
allowguest=yes
maxexpiry=23000
#include "sip.include.amazon.conf" 


;; ==========================
;; RTP hack
;; ==========================
;;silenceSuppression=no	; Not sure, but silence supression will stop send rtp packages at silence, and can trigger timout if stream is silence too much. Remove increase data, but avoid false timeout 
rtpkeepalive = 7		; send keepalive rtp packages each 7 seconds. I think its better than silence supression to get a solid rtp and a lower timeout to quick notify system something goes wrong
rtpholdtimeout = 35		; Max number of seconds of inactivity before terminating a call on hold. Default 0 (no limit). (New in v1.2.x).
rtptimeout = 21			; Number of seconds, to wait for RTP traffic before classify the connection as discontinued. Default 0 (no RTP timeout). (New in v1.2.x).
;;
;; Q: Why is asterisk keeping channels up when "...Nobody there, continuing...". And what happened there? Won't Asterisk hangup when the user pulls the line out of the wall? Or when the user looses signal from his Accesspoint using a WLAN phone?
;; A: if the device looses network connectivity, there is a setting in sip.conf to specifically address this - 'rtptimeout'
;; ref: https://issues.asterisk.org/jira/browse/ASTERISK-7351?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
;;
;; ... I've added an option called "rtptimeout" which can be used to automatically
;; hangup the call if no RTP traffic is received within that number of seconds.
;; ... Further, if the ATA or phone puts us on hold, then explicitly they are no
;; longer sending RTP traffic, so the rtptimeout setting is ignored. However, an
;; alternative setting, rtpholdtimeout, can be specified  (it SHOULD be greater
;; than rtptimeout)
;; ref: http://www.voip-info.org/wiki/view/Asterisk+sip+rtptimeout
;; ==========================




;; ==========================
;; webrtc user
;; ==========================
[webrtc]
type=friend
secret=webrtc
host=dynamic
nat=yes
transport=udp,ws,wss
;; realm=54.198.5.221 ;; we need solve that puzzle. this need be automatic.
encryption=yes
avpf=yes
force_avp=yes
icesupport=yes
directmedia=no
dtlsenable=yes
dtlsverify=no
dtlscertfile   =/usr/local/zenoradio/cpe/asterisk/cert/wildcard.zenoradio.net.crt
dtlsprivatekey =/usr/local/zenoradio/cpe/asterisk/cert/wildcard.zenoradio.net.key
dtlscafile     =/usr/local/zenoradio/cpe/asterisk/cert/wildcard.zenoradio.net.bundle.networksolution.all.crt
dtlssetup=actpass






;; ==========================
;; webrtc highdef users
;; ==========================
[force_g722]
type=friend
secret=webrtc
host=dynamic
nat=yes
transport=udp,ws,wss
disallow=all
allow=g722
encryption=yes
avpf=yes
force_avp=yes
icesupport=yes
directmedia=no
dtlsenable=yes
dtlsverify=no
dtlscertfile   =/usr/local/zenoradio/cpe/asterisk/cert/wildcard.zenoradio.net.crt
dtlsprivatekey =/usr/local/zenoradio/cpe/asterisk/cert/wildcard.zenoradio.net.key
dtlscafile     =/usr/local/zenoradio/cpe/asterisk/cert/wildcard.zenoradio.net.bundle.networksolution.all.crt
dtlssetup=actpass

[force_g729]
type=friend
secret=webrtc
host=dynamic
nat=yes
transport=udp,ws,wss
disallow=all
allow=g729
encryption=yes
avpf=yes
force_avp=yes
icesupport=yes
directmedia=no
dtlsenable=yes
dtlsverify=no
dtlscertfile   =/usr/local/zenoradio/cpe/asterisk/cert/wildcard.zenoradio.net.crt
dtlsprivatekey =/usr/local/zenoradio/cpe/asterisk/cert/wildcard.zenoradio.net.key
dtlscafile     =/usr/local/zenoradio/cpe/asterisk/cert/wildcard.zenoradio.net.bundle.networksolution.all.crt
dtlssetup=actpass

[force_ulaw]
type=friend
secret=webrtc
host=dynamic
nat=yes
transport=udp,ws,wss
disallow=all
allow=ulaw
encryption=yes
avpf=yes
force_avp=yes
icesupport=yes
directmedia=no
dtlsenable=yes
dtlsverify=no
dtlscertfile   =/usr/local/zenoradio/cpe/asterisk/cert/wildcard.zenoradio.net.crt
dtlsprivatekey =/usr/local/zenoradio/cpe/asterisk/cert/wildcard.zenoradio.net.key
dtlscafile     =/usr/local/zenoradio/cpe/asterisk/cert/wildcard.zenoradio.net.bundle.networksolution.all.crt
dtlssetup=actpass

[force_ilbc]
type=friend
secret=webrtc
host=dynamic
nat=yes
transport=udp,ws,wss
disallow=all
allow=ilbc
encryption=yes
avpf=yes
force_avp=yes
icesupport=yes
directmedia=no
dtlsenable=yes
dtlsverify=no
dtlscertfile   =/usr/local/zenoradio/cpe/asterisk/cert/wildcard.zenoradio.net.crt
dtlsprivatekey =/usr/local/zenoradio/cpe/asterisk/cert/wildcard.zenoradio.net.key
dtlscafile     =/usr/local/zenoradio/cpe/asterisk/cert/wildcard.zenoradio.net.bundle.networksolution.all.crt
dtlssetup=actpass





;; ==========================
;; test user
;; ==========================
[1234567890]
type=friend
password=freetest
host=dynamic
nat=yes
