# Asterisk

## Asterisk Interconnection Guide

To create an interconnection between your asterisk server and DIDForSale servers, you need to create 4 trunks in your sip.conf file. Two trunks for incoming calls and two for outgoing calls. For creating the trunks, open /etc/asterisk/sip.conf file in your favourite editor and add the following trunk details into it.&#x20;

**`[didforsale_in1]`** \
`host=66.209.76.70` \
`type=peer` \
`context=from-­‐didforsale` \
`disallow=all` \
`allow=ulaw` \
`nat=yes` \
`canreinvite=yes` \
`insecure=very` \
`dtmfmode=rfc2833` \
`qualify=yes`&#x20;

**`[didforsale_in2]`** \
`host=66.209.76.72`\
`type=peer` \
`context=from-­‐didforsale` \
`disallow=all` \
`allow=ulaw` \
`nat=yes` \
`canreinvite=yes` \
`insecure=very` \
`dtmfmode=rfc2833` \
`qualify=yes`&#x20;

**`[didforsale_out1]`** \
`host=term1.didforsale.com`\
`type=peer` \
`context=from-­‐didforsale` \
`disallow=all` \
`allow=ulaw` \
`nat=yes` \
`canreinvite=yes` \
`insecure=very` \
`dtmfmode=rfc2833` \
`qualify=yes`&#x20;

**`[didforsale_out2]`** \
`host=term2.didforsale.com`\
`type=peer` \
`context=from-­‐didforsale` \
`disallow=all` \
`allow=ulaw` \
`nat=yes` \
`canreinvite=yes` \
`insecure=very` \
`dtmfmode=rfc2833` \
`qualify=yes`&#x20;

Now you have to create a dial plan entry to catch all incoming calls coming from DIDForSale. To do that, open /etc/asterisk/extensions.conf and add the below entries&#x20;

**`[from-­‐didforsale]`** \
`exten => _X.,1,Noop(Incoming calls from DIDForSale)` \
`same => n,Dial(SIP/1000)` \
`same => n,Hangup`&#x20;

The above dial plan entry catches all calls coming from DIDForSale and sends them to extension 1000 in your system. You can change that to forward calls to any other extension or IVR on your system.&#x20;

For making outgoing calls from your system through DIDForSale, create the below dial plan entry&#x20;

**`[outbound]`** \
`exten => _X.,1,Dial(SIP/didforsale_out1/${EXTEN})` \
`same => n,Dial(SIP/didforsale_out2/${EXTEN})` \
`same => n,Hangup`&#x20;

Change the context name ***“outbound”*** in the above entry to the context name of your extensions.

If you encounter any difficulties during the integration process or have questions specific to your PBX/Phone system, please don’t hesitate to contact our support team. We are available via email at **<contact-support@didforsale.com>** or by phone at  **1-800-579-7676**. Our experts are ready to assist you and ensure a seamless integration experience.


---

# Agent Instructions: 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://docs.didforsale.com/sip-trunking/sip-trunking/asterisk.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.
