; Sample /etc/asterisk/extensions.conf
; Created September 1, 2004
; =========================================================
; QUICKSTART WITH VOICEPULSE CONNECT! SERVICE:
;
; * Login to your VoicePulse Connect! account at:
; http://connect.voicepulse.com/
;
; * Go to the Devices tab and note your device login and
; password
;
; * Replace MY_DEVICE_LOGIN and MY_DEVICE_PASSWORD in the
; "exten => " statements below with your device login
; and password. (Lines 81-82)
;
; * If you DO NOT have a phone number from VoicePulse
; Connect!, comment out the following lines by placing a
; semicolon ";" at the beginning:
;
; - The entire "[arbitrary-name]" context (lines 43-48)
; - The entire "[testdtmf]" context (lines 54-60)
; =========================================================
[general]
static=yes
writeprotect=no
; In the the globals section, we define some constants which we can use later
; to make things neater and more efficient.
[globals]
;
;
; First, our two Sipura lines, which we will call extensions 2201 and 2202 in this
; example. Any extension number could be used as long as we are consistent across
; all .conf files as well as in the SPA-2000 configuration screens.
; SIP/ tells asterisk that we are referring to a SIP device or channel.
;
; line 1
;
PHONES1=SIP/2201
PHONES1VM=2201
;
; line 2
;
PHONES2=SIP/2202
PHONES2VM=2202
;
; Second, we need to enter our login for VoicePulse Connect! In your order
; confirmation email from VoicePulse, you should have received information
; that looks something like this:
; Login: 1234567890
;
; So we want to put that login information here:
VOICEPULSEID=XUDIXUDIX (not real)
;
;
; Next, we'll enter our number for Free World Dialup
;
;FWDUSERID=533859
;
;
; Now we need to provide our outgoing caller ID information, which can be
; set to whatever we like. VoicePulse Connect! will send it exactly as we specify
; here. So make sure it looks right to you!
;
MYNAME=Dorian Gray
MYPHONE=2125551212
;
;
;
; We'll include a simple macro that takes an extension as its argument,
; connects the caller to the voice mailbox of that extension, and then hangs up after
; playing a couple short messages.
;
[macro-vmessage]
exten => s,1,VoiceMail2(u${ARG1})
exten => s,2,Playback(groovy)
exten => s,3,Playback(goodbye)
exten => s,4,Hangup
;
;
; And also a fairly simple macro for dialing out using VoicePulse Connect!
; (note how we re-use the globally defined constants. slick, eh?).
;
[macro-dialvpconnect]
;
; Here we can set caller ID number and name, if we like
;
exten => s,1,SetCallerID(${MYPHONE})
exten => s,2,SetCIDName(${MYNAME})
;
; Here is where we dial out through VoicePulse Connect! and use a couple
; arguments that must be passed to the macro: ARG1 will be the number we're
; trying to dial (e.g. 12125551212) and ARG2 will be how many seconds to try
; before giving up, e.g. 60
;
exten => s,3,Dial(IAX2/${VOICEPULSEID}@vpconnect-t01/${ARG1},${ARG2},Tr)
exten => s,4,Hangup
;
;
;
; The dialout context can be included in contexts which should have access
; to an outside line. Normally we would include many different outgoing contexts,
; but for simplicity, we mention only "vpconnect-forced" and "fwd-out" in this case.
;
[dialout]
;
; if someone dials a "6" in front of their number, send out via VoicePulse Connect!
;
include => vpconnect-forced
;
; If someone dials a "7" in front of their number, send to Free World Dialup
;
include => fwd-forced
;
;
; It's "forced" because we require a "6" to be dialed to match this context.
; In fact, it would certainly be possible to set up our dialplan without the
; "forced" leading "6" or "7" so that numbers of a certain length
; (e.g. 5 or 6 digits) dialed out to FWD, and numbers starting with a "1" or
; even specific area codes dialed out to VoicePulse or another provider.
;
[vpconnect-forced]
;
; Dial out on VoicePulse Connect! and wait for 70 seconds for a connect.
; If no connection is made in 70 seconds, jump to the "fastbusy" macro.
; Note that ${EXTEN:1} will be passed as ARG1 of our macro, i.e.
; strip the leading "6" and pass the rest of the number. "70" will
; then be ARG2 of the macro, the dial timeout in #seconds.
;
exten => _1XXXXXXXXXX,1,Macro(dialvpconnect,${EXTEN},70)
;
;
[fwd-forced]
; Check to see if the called number starts with a "7" and
; if so, set the call parameters and bounce the call to the
; Free World Dialup SIP server.
;
; NOTE: Calls to unknown users will result in "invalid extension"
; message being played.
;
exten => _7.,1,SetCallerID(${FWDUSERID})
exten => _7.,2,SetCIDName(${MYNAME})
exten => _7.,3,Dial(SIP/${EXTEN:1}@fwd)
exten => _7.,4,Playback(invalid)
exten => _7.,5,Hangup
;
;
; This is the home context. Any phone or device that has access to this
; context will be able to make outgoing calls.
;
[home]
;
; First, we definitely want to include the dialout context,
; so we'll be able to dial out!
;
include => dialout
;
; Next, add an extension for voicemail
; now if we dial 8, we can check voicemail.
;
exten => 8,1,VoiceMailMain2
exten => 8,2,Hangup
;
;
; Add some more extensions for the two Sipura lines now
; we'll be able to call one line from the other.
; And if no one answers, it will go to the mailbox for that line.
;
; Sipura line 1
;
exten => 2201,1,Dial(${PHONES1},20,Ttm)
exten => 2201,2,Macro(vmessage,${PHONES1VM})
exten => 2201,3,Hangup
;
;
; Sipura line 2
;
exten => 2202,1,Dial(${PHONES2},20,Ttm)
exten => 2202,2,Macro(vmessage,${PHONES2VM})
exten => 2202,3,Hangup
;
;
; NOTE: it will be important to remember the name of the context
; "from-sip" later, we will need to use it in sip.conf
;
[from-sip]
; To receive calls inbound from FWD, we set the extension
; to our FWD user ID, in this case 94896
;
; As currently written, incoming calls from FWD will ring
; only line 1 of the SPA-2000. However, changing the "Dial"
; directive to something like this:
; Dial(${PHONES1}&${PHONES2},15,Ttm)
; would cause both lines of the Sipura device to ring
;
exten => 533859,1,Dial(${PHONES1},15,Ttm)
exten => 533859,2,Voicemail2(u${PHONES1VM})
exten => 533859,3,Hangup
exten => 2073760164,1,Goto(Home|2202|1)