Hello
all. I've been searching and can't quite find what I'm looking
for...
I've
gotten AMP installed and up and running quite decently on an Asterisk box and am now in the
process of tweaking it to my needs. My company currently has around 70
employees and we are running on a complete Avaya system, but this system is no
longer going to work for us (too much money for not enough stuff). So I
have been put in charge of setting up an Asterisk PBX and get an entire test
system going on it to see if Asterisk will
meet our telephone needs. Extensions, queues, voicemail,
stats, etc etc. Here's the problem: this Asterisk server is actually
currently running live, serving information to people calling in to it. I
need my test office setup, with AMP and this other system to work
simultaneously, but yet totally separate. As my stuff is for a test, I
would like to set it up so that when I dial in TO my Asterisk
PBX FROM a specific telephone number, it takes me to my office test section
in asterisk, otherwise, from ANY other number, it dials the info serving
section. This would allow me to call from a certain telephone number
and be able to get to my test office setup, but if anybody else calls from
any other number, they get the other stuff. Doesn't sound too bad
right?
So how
would one do this using AMP if AMP is more of the "secondary" system? If I
understand correctly, to add additional, custom contexts to extensions.conf, it
should be entered into extensions_additional.conf and the contexts should
contain the word "custom" in them. So, first question, what if I want that
custom context to be the first context (as in possibly the default context), but
only if it's from a certain telephone number...? I assume you
would enter that custom context as the context in zapata.conf,
but how would you tell it to go back to the AMP stuff if the FROM telephone
number is my speicifc telephone number? What context would I send it to so
that it will do the regular AMP stuff? (Incidentally, I have a local
telephone number and an 888 telephone number coming into my PRI, but when
called, my Asterisk PBX views/receives them both as the local telephone
number.)
Also,
what if my custom contexts in extensions_additional.conf call macros? Do
my macro names need to contain the word "custom" as well?
Where
to put my nineoneone context for it to utilize the defined
globals?
Below is my current extensions.conf file. (My
extensions_additional.conf is currently empty.) The first part is
the custom stuff that I use to serve up the info when customers call in. I believe
this is what should be moved to the extensions_additional.conf... I didn't
post the entire extensions.conf file as the rest is the standard stuff set up by
AMP. Any suggestions?
Thanks,
Ben
Ferguson
[general]
static=yes
writeprotect=yes
static=yes
writeprotect=yes
IAXINFO=guest
; IAXtel
username/password
TRUNK=Zap/g1 ; Trunk interface
TRUNKMSD=1 ; MSD digits to strip (usually 1 or 0)
TRUNK=Zap/g1 ; Trunk interface
TRUNKMSD=1 ; MSD digits to strip (usually 1 or 0)
[globals]
EMERGENCY=0
EMERGENCY_TRUNK=Zap/17
; Change this for production use:
EMERGENCY_NUM=911
EMERGENCY_TRUNK=Zap/17
; Change this for production use:
EMERGENCY_NUM=911
[nineoneone]
exten => s,1,SetVar(SET_EMERG_FLAG=0)
exten => s,n(checkavail),ChanIsAvail(${EMERGENCY_TRUNK})
exten => s,n,SetGlobalVar(EMERGENCY=1)
exten => s,n,SetVar(SET_EMERG_FLAG=1)
exten => s,n(dial),Dial(${EMERGENCY_TRUNK}/${EMERGENCY_NUM})
exten => s,s+2(trunkbusy),GotoIf($[${EMERGENCY} = 1]?inprogress)
exten => s,n,SoftHangup(${EMERGENCY_TRUNK}-1)
exten => s,n,Wait(12)
exten => s,n,Goto(checkavail)
exten => s,s+2(inprogress),Congestion
exten => s,checkavail+101(notavail),Goto(trunkbusy)
exten => h,1,GotoIf($[${SET_EMERG_FLAG} = 1]?3)
exten => h,3,SetGlobalVar(EMERGENCY=0)
exten => t,1,goto(s,1)
exten => s,1,SetVar(SET_EMERG_FLAG=0)
exten => s,n(checkavail),ChanIsAvail(${EMERGENCY_TRUNK})
exten => s,n,SetGlobalVar(EMERGENCY=1)
exten => s,n,SetVar(SET_EMERG_FLAG=1)
exten => s,n(dial),Dial(${EMERGENCY_TRUNK}/${EMERGENCY_NUM})
exten => s,s+2(trunkbusy),GotoIf($[${EMERGENCY} = 1]?inprogress)
exten => s,n,SoftHangup(${EMERGENCY_TRUNK}-1)
exten => s,n,Wait(12)
exten => s,n,Goto(checkavail)
exten => s,s+2(inprogress),Congestion
exten => s,checkavail+101(notavail),Goto(trunkbusy)
exten => h,1,GotoIf($[${SET_EMERG_FLAG} = 1]?3)
exten => h,3,SetGlobalVar(EMERGENCY=0)
exten => t,1,goto(s,1)
[local]
;
; Master context for local, toll-free, and iaxtel calls only
;
ignorepat => 9
include => default
[default]
exten => s,1,Answer
exten => s,2,Wait(1)
exten => s,3,Background(cc_welcome)
exten => s,1,Answer
exten => s,2,Wait(1)
exten => s,3,Background(cc_welcome)
;if someone enters a tour
number
exten => _XXXXXX,1,AGI(getAudioFile.php,${EXTEN})
exten => _*XXXXXX,1,AGI(loanOfficerLogin.php,${EXTEN})
exten => _XXXXXX,1,AGI(getAudioFile.php,${EXTEN})
exten => _*XXXXXX,1,AGI(loanOfficerLogin.php,${EXTEN})
;if someone enters an invalid
extension
exten => i,1,Playback(cc_sorry)
exten => i,1,Playback(cc_sorry)
;timeout
exten => t,1,goto(s,2)
exten => t,1,goto(s,2)
;incoming numbers
exten => 5555551212,1,goto(s,1)
exten => 8885551212,1,goto(s,1)
exten => 5555551212,1,goto(s,1)
exten => 8885551212,1,goto(s,1)
;*********************************
;*** Message Sections
;*********************************
[macro-setPinVars]
exten => s,1,SetGlobalVar(LAST_AUDIO=${ARG1})
exten => s,2,SetGlobalVar(AGENT_PIN=${ARG2})
exten => s,3,SetGlobalVar(HAS_AUDIO=${ARG3})
exten => s,4,goto(getSponserPin,s,1)
;*** Message Sections
;*********************************
[macro-setPinVars]
exten => s,1,SetGlobalVar(LAST_AUDIO=${ARG1})
exten => s,2,SetGlobalVar(AGENT_PIN=${ARG2})
exten => s,3,SetGlobalVar(HAS_AUDIO=${ARG3})
exten => s,4,goto(getSponserPin,s,1)
[getSponserPin]
exten => s,1,Background(agent-pass)
;exten => s,1,SayDigits(${AGENT_PIN})
exten => ${AGENT_PIN}#,1,GotoIf($["${HAS_AUDIO}" = "yes"]?3:2)
exten => ${AGENT_PIN}#,2,goto(loRecordMessage,s,1)
exten => ${AGENT_PIN}#,3,goto(loHasMessage,s,1)
exten => s,1,Background(agent-pass)
;exten => s,1,SayDigits(${AGENT_PIN})
exten => ${AGENT_PIN}#,1,GotoIf($["${HAS_AUDIO}" = "yes"]?3:2)
exten => ${AGENT_PIN}#,2,goto(loRecordMessage,s,1)
exten => ${AGENT_PIN}#,3,goto(loHasMessage,s,1)
exten => i,1,Wait(1)
exten => i,2,Playback(cc_sorry)
exten => i,2,Playback(cc_sorry)
[loRecordMessage]
exten => s,1,Background(to-compose-a-message)
exten => s,2,Background(press-1)
exten => s,3,Background(T-to-rtrn-to-main-menu)
exten => s,4,Background(press-9)
exten => s,1,Background(to-compose-a-message)
exten => s,2,Background(press-1)
exten => s,3,Background(T-to-rtrn-to-main-menu)
exten => s,4,Background(press-9)
exten =>
1,1,Playback(vm-intro)
exten => 1,2,Record(/media/audio/cc/l${LAST_AUDIO}.gsm)
exten => 1,3,Playback(your-msg-has-been-saved)
exten => 1,4,goto(loHasMessage,s,1)
exten => 1,2,Record(/media/audio/cc/l${LAST_AUDIO}.gsm)
exten => 1,3,Playback(your-msg-has-been-saved)
exten => 1,4,goto(loHasMessage,s,1)
exten =>
9,1,goto(default,s,1)
exten =>
i,1,Playback(cc_sorry)
exten => t,1,goto(s,1)
exten => t,1,goto(s,1)
[loHasMessage]
exten => s,1,Background(press-1)
exten => s,2,Background(to-rerecord-yr-message)
exten => s,3,Background(press-2)
exten => s,4,Background(to-listen-to-it)
exten => s,5,Background(vm-delete)
exten => s,6,Background(T-to-rtrn-to-main-menu)
exten => s,7,Background(press-9)
exten => s,1,Background(press-1)
exten => s,2,Background(to-rerecord-yr-message)
exten => s,3,Background(press-2)
exten => s,4,Background(to-listen-to-it)
exten => s,5,Background(vm-delete)
exten => s,6,Background(T-to-rtrn-to-main-menu)
exten => s,7,Background(press-9)
exten => 1,1,goto(playLoMessage,s,1)
exten => 2,1,goto(loRecordMessage,1,1)
exten => 7,1,AGI(deleteAudio.php,${LAST_AUDIO})
exten => 7,2,Playback(vm-deleted)
exten => 7,3,goto(default,s,1)
exten => 9,1,goto(default,s,1)
exten =>
i,1,Playback(cc_sorry)
exten => t,1,goto(s,1)
exten => t,1,goto(s,1)
[playLoMessage]
exten => s,1,Background(/media/audio/cc/l${LAST_AUDIO})
exten => s,2,goto(loHasMessage,s,1)
exten => X,1,goto(loHasMessage,s,1)
exten => s,1,Background(/media/audio/cc/l${LAST_AUDIO})
exten => s,2,goto(loHasMessage,s,1)
exten => X,1,goto(loHasMessage,s,1)
;*********************************
;*** Main Sections
;*********************************
;*** Main Sections
;*********************************
[macro-playaudio]
exten => s,1,SetGlobalVar(LAST_AUDIO=${ARG1})
exten => s,2,SetGlobalVar(LO_FILE=${ARG2})
exten => s,3,MP3Player(/media/audio/a${ARG1}.mp3)
exten => s,4,goto(playsection,s,1)
exten => s,1,SetGlobalVar(LAST_AUDIO=${ARG1})
exten => s,2,SetGlobalVar(LO_FILE=${ARG2})
exten => s,3,MP3Player(/media/audio/a${ARG1}.mp3)
exten => s,4,goto(playsection,s,1)
[playsection]
exten => s,1,GotoIf($["${LO_FILE}" = "no"]?3:2)
exten => s,2,Playback(${LO_FILE})
exten => s,3,Wait(1)
exten => s,4,Background(cc_replay)
exten => s,1,GotoIf($["${LO_FILE}" = "no"]?3:2)
exten => s,2,Playback(${LO_FILE})
exten => s,3,Wait(1)
exten => s,4,Background(cc_replay)
exten => 1,1,macro(playaudio,${LAST_AUDIO},${LO_FILE})
exten => 2,1,goto(s,1)
exten =>
t,1,goto(s,1)
;*****************************************************************************************************
;*****************************************************************************************************
;*****************************************************************************************************
;*****************************************************************************************************
;*****************************************************************************************************
;*****************************************************************************************************
;*****************************************************************************************************
; Asterisk Management Portal
(AMP)
; Copyright (C) 2004 Coalescent Systems Inc
; Copyright (C) 2004 Coalescent Systems Inc
; dialparties.agi (http://www.sprackett.com/asterisk/)
; Asterisk::AGI (http://asterisk.gnuinter.net/)
; gsm (http://www.ibiblio.org/pub/Linux/utils/compress/!INDEX.short.html)
; loligo sounds (http://www.loligo.com/asterisk/sounds/)
; mpg123 (http://voip-info.org/wiki-Asterisk+config+musiconhold.conf)
; Asterisk::AGI (http://asterisk.gnuinter.net/)
; gsm (http://www.ibiblio.org/pub/Linux/utils/compress/!INDEX.short.html)
; loligo sounds (http://www.loligo.com/asterisk/sounds/)
; mpg123 (http://voip-info.org/wiki-Asterisk+config+musiconhold.conf)
; include extension contexts generated from AMP
#include extensions_additional.conf
; Customizations to this dialplan
should be made in extensions_custom.conf
; See extensions_custom.conf.sample for an example
#include extensions_custom.conf
; See extensions_custom.conf.sample for an example
#include extensions_custom.conf
[from-trunk]
include => from-pstn
include => from-pstn
[from-pstn]
include => from-pstn-custom ; create this context in extensions_custom.conf to include customizations
include => ext-did
include => from-pstn-timecheck ; this has to be included otherwise it overrides ext-did
exten => fax,1,Goto(ext-fax,in_fax,1)
include => from-pstn-custom ; create this context in extensions_custom.conf to include customizations
include => ext-did
include => from-pstn-timecheck ; this has to be included otherwise it overrides ext-did
exten => fax,1,Goto(ext-fax,in_fax,1)
[from-pstn-timecheck]
exten => _.,1,Goto(s,1)
exten => s,1,GotoIf($[${IN_OVERRIDE} = forcereghours]?from-pstn-reghours,s,1:)
exten => s,2,GotoIf($[${IN_OVERRIDE} = forceafthours]?from-pstn-afthours,s,1:)
exten => s,3,GotoIfTime(${REGTIME}|${REGDAYS}|*|*?from-pstn-reghours,s,1:)
exten => s,4,Goto(from-pstn-afthours,s,1)
exten => _.,1,Goto(s,1)
exten => s,1,GotoIf($[${IN_OVERRIDE} = forcereghours]?from-pstn-reghours,s,1:)
exten => s,2,GotoIf($[${IN_OVERRIDE} = forceafthours]?from-pstn-afthours,s,1:)
exten => s,3,GotoIfTime(${REGTIME}|${REGDAYS}|*|*?from-pstn-reghours,s,1:)
exten => s,4,Goto(from-pstn-afthours,s,1)
_______________________________________________ --Bandwidth and Colocation provided by Easynews.com --
Asterisk-Users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
