After endless hours of fiddling around, I finally got my asterisk configuration for Deutsche Glasfaser to work, which I would like to share with you.
The following variables are to be defined, which need to be replaced in the config files:
$UID$ = the userid from deutsche glasfaser subscription letter (ie. 30509922754)
$PWD$ = the password from deutsche glasfaser (ie.fwk8T8QI)
$TELNUM$ = your arecode+telnum (ie. 021196982374)
$INTTELNUM$ = your telnumber international (ie. +4921196982374)
The configuration also includes one extension line to which you can subscribe with a hard/soft-phone
pjsip.conf:
[global]
type=global
user_agent=Asterisk PBX
endpoint_identifier_order=ip,username
default_from_user=$TELNUM$
[transport-udp]
type=transport
protocol=udp
bind=0.0.0.0
local_net=192.168.1.0/24 ;<--- replace this with your local net
[transport-tcp]
type=transport
protocol=tcp
bind=0.0.0.0
local_net=192.168.1.0/24 ;<---- replace with your local net
;----------------------------------------------------------------------
[dg_reg]
type=registration
transport=transport-udp
outbound_auth=dg_auth
server_uri=sip:dg.voip.dg-w.de
client_uri=sip:[email protected]
contact_user=$TELNUM$
retry_interval=60
forbidden_retry_interval=300
expiration=480
auth_rejection_permanent=false
[dg_auth]
type=auth
auth_type=userpass
password=$pwd$
username=$UID$
realm=*
;------------------------------------------------------------------------
[dg_aors]
type=aor
contact=sip:[email protected]:5060
[dg_out]
type=endpoint
transport=transport-udp
context=default
disallow=all
allow=ulaw,alaw,g722
outbound_auth=dg_auth
outbound_proxy=sip:dg.voip.dg-w.de
aors=dg_aors
callerid=$TELNUM$
from_user=$TELNUM$
from_domain=dg.voip.dg-w.de
[dg_identify]
type=identify
endpoint=dg_out
match=185.0.0.0/8
;-------------------------------------------------------------------------
[6001]
type=endpoint
transport=transport-udp
context=internalsip
disallow=all
allow=ulaw
allow=gsm
auth=6001
aors=6001
aggregate_mwi=yes
;mailboxes=6001@default,7001@default
mwi_from_user=6001
device_state_busy_at=1
allow_subscribe=yes
sub_min_expiry=30
[6001]
type=auth
auth_type=userpass
password=6005
username=6007
[6001]
type=aor
max_contacts=1
contact=sip:[email protected]:5060 ;<---- local ip of your asterisk instance
remove_existing=yes
extensions.conf
[default]
exten =>021315240144,n,Dial(PJSIP/6001)
exten =>021315240144,n,Hangup
; dieser Context sollte aus Sicherheitsgründen leer bleiben
[internalsip]
exten => _X.,1,Set(CALLERID(num)=$TELNUM$)
exten => _X.,2,Set(CALLERID(name)=$TELNUM$)
exten => _X.,3,SipAddHeader(P-Preferred-Identity: <sip:[email protected]>)
exten=> _X.,4,Dial(PJSIP/${EXTEN}@dg_out)
exten => _X.,5,Hangup