; 2006-04-24 05:06 GMT syedsauds@gmail.com
;
; I was thinking since long that how should i explain about Asterisk dialplain stuff. ; finally i figured out let’s simply put extensions.conf file with prettly understandable comments.

; This is the extensions.conf file for ’s Asterisk server Asterisk can be found at:
; http://www.asterisk.org/
;
; More recent versions of this file can be found on:
; http://www.tele.pk/forum/


;
;
; To view this file with none of my comments, simply use grep -v \; extensions.conf
; to remove comments. I only create comments one per line, even though trailing
; comments are permitted.
;
; This file determines where calls are routed when they are handed to Asterisk by
; one of various or analog call presentation channels.
; Configuration for those channels are found elsewhere in the /etc/asterisk directory,
; and examples can be found in my directory, listed above.
;
; This configuration (and all supporting files) assumes the use of an
; analog , BUT IT IS NOT REQUIRED.
; I use the card to terminate my house line and weave it into
; the dialplans below. It can be removed without much
; difficulty. For details on the ~$100 card, see:
; http://www.digium.com/
;
; Config notes:
; - in /usr/src//Makefile, set KFLAGS+=-DECHO_CAN_MARK2
; - in /usr/src//Makefile, set KFLAGS+=-DAGGRESSIVE_SUPPRESSOR
;
; I compile with these two as it seems they
; sound better with interacting with Zap (analog) devices.
;
;
; Known , Problems, Weirdnesses, etc.:
;
; 1) ATA-186 phones fail to stay registered. Something within
; Asterisk is causing ATA-186 phones to stop sending REGISTER
; requests after ~2 hours. Experiments with 30 through 240
; second on the have similar results. Phone
; registry times out, calls fail. (2003-04-14 - unsure if this
; is fixed via Asterisk or via the ATA-186 v2.16 20030411 update)
;
; 2) relay through ATA-186 phones on SIP calls. I’m
; uncertain if this is an ATA-186 issue or not; some in-depth
; prodding seems to show that it’s an Asterisk problem, or lack
; of a feature. reaches Asterisk, codes are shown on the
; console (in-band RFC2833) but are not played out the remote
; SIP channel; only slight garbled noise is heard. Analog
; replay works fine (ATA -> Asterisk -> ) Perhaps an
; origination problem with RFC2833 in-band signalling within
; Asterisk. I’ve tried changing to in-band signalling on the
; ATA-186 (AudioMode: 0×00050005) without success as well.
; 2003-02-17: calls originating with PSTN -> iconnect -> * -> ATA
; seem to transmit correctly in the ATA -> * -> …
; direction. Just when calls are originated with the ATA
; does not get sent from the ATA, so this is looking
; more like an * problem.
; 2003-02-19: not so fast. I can hear the from inbound
; calls via SIP, but * is not recognizing the tones. Thus,
; transmission and reception does not seem to work for me.
; 2003-04-14: This seems to be just problematic with iconnecthere.
; Others claim to have made it work, but requests for config
; examples have gone unanswered.
;
; 3) Timers for register= commands should be selectable on a
; per-peer basis. (Packet8, as an example, requires 15 second
; REGISTER intervals. My SIP peers don’t. Least common
; denominator sucks; glad I don’t use Packet8 now.)
;
; 5) In my call recording macros, I can’t get the “h” extensions to
; work correctly if the originating leg hangs up first. The
; macro runs only the first item in the priority list, and then
; quits. See my mail to the list about this.
; (asterisk-users 2003-04-20 “Macros not working as expected with
; extension “h” in some circumstances”)
;
; 6) I’d really like to be able to know what kind of errors are being
; produced, so I can do some reasonable reporting to the end user.
; This is really becoming a big problem with handling SIP
; connection failures or the huge variety of problems that seem
; to crop up with . See my mail to the list on this for
; a variable that would be handed back to the call flow so that
; the configuration could be modified accordingly
; (asterisk-dev 2003-04-06 “Call completion/error codes and
; extensions.conf call flow”)
;
; 7) The ability to press a key in mid-call and have something happen
; needs to be slightly extended. I’d like to have a digit of
; my choosing create a jump to another extension (like “h” and
; “s” maybe it could be a special extension like “t”?) and then
; I would like the ability to re-connect the conversation. This
; would be for things like turning on call recording, turning up
; the volume, starting a timer, starting a quick conference with pre-selected
; particpants, playing a short file, etc.
; (asterisk-users 2003-04-07 “Comments on ‘transfer’ feature request”)
;
;
; To-Do:
; - get one-key conference going between extensions so we
; can talk to friends/relatives on different phones but
; without complexity of meeting rooms (note: hinges on
; a feature request that I’ve put in for mid-call
; auto-transfers.)
; - create external gateway for access to voicemail system
; - create external gateway to DISA (so I can call Asterisk
; from my cell phone, and dial to SIP peers)
; - create quantum teleporter; achieve financial independence
;
; Thanks to: Mark Spencer, Nathan Lutchansky, Martin Pycko,
; Tim Stewart, and the Open Source Asterisk development team for putting
; up with my questions, adding featuers, and dealing with
; my bug discoveries.
;
;
;
;
;
;
; 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=yes

