Thursday, March 15, 2012

Configuration file for Asterisk SIP channels, for both inbound and outbound calls.

Asterisk as a SIP client
;***********For INBOUND Only*********************
register => 1001:password@mysipprovider.com/1234

;***********FOR INBOUND as well as OUTBOUND*********************
[SIPTRUNK]
fromuser=username or ip from where to send calls
host = remote-ip-address (where to send calls)
username=username
secret=any-passsword
fromdomain=remote-ip-address (Valid only when in [general] section or
type=peer.)
disallow=all
allow=g729
type = friend (user, peer, friend)
dtmfmode=rfc2833
dtmf=rfc2833
qualify = yes
rfc2833compensate=yes
insecure=port,invite
qualify = yes
canreinvite=no
restrictcid=yes
context = sip-call-in ( this section will be defined in
extensions.conf and If type=user, the Context for the inbound call
from this SIP user definition. If type=peer, the Context in the
dialplan for outbound calls from this SIP peer definition. If
type=friend the context used for both inbound and outbound calls
through the SIP entities definition. If no type=user entry matches an
inbound call, then a type=peer or type=friend will match if the
hostname or IP address defined in host= matches.)
In extensions.conf you'd then use a statement like this:.
;***********For OUTBOUND*********************
exten => _X.,1,Set(CDR(accountcode)=SIPTRUNK100)
exten => _X.,n,Dial(SIP/${EXTEN}@SIPTRUNK,60)
exten => h,n,Hangup()
;***********FOR INBOUND as well as OUTBOUND*********************
[sip-call-in]
exten => 1234,1,Answer ; 1234 is the contact extension, default
contact extension is "s"
exten => 1234,2,Dial(SIP/111,25,Ttr) ; incoming calls are redirected
to SIP telephone with number 111
exten => 1234,3,Hangup

0 comments:

Post a Comment