[Asterisk-Users] Setting up PABX

Steven Critchfield critch at basesys.com
Tue Apr 1 15:13:19 MST 2003


On Tue, 2003-04-01 at 15:44, WipeOut . wrote:
> > At my office, I have a context [outside] that defines the local and long
> > distance calling dial pattern matches. All the phones in my office are
> > dropped in the [office] context which is able to include the [outside]
> > context. The incoming lines are dropped in the [default] context. The
> > [default] context includes my [extensions] context so they can dial a
> > user, but since it doesn't include the [outside[ context they can't grab
> > another line going out.
> 
> Steven,
> 
> Would it be possible to have a look at your extensions.conf?? (after
> you remove whatever you need to for security)..
> 
> The reason is that I still haven't got my head around the way includes
> and contexts should be used correctly and by the way you described
> your setup it is pretty much what I want to do so to see a working
> example would be a great help...
> 
> The only thing I have not done in my setup is the [extensions] context
> you mentioned, other than that I have a context in my config that
> corresponds to a similar context in your config..

Okay, here goes.

---------------------------extensions.conf-----------------------------
;
; Static extension configuration files, used by
; the pbx_config module.
;
; The "General" category is for certain variables.  All other categories
; are interpreted as extension contexts
;
[general]
;
; If static is set to no, or omitted, then the pbx_config will rewrite
; this file when extensions are modified.  Remember that all comments
; made in the file will be lost when that happens. 
;
; XXX Not yet implemented XXX
;
static=yes

;
; if stati=yes and writeprotect=no, you can save dialplan by
; CLI command 'save dialplan' too
;
writeprotect=no

[internal]
include => outside
include => extensions
include => parkedcalls
include => meetme

; This is some of my testing extensions. Things I'm playing with.

exten => 40,1,Dial,Zap/g1/9xxxxxxxxx ; Personal hotline to Mark 
exten => 41,1,Goto,testing|s|1
exten => 42,1,DateTime
exten => 42,2,Goto,9004|2
exten => 43,1,Goto,testing|s|1
;exten => 44,1,Festival,"${CALLERID}"
exten => 45,1,AGI,seek-test.agi
exten => 46,1,Goto,default|9009|1
exten => 47,1,Dial,IAX/critch
exten => 48,1,Dial,IAX/asttest at steven
exten => 49,1,Record,prompt:gsm

exten => 5,1,MP3Player,http://changed.com:8000/radio ; Dial in listen to our jukebox
exten => 5,2,goto,s|5

exten => 6,1,Agi,haiku.pl
exten => 6,2,Hangup

;exten => 6,2,Background,prompt
;exten => 6,3,Goto,default|9004|1

; Pulls jokes that came from fortune, and are properly formatted from my database
exten => 81,1,PGSQL,"Connect connid host=localhost user=CHANGED dbname=pbx";
exten => 81,2,PGSQL,"Query resultid ${connid} Select floor(random() * count(distinct mid) + 1) as jokeid from messages";
exten => 81,3,PGSQL,"Fetch fetchid ${resultid} jokeid";
exten => 81,4,PGSQL,"Query resultid ${connid} Select message,char_length(message) from messages where mid = ${jokeid} order by uid asc";
exten => 81,5,PGSQL,"Fetch fetchid ${resultid} message strlen";
exten => 81,6,GotoIf,${strlen}?81|100:81|8;
exten => 81,7,Goto,t|1
exten => 81,8,Festival,${message}
exten => 81,9,GotoIf,${fetchid}?81|100:81|5
exten => 81,100,Wait,1
exten => 81,101,Festival,"Good bye"
exten => 81,102,Goto,t|1

exten => 88,1,Dial,Console/dsp
exten => 88,2,Hangup

exten => t,1,Hangup
[extensions]
; Shouldn't end up in a s extension.
exten => s,1,Wait,0
exten => s,2,Answer
exten => s,3,DigitTimeout,5
exten => s,4,ResponseTimeout,10
exten => s,5,BackGround,demo-congrats