; The [globals] context is where you can set variables that
; can be referenced elsewhere in the dialplan with ${VARIABLE}
;
; I decided that for ease of reference, I should create a variable
; called “PHONE1″ that I could set to the phone where I normally
; am found. I then set “ME” to be my extention, raw, for use
; with voicemail forwarding.
;
; Variable “PHONE2″ is the other ATA-186 in the house.
;
; Variable “DIALOUTANALOG” is the analog interface () card
; in the PC on my desk. See zapta.conf for config details.
;
; Variable “FWDUSERID” is my User ID from Free World Dialup.
;
; Variable “IAXINFO” is the username:password for my account
; at Gnophone’s IAXTEL. (http://www.iaxtel.com/directory/)
;
; Variable “MYIAXTELNUMBER” is my number at IAXTEL. Yes,
; 700-555-1212 is really, actually my number (as opposed to
; all the bogus numbers I’ve scattered through this file to
; anonymize the configuration.) I expect a lot of calls for
; people wanting “directory assistance” :-)
;
; I create variables here so that if I decide to update my
; extensions list, or my dial-out interface list, it’s just
; a simple variable change here at the top of the file.
;
[globals]
PHONE1=SIP/2203
PHONE1VM=2203

PHONE2=SIP/2204
PHONE3=SIP/2205

DIALOUTANALOG=Zap/1

FWDUSERID=11001
FWDUSERNAME=John Todd

IPTELUSERID=1234567
IPTELUSERNAME=jtodd@loligo.com

ICONNECT1=14155551212

MYNAME=John Todd
MYASN=32767

IAXINFO=someusername:somepasswordhere
MYIAXTELNUMBER=17005551212

MYHOMEPHONE=5036661212
MYCELLPHONE=13127771212

; These variables are to avoid the irritating problem
; with inability to use regexp’s on strings that have
; not been defined.
;
CALLFILENAME=foo
FOO=foo

; Any context starting with “macro-” is treated as
; a macro. Since I dial out through iconnect fairly
; frequently, I’ll create a macro here for that routine.
; Note that I have to strip off any unwanted prefix
; characters before I call this macro, since iconnect
; only wants numbers in the form 1xxxyyyzzzz
;
; The system plays back an invalid extension recording if
; for some reason the call fails or errors out.
;
; I haven’t yet encountered calling someone who has had
; a busy signal. I am uncertain what will happen with
; the “busy” logic I put in, but I figured I’d throw
; it in there anyway to give the correct response to
; the user.
;
; This macro takes two arguments: ARG1 is the phone number
; to be dialed (including leading “1″) and ARG2 is the
; number of seconds that we should wait for an answer.
;
; Note: Due to iconnect’s quality sucking rocks over the
; last few days, I’ve switched to nufone via IAX for
; actual calls. Sorry if this is confusing…
;
[macro-dialiconnect]
exten => s,1,SetCallerID(${ICONNECT1})
exten => s,2,SetCIDName(${MYNAME})
exten => s,3,Dial(IAX/jtodd@nufone/${ARG1},100,T)
;exten => s,3,Dial(SIP/${ARG1}@iconnect,${ARG2})
exten => s,4,Playback(new/acnt-or-cir-busy-now)
exten => s,5,Hangup
exten => s,104,Playback(new/acnt-or-cir-busy-now)
exten => s,105,Wait,3
exten => s,106,Playtones(congestion)
exten => s,107,Wait,30
exten => s,108,Playback(new/are-you-still-here)
exten => s,108,Hangup
; When I dial something that throws an error, I expect
; to get a re-order (fast busy) tone. Well, since this
; system is more intelligent than that, I’d like to hear
; a bit more about what kind of error happened. However,
; that isn’t in the system yet, so I have to play an “all-circuits-busy”
; message that I recorded myself. I’d really rather know
; what the SIP (or ISDN, or whatever) error code was so that
; I could play a message appropriate to the error (hint, hint, kram)
;
[macro-fastbusy]
exten => s,1,Answer
exten => s,2,Wait 1
exten => s,3,Playback(new/all-circuits-busy)
exten => s,4,Wait(30)
exten => s,5,Hangup


Tags: , , , , , , , , , , , , , , ,

Related posts