| ||||
The simple approachUsing Asterisk as a SIP gatewayNow that you've got asterisk installed it's just get the configuration done. SIPsip.conf - Download here
[general]
port = 5060 ; port to bind for sip connections
bindaddr = 0.0.0.0 ; ip to bind for sip connections
context = from-sip ; default context for incoming sip calls
;
disallow = all ; disallow all codecs, we want to enable,
allow = gsm ; what we deem is necessary
allow = ilbc
allow = speex
allow = g729 ; g729 only works for pass-thru, if you haven't bought a license
allow = g726
allow = ulaw ; i would normally not allow ulaw, because it's high bandwidth,
; but if you want to use free world dialup services, it's the
; only codec they support
;
register => 12345:not_my_password@fwd.pulver.com/marlow-fwd ; these make it possible to get calls
register => 17471234567:not_my_password_either@proxy01.sipphone.com/marlow-sip ; in from these services.
;
;
; Dial out to fwdnet
;
[fwd]
type=peer
secret=not_my_password
host=fwd.pulver.com
;
;
; Dial out to sipphone.com
;
[sipphone]
type=peer
secret=not_my_password_either
host=proxy01.sipphone.com
;
;
; This is a local extension running kphone, firefly or likewise
;
[marlow]
callerid=("Martin List-Petersen" <3986>)
type=friend
secret=not_my_password_anyway
host=dynamic
context=intern
; canreinvite=no ; "canreinvite=no" is needed, so that all calls allways go through asterisk. This is
; needed, when you have the SIP client on the LAN and want to use asterisk as a proxy.
;
; qualify=200
; nat=yes ; these two are needed, if you asterisk box sits on a public ip
; and your sip client/ata box/ip phone behind a nat firewall
; usually you would not need a stun server then.
Extensionsextensions.conf - Download here
[general]
static=yes
writeprotect=no
[globals]
;
; The name to use on callerid
;
MARLOW_CID=Martin List-Petersen
; FWD ID for callerid
;
MARLOW_FWD=12345
; sipphone ID for callerid
;
MARLOW_SIPPHONE=17471234567
[internal]
;
; local extensions
;
exten => 3986,1,Dial(SIP/marlow,60) ; call SIP extension "marlow" for 60 seconds,
; if extension 3986 is called
exten => 3986,2,Voicemail(u3986) ; if we can't connect to "marlow" or after seconds
; go to the unavail VM
exten => 3986,102,Voicemail(b3986) ; if busy, go to the busy VM
;
; Voicemail System
;
exten => 9999,1,VoiceMailMain(${CALLERIDNUM}) ; extension 9999 is the VM system,
; go directly to callers VM
exten => 9999,2,Hangup
[from-sip]
;
; default extension for calls from SIP
;
exten => s,1,Dial(Local/3986@internal/n)
;
; calls from Free World Dialup (FWD)
;
exten => marlow-fwd,1,SetCIDName(FWD - ${CALLERIDNAME}) ; indicate that the call came through FWD
exten => marlow-fwd,2,Dial(Local/3986@internal/n)
;
; calls from sipphone
;
exten => marlow-sip,1,SetCIDName(SIP - ${CALLERIDNAME}) ; indicate that the call came through sipphone
exten => marlow-sip,2,Dial(Local/3986@internal/n)
[outbound-internal]
;
; include local extensions
;
include => internal
;
; include SIP accounts
;
include => fwdnet
include => sipphone
;
; include tollfree calls
;
include => tollfree
[default]
;
; include from-sip for default. We don't use it, but it might be a good idea
;
include => from-sip
[fwdnet]
;
; fwdnet extensions
;
exten => _1393.,1,SetCallerID(${MARLOW_CID} <${MARLOW_FWD}>) ; set my callerid and name for FWD
exten => _1393.,2,Dial,SIP/${EXTEN:4}@fwd ; dial the number i wish to dial on FWD
exten => _1393.,3,Playback(invalid) ; this did not work out
exten => _1393.,4,Hangup
exten => _1393.,103,Busy ; the destination was busy
; dial jumps to +101 if busy
[sipphone]
;
; sipphone extension
;
exten => _1747.,1,SetCallerID(${MARLOW_CID} <${MARLOW_SIPPHONE}>)
exten => _1747.,2,Dial,SIP/${EXTEN:4}@sipphone
exten => _1747.,3,Playback(invalid)
exten => _1747.,4,Hangup
exten => _1747.,103,Busy
[tollfree]
;
; terminate toll-free no.'s via fwdnet
;
;
; US toll free access
;
; +1-800
exten => _1800.,1,SetCallerID(<${MARLOW_FWD}>)
exten => _1800.,2,Dial,SIP/*${EXTEN}@fwd
exten => _1800.,3,Playback(invalid)
exten => _1800.,4,Hangup
exten => _1800.,103,Busy
; +1-866
exten => _1866.,1,SetCallerID(<${MARLOW_FWD}>)
exten => _1866.,2,Dial,SIP/*${EXTEN}@fwd
exten => _1866.,3,Playback(invalid)
exten => _1866.,4,Hangup
exten => _1866.,103,Busy
; +1-877
exten => _1877.,1,SetCallerID(<${MARLOW_FWD}>)
exten => _1877.,2,Dial,SIP/*${EXTEN}@fwd
exten => _1877.,3,Playback(invalid)
exten => _1877.,4,Hangup
exten => _1877.,103,Busy
; +1-888
exten => _1888.,1,SetCallerID(<${MARLOW_FWD}>)
exten => _1888.,2,Dial,SIP/*${EXTEN}@fwd
exten => _1888.,3,Playback(invalid)
exten => _1888.,4,Hangup
exten => _1888.,103,Busy
;
; Netherlands toll free access
;
exten => _31800.,1,SetCallerID(<${MARLOW_FWD}>)
exten => _31800.,2,Dial,SIP/*${EXTEN}@fwd
exten => _31800.,3,Playback(invalid)
exten => _31800.,4,Hangup
exten => _31800.,103,Busy
;
; France toll free access
;
exten => _33800.,1,SetCallerID(<${MARLOW_FWD}>)
exten => _33800.,2,Dial,SIP/*${EXTEN}@fwd
exten => _33800.,3,Playback(invalid)
exten => _33800.,4,Hangup
exten => _33800.,103,Busy
;
; UK toll free access
;
; +44 500
exten => _44500.,1,SetCallerID(<${MARLOW_FWD}>)
exten => _44500.,2,Dial,SIP/*${EXTEN}@fwd
exten => _44500.,3,Playback(invalid)
exten => _44500.,4,Hangup
exten => _44500.,103,Busy
; +44 800
exten => _44800.,1,SetCallerID(<${MARLOW_FWD}>)
exten => _44800.,2,Dial,SIP/*${EXTEN}@fwd
exten => _44800.,3,Playback(invalid)
exten => _44800.,4,Hangup
exten => _44800.,103,Busy
; +44 808
exten => _44808.,1,SetCallerID(<${MARLOW_FWD}>)
exten => _44808.,2,Dial,SIP/*${EXTEN}@fwd
exten => _44808.,3,Playback(invalid)
exten => _44808.,4,Hangup
exten => _44808.,103,Busy
Starting it upAfter restarting asterisk with /etc/init.d/asterisk restart you can connect to the console with asterisk -r as root. Gives you a lot of monitoring and configuration possibilities.
| ||||
| Website last modified: Jan 8th, 2007 - 1:39 PM GMT. (C)opyright 1997 - 2007 by Martin List-Petersen | ![]() ![]() |