; All of us
exten => 104,1,Dial,Zap/25&Zap/26&Zap/29&Zap/32&Zap/30&Zap/28|15|t
exten => 104,2,Voicemail,u104
exten => 104,3,Goto,h
exten => 104,101,Voicemail,b104
exten => 104,102,Goto,h

; this eventually will be replaced with macros.

; Philip
exten => 110,1,Playback,transfer
exten => 110,2,Dial,Zap/25|15|t
exten => 110,3,Voicemail,u110
exten => 110,4,Goto,s|4
exten => 110,103,Voicemail,b110
exten => 110,104,Goto,4

; Elizabeth
exten => 111,1,Playback,transfer
exten => 111,2,Dial,Zap/26|15|t
exten => 111,3,Voicemail,u111
exten => 111,4,Goto,s|4
exten => 111,103,Voicemail,b111
exten => 111,104,Goto,4

;Steven
exten => 112,1,Playback,transfer
exten => 112,2,Dial,Zap/29|15|t
exten => 112,3,Voicemail,u112
exten => 112,4,Goto,s|4
exten => 112,103,Voicemail,b112
exten => 112,104,Goto,4

;John
exten => 113,1,Playback,transfer
exten => 113,2,Dial,Zap/28|15|t
exten => 113,3,Voicemail,u113
exten => 113,4,Goto,s|4
exten => 113,103,Voicemail,b113
exten => 113,104,Goto,4

;Raquel
exten => 114,1,Playback,transfer
exten => 114,2,Dial,Zap/32|15|t
exten => 114,3,Voicemail,u114
exten => 114,4,Goto,s|4
exten => 114,103,Voicemail,b114
exten => 114,104,Goto,4

;Rick
exten => 115,1,Playback,transfer
exten => 115,2,Dial,Zap/30|15|t
exten => 115,3,Voicemail,u115
exten => 115,4,Goto,s|4
exten => 115,103,Voicemail,b115
exten => 115,104,Goto,4

#test
exten => 116,1,Dial,Zap/35

;Fax
exten => 199,1,Dial,Zap/33

exten => 200,1,Goto,extensions|s|1

exten => 8500,1,VoicemailMain
exten => 8500,2,Goto,s|6

[outside]
ignorepat => 9
; local
exten => _91NXXNXXXXXX,1,Dial,Zap/g1/${EXTEN}
exten => _9NXXXXXX,1,Dial,Zap/g1/${EXTEN}

[default]
include => meetme

exten => s,1,Answer
exten => s,2,DigitTimeout,5
exten => s,3,ResponseTimeout,10
exten => s,4,Goto,9004|1

include => extensions

exten => 0,1,Goto,104|1

; Main roll over
exten => 9004,1,SetCallerID("Main_Line <(615) 238-9004>")
exten => 9004,2,Background,Welcome
exten => 9004,3,Wait,2
exten => 9004,4,Goto,104|1

exten => 5,1,MP3Player,http://changed.com:8000/radio
exten => 5,2,goto,s|5   ; allows me to # to resync the mpsplayer

; fax
exten => 9005,1,SetCallerID("Fax_line <(615) 238-9005>")
exten => 9005,2,Goto,199|1

;tech
exten => 9006,1,SetCallerID("Tech_line <(615) 238-9006>")
exten => 9006,2,Setvar,REDIRECT=${EXTEN}
exten => 9006,3,Goto,techoncall|1|1

; unused
exten => 9007,1,SetCallerID("unused_line <(615) 238-9007>")
exten => 9007,2,Goto,9004|2

; unused
exten => 9008,1,SetCallerID("unused_line <(615) 238-9008>")
exten => 9008,2,AGI,rectest.agi

;dvr
exten => 9009,1,SetCallerID("unused_line <(615) 238-9009>")
;exten => 9009,2,AGI,dvr-vandy.agi
;exten => 9009,2,AGI,dvr.agi
exten => 9009,2,Goto,testing|s|1
exten => 9009,4,Hangup

