vtjosh
06-22-2007, 03:02 AM
There seems to be an increased interest in Asterisk lately, so I have written some sample configs that work with Asterisk 1.4. You'll just need to grab your SIP credentials from your softphone config page in your control panel and edit anything I've noted.
If you have any questions/problems, post them here, and I'll do my best to answer them.
-Josh
; ViaTalk: Asterisk 1.4 sip.conf sample
;
; This is a known working configuration for Asterisk's sip.conf. You simply need to
; get your SIP credentials from your VT Control Panel 'Softphone Config > Generic'
; and replace each item noted below
; GENERAL CONFIGURATION
; These rules apply to any other context in sip.conf unless you explicitly specify them
[general]
context=default ; context in extensions.conf to go to first
bindport=5060
port=5060
bindaddr=0.0.0.0
recordhistory=yes
disallow=all ; disallow all codecs
allow=ulaw
allow=gsm
trustrpid=yes ; needed for caller ID
sendrpid=yes
dtmfmode=inband ; VT uses inband dtmf
relaxdtmf=yes
realm=asterisk ; needed for some sip phones
; REGISTRATION
register => [YOUR 11 DIGIT VT NUMBER]:[YOUR SIP PASSWORD]@[YOUR VT PROXY]/[YOUR 11 DIGIT VT NUMBER]
; TRUNK CONFIGURATION
; This configures your ViaTalk line as a SIP trunk for Asterisk to use
[viatalk]
type=friend
authuser=[YOUR 11 DIGIT VT NUMBER]
username=[YOUR 11 DIGIT VT NUMBER]
fromuser=[YOUR 11 DIGIT VT NUMBER]
fromdomain=[YOUR VT PROXY]
host=[YOUR VT PROXY]
secret=[YOUR SIP PASSWORD]
insecure=very
qualify=3600
nat=no ; switch to yes if behind nat (try to avoid it if at all possible)
; PEER CONFIGURATION
; This will allow you to register a softphone/adapter to your PBX
[1000]
type=peer
nat=yes ; allows you to use a softphone/adapter behind nat
host=dynamic
canreinvite=yes
username=1000
secret=password ; this password can be anything you want
; ViaTalk Asterisk 1.4 extensions.conf sample
;
; This is a known working configuration for Asterisk's extensions.conf with ViaTalk
; Replace anything noted.
[general]
static=yes
writeprotect=yes
[globals]
CONSOLE=Console/dsp
NPX=[YOUR AREA CODE] ; Replace this with your area code
PEER=1000 ; The peer you setup in sip.conf for your softphone/adapter
TRUNK=viatalk ; The name of the trunk you defined
[default]
include=incoming
include=outgoing
[incoming]
exten => [YOUR 11 DIGIT VT NUMBER],1,Dial(SIP/${PEER},60,r)
exten => [YOUR 11 DIGIT VT NUMBER],2,Hangup
[outgoing]
exten => 911,1,Dial(SIP/911@${TRUNK},60,r)
exten => 411,1,Dial(SIP/411@${TRUNK},60,r)
exten => *123,1,Dial(SIP/*123@${TRUNK},60,r)
exten => _NXXXXXX,1,Goto(1${NPX}${EXTEN},1) ; if dialing 7 digits, prepend 1 + Area Code
exten => _NXXNXXXXXX,1,Goto(1${EXTEN},1) ; if dialing 10 digits, prepend 1
exten => _1NXXNXXXXXX,1,Dial(SIP/${EXTEN}@${TRUNK},60,r)
exten => _1NXXNXXXXXX,2,Playtones(480+620/250,0/250) ; play a fast busy tone
exten => _1NXXNXXXXXX,3,Congestion
; For International dialing [Optional]
exten => _011X.,1,Dial(SIP/${EXTEN}@${TRUNK},60,r)
exten => _011X.,2,Playtones(480+620/250,0/250) ; play a fast busy tone
exten => _011X.,3,Congestion
; in the case of an invalid number or a time-out hangup
exten => i,1,Hangup
exten => t,1,Hangup
If you have any questions/problems, post them here, and I'll do my best to answer them.
-Josh
; ViaTalk: Asterisk 1.4 sip.conf sample
;
; This is a known working configuration for Asterisk's sip.conf. You simply need to
; get your SIP credentials from your VT Control Panel 'Softphone Config > Generic'
; and replace each item noted below
; GENERAL CONFIGURATION
; These rules apply to any other context in sip.conf unless you explicitly specify them
[general]
context=default ; context in extensions.conf to go to first
bindport=5060
port=5060
bindaddr=0.0.0.0
recordhistory=yes
disallow=all ; disallow all codecs
allow=ulaw
allow=gsm
trustrpid=yes ; needed for caller ID
sendrpid=yes
dtmfmode=inband ; VT uses inband dtmf
relaxdtmf=yes
realm=asterisk ; needed for some sip phones
; REGISTRATION
register => [YOUR 11 DIGIT VT NUMBER]:[YOUR SIP PASSWORD]@[YOUR VT PROXY]/[YOUR 11 DIGIT VT NUMBER]
; TRUNK CONFIGURATION
; This configures your ViaTalk line as a SIP trunk for Asterisk to use
[viatalk]
type=friend
authuser=[YOUR 11 DIGIT VT NUMBER]
username=[YOUR 11 DIGIT VT NUMBER]
fromuser=[YOUR 11 DIGIT VT NUMBER]
fromdomain=[YOUR VT PROXY]
host=[YOUR VT PROXY]
secret=[YOUR SIP PASSWORD]
insecure=very
qualify=3600
nat=no ; switch to yes if behind nat (try to avoid it if at all possible)
; PEER CONFIGURATION
; This will allow you to register a softphone/adapter to your PBX
[1000]
type=peer
nat=yes ; allows you to use a softphone/adapter behind nat
host=dynamic
canreinvite=yes
username=1000
secret=password ; this password can be anything you want
; ViaTalk Asterisk 1.4 extensions.conf sample
;
; This is a known working configuration for Asterisk's extensions.conf with ViaTalk
; Replace anything noted.
[general]
static=yes
writeprotect=yes
[globals]
CONSOLE=Console/dsp
NPX=[YOUR AREA CODE] ; Replace this with your area code
PEER=1000 ; The peer you setup in sip.conf for your softphone/adapter
TRUNK=viatalk ; The name of the trunk you defined
[default]
include=incoming
include=outgoing
[incoming]
exten => [YOUR 11 DIGIT VT NUMBER],1,Dial(SIP/${PEER},60,r)
exten => [YOUR 11 DIGIT VT NUMBER],2,Hangup
[outgoing]
exten => 911,1,Dial(SIP/911@${TRUNK},60,r)
exten => 411,1,Dial(SIP/411@${TRUNK},60,r)
exten => *123,1,Dial(SIP/*123@${TRUNK},60,r)
exten => _NXXXXXX,1,Goto(1${NPX}${EXTEN},1) ; if dialing 7 digits, prepend 1 + Area Code
exten => _NXXNXXXXXX,1,Goto(1${EXTEN},1) ; if dialing 10 digits, prepend 1
exten => _1NXXNXXXXXX,1,Dial(SIP/${EXTEN}@${TRUNK},60,r)
exten => _1NXXNXXXXXX,2,Playtones(480+620/250,0/250) ; play a fast busy tone
exten => _1NXXNXXXXXX,3,Congestion
; For International dialing [Optional]
exten => _011X.,1,Dial(SIP/${EXTEN}@${TRUNK},60,r)
exten => _011X.,2,Playtones(480+620/250,0/250) ; play a fast busy tone
exten => _011X.,3,Congestion
; in the case of an invalid number or a time-out hangup
exten => i,1,Hangup
exten => t,1,Hangup