> For the complete documentation index, see [llms.txt](https://teamhelp.sipgate.co.uk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://teamhelp.sipgate.co.uk/integrations-and-connections/asterisk/how-do-i-configure-asterisk-for-sipgate-trunking.md).

# How do I configure Asterisk for sipgate trunking?

These are the settings for the basic configuration of Asterisk for sipgate trunking.\
For general Asterisk configuration instructions with sipgate **team** accounts please click [here](https://teamhelp.sipgate.co.uk/hc/en-gb/articles/204547911) instead.

{% hint style="info" %}
**Note:** Please replace your SIPID to SIP-ID and PASSWD to SIP Password respectively.
{% endhint %}

**Please enter the following in sip.conf:**

{% code title="sip.conf" %}

```ini
[sipconnect.sipgate.co.uk]
type=peer
host=sipconnect.sipgate.co.uk
outboundproxy=sipconnect.sipgate.co.uk
port=5060
username=SIP-ID
fromuser=SIP-ID
fromdomain=sipconnect.sipgate.co.uk
secret=SIP Password
dtmfmode=rfc2833
insecure=port,invite
canreinvite=no
registertimeout=600
disallow=all
allow=alaw
allow=ulaw
```

{% endcode %}

The information under **outboundproxy** is particularly important as it ensures your PBX is connected with the correct server. Your Asterisk must be registered with our server in order to receive incoming calls.

Equally important is that the peer sipconnect.sipgate.co.uk is

{% code title="Registration" %}

```
register => SIP-ID:SIP password@sipconnect.sipgate.co.uk/SIP-ID
```

{% endcode %}

If you now run the debug command on your Asterisk console, the REGISTER packets should be sent to the IP address **217.10.68.149**.

For outgoing calls, please enter the sender number in E.164 format (i.e. international format without the leading zeros or plus (+) sign) as a new header P-Preferred-Identity:

{% code title="Outgoing Caller ID" %}

```
SIPAddHeader(P-Preferred-Identity: <sip:4420300000000@sipconnect.sipgate.co.uk>)
```

{% endcode %}

**Important CLIP/Outgoing Caller ID information:** At this time, only sipgate-provided phone numbers can be set as the outgoing identity (Caller ID).

Should you wish to block your telephone number, you can do so by using:

{% code title="Number Suppression" %}

```
SipAddHeader(P-Preferred-Identity: <sip:4420300000000@sipconnect.sipgate.co.uk>)
SipAddHeader(Privacy: id)
```

{% endcode %}

Incoming calls are signalled to you with the fully selected E.164 number in the Request URI. This way you can work with the the variable ${EXTEN} without issues. It is not necessary to remove the number for the To-URI.

It is also possible to enable call forwarding on your PBX. To do this, please use the Diversion-Header and enter the originally dialled number.

**Note**: The following example was written in ORIGEXTEN:

{% code title="Call Forwarding" %}

```
SipAddHeader(Diversion: <${ORIGEXTEN}@sipconnect.sipgate.co.uk>)
```

{% endcode %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://teamhelp.sipgate.co.uk/integrations-and-connections/asterisk/how-do-i-configure-asterisk-for-sipgate-trunking.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
