SIP-trunk via TCP & outbound proxy not working

Hey everbody,

I want to setup a SIP account by connecting via TCP to a Deutsche Telekom SIP Trunk.

My Config looks like this right now:

[general]
srvlookup=yes
outboundproxy=reg.sip-trunk.telekom.de
register => +phonenumber:authname:password@sip-trunk.telekom.de/+phonenumber
tcpenable=yes
tcpbindaddr=192.168.2.3
language=de
port=5060

;; Deutsche Telekom AG
[t-online.de]
defaultuser=authname@sip-trunk.telekom.de
fromuser=+phonenumber
secret=password
context=incoming
extension=+phonenumber
type=peer
host=sip-trunk.telekom.de
outboundproxy=reg.sip-trunk.telekom.de
fromdomain=sip-trunk.telekom.de
realm=sip-trunk.telekom.de
nat=no
directmedia=no
canreinvite=yes
dtmfmode=inband
qualify=yes
session-timers=refuse ; Important!
allow=!all,alaw,g722
transport=tcp

unfortunately asterisk always attempts to connect to reg.sip-trunk.telekom.de with UDP instead of TCP, am I not seeing something? How can I enable asterisk to connect via TCP to the sip server?

Thanks & Best Regards
Freundschaft

Hello, do you have a solution for this problem?

greetz
Bert

actually yes:

add this to your /etc/hosts

217.0.15.67 sip-trunk.telekom.de

and in your /etc/asterisk/sip.conf

[general]
sipdebug=yes
srvlookup=yes
context=dtag-trunk-in
register => tcp://+49123456789:password:toid@sip-trunk.telekom.de/+49123456789
tcpenable=yes
tlsenable=yes
transport=udp,tcp,tls
nat=force_rport
allow=alaw,ulaw

;; Deutsche Telekom AG
[sip-trunk.telekom.de]
srvlookup=yes
type=peer
secret=password
defaultuser=toid@sip-trunk.telekom.de
host=sip-trunk.telekom.de
fromuser=+49123456789
context=dtag-trunk-in
type=peer
insecure=invite
fromdomain=sip-trunk.telekom.de
realm=sip-trunk.telekom.de
canreinvite=no
qualify=yes
session-timers=refuse     ; Important!
allow=!all,alaw,g722
transport=tcp
qualify=yes

its a dirty hack, but I wasnt able to get SRV lookups working together with DTAG sip trunks any other way. setting the DNS resolve entry manually did the trick.

2 Likes