Solved? Connecting FreePBX to Sipgate Live business service

My first post sorry if I am posting to the wrong place. I have spent many days researching and struggling to get my system to work with sipgate uk, with Allow Anonymous Inbound SIP Calls? set to no. The information provided on the sipgate website does not work, so I thought I would share this to save someone else two days of their life, or an expert might be able to suggest a better way.

Firstly the registration string sipgate provide is wrong. Research took me to their German website where I saw a different string. The string that works is

[email protected]:secret:[email protected]/userid

This causes a problem, outbound calls are sent via sipgate.co.uk, and inbound from proxy.live.sipgate.co.uk so do not authenticate. The solution is to have two peers one inbound with the registration and one outbound with no registration string. My sip.conf looks like.

[234 in]
disallow=all
username=sipid
type=peer
secret=secret
qualify=yes
outboundproxy=proxy.live.sipgate.co.uk
nat=yes
insecure=port,invite
host=proxy.live.sipgate.co.uk
dtmfmode=rfc2833
context=from-trunk
canreinvite=no
allow=ulaw,alaw

[234 out]
disallow=all
username=sipid
fromuser=sipid
type=peer
secret=secret
qualify=yes
outboundproxy=proxy.live.sipgate.co.uk
nat=yes
insecure=port,invite
host=sipgate.co.uk
dtmfmode=rfc2833
context=from-trunk
canreinvite=no
allow=ulaw,alaw

So you clearly use out for your outbound route and in for your inbound route.

And it works…