---
title: Asterisk Configuation Guides PJSIP & chan_sip
description: Learn how to configure an Asterisk PBX to connect with 2talk, covering trunks, extensions, and call routing setup.
---

[Skip to content](https://support.2talk.co.nz/asterisk-co#main-content)

[![2tlogo](https://support.2talk.co.nz/hs-fs/hubfs/2tlogo.png?width=128&height=60&name=2tlogo.png)](https://www.2talk.co.nz//)

Open main navigation

Close main navigation

 Hi. How can we help?

- There are no suggestions because the search field is empty.

1. [2talk](https://support.2talk.co.nz/?hsLang=en)
2. [Voice](https://support.2talk.co.nz/voice?hsLang=en)
3. [Softphones and Devices](https://support.2talk.co.nz/voice?hsLang=en#softphones-and-devices)

# Asterisk Configuation Guides PJSIP & chan\_sip

## Asterisk is a common, widely used PBX platform. It works well with 2talk, giving businesses a flexible and reliable option for managing their voice services.

Here are example configurations for PJSIP and chan\_sip  You should replace the \<yourphonenumber\> with your actual 2talk number  and \<yourpassword\> with your 2talk line password.

Note: Additional configuration will be required to configure your internal extensions and how you want to route calls to these. These template examples are a good base to get the trunk between 2talk and your PBX going.

### Configure Asterisk with 2talk Cloud PBX using PJSIP

**pjsip.conf**

```
;==============TRANSPORTS[transport-udp]type=transportprotocol=udp ; or tls for TLS registrationbind=0.0.0.0;===============TRUNK[lyra-registration]type=registrationoutbound_auth=lyra-authserver_uri=sip:lyra.2talk.co.nzclient_uri=sip:<yourphonenumber>@lyra.2talk.co.nzretry_interval=120[lyra-auth]type=authauth_type=userpasspassword=<yourpassword>username=<yourphonenumber>[lyra-aor]type=aorcontact=sip:lyra.2talk.co.nz:5060 ; or lyra.2talk.co.nz:5061 for TLS registration[lyra-endpoint]type=endpointtransport=transport-udpcontext=from-2talkdisallow=allallow=alawoutbound_auth=lyra-authaors=lyra-aorfrom_domain=lyra.2talk.co.nz[lyra-identify]type=identifyendpoint=lyra-endpointmatch=lyra.2talk.co.nz; Then configure internal endpoints for desk phones. 
```

**extensions.conf**

```
[from-internal]exten => _X.,1,Dial(PJSIP/${EXTEN}@lyra-endpoint) same => n,Hangup()[from-2talk]exten => s,1,NoOp(Inbound call from 2talk) same => n,Dial(PJSIP/<yourphonenumber>) same => n,Hangup()
```

 

### Configure Asterisk with 2talk Cloud PBX using chan\_sip

**sip.conf**

```
[general]registerattempts=0registertimeout=20; Register line should be somewhere inside your general sectionregister => <yourphonenumber>:<yourpassword>@lyra.2talk.co.nz/<yourphonenumber>[2talk]type=friendusername=<yourphonenumber>fromuser=<yourphonenumber>secret=<yourpassword>host=lyra.2talk.co.nzcontext=from-2talk   ; or your own selected context if desireddtmfmode=rfc2833disallow=allallow=ilbcallow=alawallow=ulaw;allow=g729   ; only if you have licenses to use itnat=yescanreinvite=noinsecure=invite,port ; use very in older versions of Asterisk such as v1.4
```

extensions.conf

```
[from-internal]exten => _X.,1,Dial(SIP/${EXTEN}@2talk) same => n,Hangup()[from-2talk]exten => s,1,NoOp(Inbound call from 2talk) same => n,Dial(SIP/<yourphonenumber>) same => n,Hangup()
```

 

- [Accounts & Billing](https://support.2talk.co.nz/accounts-billing?hsLang=en#main-content)

    - [Manage Account](https://support.2talk.co.nz/accounts-billing?hsLang=en#manage-account)
    - [Billing & Payment](https://support.2talk.co.nz/accounts-billing?hsLang=en#billing-payment)
    - [Getting Help](https://support.2talk.co.nz/accounts-billing?hsLang=en#getting-help)
- [Broadband](https://support.2talk.co.nz/broadband?hsLang=en#main-content)

    - [Getting Started](https://support.2talk.co.nz/broadband?hsLang=en#getting-started)
    - [Troubleshooting](https://support.2talk.co.nz/broadband?hsLang=en#troubleshooting)
    - [Broadband Plans](https://support.2talk.co.nz/broadband?hsLang=en#broadband-plans)
    - [Device Guides](https://support.2talk.co.nz/broadband?hsLang=en#device-guides)
- [Voice](https://support.2talk.co.nz/voice?hsLang=en#main-content)

    - [Getting Started with 2talk Voice](https://support.2talk.co.nz/voice?hsLang=en#getting-started-with-2talk-voice)
    - [Troubleshooting](https://support.2talk.co.nz/voice?hsLang=en#troubleshooting)
    - [2talk Cloud PBX](https://support.2talk.co.nz/voice?hsLang=en#2talk-cloud-pbx)
    - [SIP Trunks](https://support.2talk.co.nz/voice?hsLang=en#sip-trunks)
    - [Softphones and Devices](https://support.2talk.co.nz/voice?hsLang=en#softphones-and-devices)
    - [2talk Voice Plans and Services](https://support.2talk.co.nz/voice?hsLang=en#2talk-voice-plans-and-services)
    - [2talk Lyra Voice Platform](https://support.2talk.co.nz/voice?hsLang=en#2talk-lyra-voice-platform)
- [Mobile](https://support.2talk.co.nz/mobile?hsLang=en#main-content)

    - [Getting Started](https://support.2talk.co.nz/mobile?hsLang=en#getting-started)
    - [Troubleshooting](https://support.2talk.co.nz/mobile?hsLang=en#troubleshooting)
    - [Mobile Plans and Services](https://support.2talk.co.nz/mobile?hsLang=en#mobile-plans-and-services)
    - [3G Shutdown](https://support.2talk.co.nz/mobile?hsLang=en#3g-shutdown)
- [Messaging](https://support.2talk.co.nz/messaging?hsLang=en)
- [Voice AI](https://support.2talk.co.nz/voice-ai?hsLang=en)

[![2talk\_logo\_17](https://support.2talk.co.nz/hs-fs/hubfs/2talk_logo_17.png?width=50&height=23&name=2talk_logo_17.png "2talk_logo_17")](https://www.2talk.co.nz)

Copyright © 2025, 2talk