Upgrade 3CX to v18 and get it hosted free!

Sample Asterisk config for StanaPhone

Author image

This works for me. All calls to my StanaPhone number ring on my extension 101, and after 20 seconds goes to my * voicemail. To use the StanaPhone network I dial 9 and the number.

sip.conf

[general]
port = 5060
bindaddr = 0.0.0.0
allow=ulaw

; This section is because i’m behind nat
externip = 206.45.88.212 ;Outside address
localnet = 192.168.2.10 ;Inside address
localmask = 255.255.255.0 ;Inside subnet

context = sip ; Default context for incoming calls
register => stanaphonenumber:[email protected]/101

[stanaphone]
type = friend
username = Stanaphonenumber
secret = Stanaphonepassword
host = sip.stanaphone.com
context = sip
nat = yes
canreinvite=no ; for NAT, but it will eat up TWICE the bandwidth because everything will go through *
insecure=very ; this will prevent * from sending a SIP 407 error back when a call comes in

[phone1] ;x-lite
type=friend
username=phone1
secret=12345678
host=dynamic
defaultip=192.168.2.199
dtmfmode=rfc2833
context=intern
callerid=”phone1″ <101>
mailbox=101

extensions.conf

[general]
static=yes
writeprotect=no

[globals]
STANAPHONEUSERID=stanaphonenumber

[intern]
include => stana-out
include => sip

[stana-out]
; STANAPHONE – Dial 9 & number to use stanaphone
exten => _9.,1,SetCallerID(${STANAPHONEUSERID})
exten => _9.,2,Dial(SIP/${EXTEN:1}@sip.stanaphone.com,60,tr)

[sip]
; phone1 – x-lite
exten => 101,1,Dial(SIP/phone1,20,tr)
exten => 101,2,Voicemail(u101)
exten => 101,3,Hangup
exten => 101,102,VoiceMail(b101)
exten => 101,103,Hangup


For me this above did not work, I was getting “Failed to authenticate on INVITE to” or similar messages,

General SIP configuration

Related Posts:

Get 3CX - Absolutely Free!
Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.