> For the complete documentation index, see [llms.txt](https://docs.didforsale.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.didforsale.com/sip-trunking/sip-trunking/freepbx-trunk-configuration/freepbx-chansip-configuration/chansip-sip-trunk-registration.md).

# SIP based

Freepbx configuration guide for SIP setup using chan\_sip trunk.

### SIP TRUNK

**Step 1**: Go to connectivity>Trunks> click on +Add Trunk option. Under that select ADD SIP(chan\_sip) Trunk. A new window will appear. Enter the Trunk Name as “SIP\_account”

![](https://4161683604-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LUHjv4EwOoqWXb2by8A%2F-LWHVuKs7cLeFjIrpcW-%2F-LWHXMFUfj0JtsZKIB9b%2F2.png?alt=media\&token=6f5c69c6-df57-4781-96a0-fd576942a4bf)

&#x20;A new window will appear. Enter the Trunk Name as “SIP\_account”

![](https://4161683604-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LUHjv4EwOoqWXb2by8A%2F-LWHVuKs7cLeFjIrpcW-%2F-LWHXZwMczLqGqCdMXED%2Fsip_acc.png?alt=media\&token=9f4f3ec1-45e6-4ebe-b18e-ebd9089a54e5)

**Step 2:** Go to Sip settings, add the Trunk Name under outgoing as "SIP\_account" r as shown in image&#x20;

![](https://4161683604-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LUHjv4EwOoqWXb2by8A%2F-LWHVuKs7cLeFjIrpcW-%2F-LWHYynUbI0k5p60uN2b%2Fsip_out.png?alt=media\&token=accb1659-74ba-4c09-a6f9-1b43f5ccd850)

Under Incoming, enter User Context as "DFS"  and  the Register String as: username:<password@sip.la1.didforsale.com>\
&#x20;For Example:1001908134:1(IPncKnZKC$<9iX@sip.la2.didforsale.com>\
Copy the following user details:

```
type=friend 
secret=1(IPncKnZKC$9iX* 
username=1001908134*
qualify=no 
host=sip.la2.didforsale.com* 
dtmfmode=rfc2833 
context=from-trunk
canreinvite=no
allow=ulaw
insecure=port,invite 
fromdomain=sip.la2.didforsale.com*

```

{% hint style="info" %}
\*Note: Please use the username, password and domain received via email after creating SIP account.
{% endhint %}

![](https://4161683604-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LUHjv4EwOoqWXb2by8A%2F-LWHVuKs7cLeFjIrpcW-%2F-LWHXnnr4WT-PynYN3Sp%2Fsip_sip.png?alt=media\&token=960a97a2-8961-4d0c-b6bb-56aaa0cdad15)

### Routing Inbound Routes

**Step 3**:  For routing your inbound calls coming on your DID number, click on inbound routes and configure the DID with prefix 1. Toll free numbers needs to be configured without 1. Say your DID is 949 885 9944 then you will configure the DID with 19498859944 in the inbound routes. Delete existing routes for the DID and then reconfigure from scratch. Here is the image for inbound setups:

![](https://4161683604-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LUHjv4EwOoqWXb2by8A%2F-LWHZNqhRVXEkCrS3Drk%2F-LWHZz6mcNdyjd2S9EAg%2FInboundROute.png?alt=media\&token=e23af115-239d-4296-b9e3-155bfb9ec735)

### Routing Outbound Routes

**STEP 4**: For routing your outbound calls. Go to connectivity>Outbound Routes. Click on Add Outbound Route button (as shown below)

![](https://4161683604-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LUHjv4EwOoqWXb2by8A%2F-LWH_73m0c1BPFf4hy7g%2F-LWHfRZPrxcLDhGkYckW%2FScreen%20Shot%202019-01-15%20at%2011.31.02%20PM.png?alt=media\&token=03444d2c-ca8f-4589-a81f-4c2edb13185b)

**STEP 5**:You should be viewing the Route Setting tab. Under that, give the Route Name. Here,  we have call this route as “Outbound”. Enter the Route CID.  Choose the trunk(s) which you have created , SIP\_account from the drop-down menus next to Trunk Sequence for Matched Routes.&#x20;

![](https://4161683604-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LUHjv4EwOoqWXb2by8A%2F-LWH_73m0c1BPFf4hy7g%2F-LWHgS2jt_646AZdliym%2FScreen%20Shot%202019-01-15%20at%2011.35.39%20PM.png?alt=media\&token=4cb65f7d-4522-47ca-b017-60b6cd50572f)

**STEP** **6**: Click the Dial Patterns tab. Click Dial patterns wizards. In preprend enter “1” and for match pattern enter “NXXNXXXXXX”. For better understanding refer the following image:

![](https://4161683604-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LUHjv4EwOoqWXb2by8A%2F-LWH_73m0c1BPFf4hy7g%2F-LWHaVaQn1aXpyXQBz9o%2Fdialpattern.png?alt=media\&token=d1c1a07e-5911-466e-a330-1924e919d6c5)

Click on Submit button. Also press APPLY CONFIG (on the top right corner)

*Hope* *this* *Document* *helps*. *Please* *contact* *us* *for* *any* *further* *queries*.
