SARK V4.0.0 siptrunks
Contents
Introduction
You will often find it necessary to talk to downstream PBX systems; either in your company or if you are running a boutique ITSP service using SARK. Here is a setup guide for such trunks.
Upstream SARK box
Direct Connect
If you will only ever need to support a single trunk to the downstream PBX then you can simply set up a "direct connect" trunk with no registration or login credentials. You will need to ensure that you restrict access in the SARK firewall or your perimeter firewall if you wish to run this kind of a setup otherwise you will, in effect have an open proxy and anyone will be able to send calls through your PBX.
All that is needed in each SARK is a general sip trunk with the asterisk peer set as follows
type=peer context=internal host={ip addr} qualify=yes canreinvite=no insecure=port,invite disallow=all allow=alaw allow=ulaw
Multiple downstream trunks
If you wish to support multiple trunks to the downstream PBX (usually for accounting purposes) or to avoid port forwarding on the downstream router, then each downstream trunk will need to register with the upstream box. Create each trunk on the upstream PBX as follows
type=peer context=internal host=dynamic username=someuser secret=somesecret qualify=yes canreinvite=no insecure=port,invite disallow=all allow=alaw allow=ulaw
N.B. you must also set the peername to the SAME value as the username.
Downstream SARK or Asterisk box
Direct Connect
If you will only ever need to support a single trunk to the upstream PBX then you can simply set up a "direct connect" trunk with no registration or login credentials. You will need to ensure that you restrict access in the SARK firewall or your perimeter firewall if you wish to run this kind of a setup otherwise you will, in effect have an open proxy and anyone will be able to send calls through your PBX.
All that is needed in each SARK is a general sip trunk with the asterisk peer set as follows. This is slightly different to the upstream example above.
type=peer host={ip addr} qualify=yes canreinvite=no insecure=port,invite disallow=all allow=alaw allow=ulaw
N.B. You will also need to set up a port forward in your firewall for 5060 and 10000-20000 UDP. For this reason it is recommended that you use registration and qualify wherever possible because it does not normally need any port forwarding.
Multiple upstream trunks
If you wish to support multiple trunks to the upstream PBX or you simply wish to use registration (recommended), then each downstream trunk will need to register with the upstream box. Create each trunk on the downstream PBX as follows
type=peer host={ip address} qualify=yes username=someuser secret=somesecret canreinvite=no insecure=port,invite disallow=all allow=alaw allow=ulaw nat=yes
If this a SARK box then check registration=YES when creating the trunk. Otherwise, create a registration entry as follows
register => someuser:somesecret@{ip address}/someuser