Skip to content
  • There are no suggestions because the search field is empty.

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.

Configure Asterisk with 2talk Cloud PBX using PJSIP

pjsip.conf

;==============TRANSPORTS

[transport-udp]
type=transport
protocol=udp ; or tls for TLS registration
bind=0.0.0.0

;===============TRUNK

[lyra-registration]
type=registration
outbound_auth=lyra-auth
server_uri=sip:lyra.2talk.co.nz
client_uri=sip:<yourphonenumber>@lyra.2talk.co.nz
retry_interval=120

[lyra-auth]
type=auth
auth_type=userpass
password=<yourpassword>
username=<yourphonenumber>

[lyra-aor]
type=aor
contact=sip:lyra.2talk.co.nz:5060 ; or lyra.2talk.co.nz:5061 for TLS registration

[lyra-endpoint]
type=endpoint
transport=transport-udp
context=from-2talk
disallow=all
allow=alaw
outbound_auth=lyra-auth
aors=lyra-aor
from_domain=lyra.2talk.co.nz

[lyra-identify]
type=identify
endpoint=lyra-endpoint
match=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=0
registertimeout=20

; Register line should be somewhere inside your general section

register => <yourphonenumber>:<yourpassword>@lyra.2talk.co.nz/<yourphonenumber>

[2talk]
type=friend
username=<yourphonenumber>
fromuser=<yourphonenumber>
secret=<yourpassword>
host=lyra.2talk.co.nz
context=from-2talk   ; or your own selected context if desired
dtmfmode=rfc2833
disallow=all
allow=ilbc
allow=alaw
allow=ulaw
;allow=g729   ; only if you have licenses to use it
nat=yes
canreinvite=no
insecure=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()