; Philip
exten => 9010,1,SetCallerID("Call_to_Phillip <(615) 238-9010>")
exten => 9010,2,Goto,110|2

; Elizabeth
exten => 9011,1,SetCallerID("Call_to_Elizabeth <(615) 238-9011>")
exten => 9011,2,Goto,111|2

;Steven
exten => 9012,1,SetCallerID("Call_to_Steven <(615) 238-9012>")
exten => 9012,2,Goto,112|2

;John
exten => 9013,1,SetCallerID("Call_to_John <(615) 238-9013>")
exten => 9013,2,Goto,113|2

;Raquel
exten => 9014,1,SetCallerID("Call_to_Raquel <(615) 238-9014>")
exten => 9014,2,Goto,114|2


; Rick
exten => 9015,1,SetCallerID("Call_to_Rick <(615) 238-9015>")
exten => 9015,2,Goto,115|2

; unused
exten => 9016,1,SetCallerID("Unused_line <(615) 238-9016>")
exten => 9016,2,Goto,9004|2

; unused
exten => 9017,1,SetCallerID("Unused_line <(615) 238-9017>")
exten => 9017,2,Goto,9004|2

; unused
exten => 9018,1,SetCallerID("Unused_line <(615) 238-9018>")
exten => 9018,2,Goto,9004|2

; unused
exten => 9019,1,SetCallerID("Unused_line <(615) 238-9019>")
exten => 9019,2,Goto,9004|2

; unused
exten => 9020,1,SetCallerID("Unused_line <(615) 238-9020>")
exten => 9020,2,Setvar,REDIRECT=${EXTEN}
exten => 9020,3,Goto,techoncall|1|1

; unused
exten => 9021,1,SetCallerID("Unused_line <(615) 238-9021>")
;exten => 9021,2,Goto,internal|81|1

; unused
exten => 9022,1,SetCallerID("Unused_line <(615) 238-9022>")
exten => 9022,2,Goto,internal|6|1

; unused
exten => 9023,1,SetCallerID("Calling_Stevens_Home <(615) 238-9023>")
exten => 9023,2,Dial,IAX/critch

[techoncall]
include => outside
exten => 1,1,PGSQL,"Connect connid host=localhost user=CHANGED dbname=pbx";
exten => 1,2,PGSQL,"Query resultid ${connid} Select ext from forwards where line = ${REDIRECT}";
exten => 1,3,PGSQL,"Fetch fetchid ${resultid} outsideline";
exten => 1,4,PGSQL,"Clear ${resultid}";
exten => 1,5,PGSQL,"Disconnect ${connid}";
; Call the outside line first to make sure it rings, then all inside extensions at the same time
exten => 1,6,Dial,Zap/g1/${outsideline}&Zap/25&Zap/26&Zap/29&Zap/32&Zap/30&Zap/28

[meetme]

exten => 20,1,Playback,enterconf
exten => 20,2,MeetMeCount,1
exten => 20,3,Playback,enterconf1
exten => 20,4,MeetMe,1
exten => 20,5,Goto(default|9004|1)

exten => 21,1,Playback,enterconf
exten => 21,2,MeetMeCount,2
exten => 21,3,Playback,enterconf1
exten => 21,4,MeetMe,2
exten => 21,5,Goto(default|9004|1)

exten => 22,1,Playback,enterconf
exten => 22,2,MeetMeCount,3
exten => 22,3,Playback,enterconf1
exten => 22,4,MeetMe,3
exten => 22,5,Goto(default|9004|1)


[phreaknic]
; left over from phreaknic 6. I used sample.call to harass Mabverisk with this
exten => 1,1,Festival,"There are girls stripping in room 212, bring dollar bills."
exten => 1,2,Hangup


-- 
Steven Critchfield  <critch at basesys.com>




More information about the asterisk-users mailing list