;
; example "extensions.conf" (Also see "capi.conf" example)
;
; FreeBSD: /usr/local/etc/asterisk/extensions.conf
; NetBSD:  /usr/pkg/etc/asterisk/extensions.conf
; Linux:   /etc/asterisk/extensions.conf
;

[isdn_in_te]

; exten   => _0.,1,NoOp(Invalid incoming call ${EXTEN})
; exten   => _X.,1,Goto(isdn_in,${EXTEN},1)

[isdn_in_nt]

;
; Override the caller ID that the telephone
; provided.
;
; exten   => _X.,1,SetCallerID(004711111111)

;
; Go to next context with the current
; telephone number.
;
; exten   => _X.,2,Goto(isdn_in,${EXTEN},1)

;
; Alternative way to handle DID. 
; Set "isdnmode=msn" in "capi.conf".
; Requires that the phone generates
; DTMF.
; 

; exten => s,1,Wait,1
; exten => s,2,Answer
; exten => s,3,DigitTimeout,5
; exten => s,4,ResponseTimeout,10

[isdn_in]

;
; The following lines will forward calls for numbers
; starting with '0' to the external ISDN network, and accept
; additional digits, due to the '.'. The ':1' will cause the 
; '0' to be removed from the destination telephone number. 
; When one dials 0333, 333 will be dailed. When one dails 
; 0222, 222 will be dailed, and so on. Remove ':1' if that is
; not desired. Explanation of the '/bo' options: 'b' means 
; early-B3 and 'o' means overlap sending. 'l' means want late 
; inband signalling.
;
; IMPORTANT: if the caller-id is not valid, then override
; it using the "SetCallerID()" application, or insert
; "01234:" before "${EXTEN:1}" below, where "01234" is 
; your telephone number. Else the telephone network might
; reject the call! A single ":" before "${EXTEN:1}" will 
; also work.
;
; exten => _0.,1,Dial(CAPI/ISDN1/${EXTEN:1}/bl,60)
; exten => _0.,2,Hangup


;
; Pseudo-examples
;
; exten => _1.,1,Dial(CAPI/g<group>/[<callerid>:]<destination>[/<params>])
; exten => _1.,2,Dial(CAPI/contr<controller>/[<callerid>:]<destination>[/<params>])
; exten => _1.,3,Dial(CAPI/<interface-name>/[<callerid>:]<destination>[/<params>])
;
; Explanation:
;
; '<group>'    - can be a value, comma separated list of values or a range
;                using '-'. The according interface is found by searching a 
;                match with the 'group' specified in the capi.conf 
;                for each interface.
;
; '<callerid>' - this is optional and can be used to set the source telephone 
;                number withouth changing the initial channel's source 
;                telephone number.
;
; '<params>'   - this is optional and is used to set parameters for a call.
;                The parameters are a list of characters with the following
;                meaning:
;                   'b' :    early B3 on progress.
;                   'r' :    early B3 on alert.
;                   'l' :    early B3 on disconnect.
;                   'B' : no early B3 after disconnect (default).
;                   'd' : use the default caller id which is 
;                         set by 'defaultcid=' in 'capi.conf'
;                   'o' : use overlap sending of number.
;                        (Useful if additional digits shall be send 
;                         afterwards or together with 'b' to get 
;                         dialtone and then send the number, e.g. 
;                         if otherwise no progress tones are available)
;
; '<interface-name>' - this is mandatory and should not start with 
;                      'contr' or 'g', and should be specified in 
;                      'capi.conf'

;
; CAPI COMMANDS
; =============
;
; Call Deflection, forward an unanswerd call to another number:
;
; exten => s,1,capiCommand(deflect|12345678)
;
;
; Set holdtype. When the PBX wants to put the call on hold, 
; use the specified method. Also see "capi.conf".
;
; No hold:
; exten => s,1,capiCommand(holdtype|local)
;
; CAPI hold:
; exten => s,1,capiCommand(holdtype|hold)
;
; Notify hold (not implemented yet):
; exten => s,1,capiCommand(holdtype|notify)
;
;
; Hold, put an answered call on hold
;
; exten => s,1,capiCommand(hold)
;
;
; Retrieve, get a held call back
;
; exten => s,1,capiCommand(retrieve)
;
;
; Malicious Call Identification, Report a call of malicious nature.
;
; exten => s,1,capiCommand(malicious)
;
;
; Enable echosquelch:
;
; exten => s,1,capiCommand(echosquelch|yes)
;
; Disable echosquelch:
;
; exten => s,1,capiCommand(echosquelch|no)
;
;
; Receive FAX:
;
; exten => s,1,capiCommand(receivefax|/tmp/${UNIQUEID}|+49 6137 555123|Asterisk)

;
; The following lines will forward calls for 456 to someone
; running the IAX2 protocol:
;
; exten => _456,1,Dial(IAX2/somebody@somewhere.net,60,Tt)
; exten => _456,2,Hangup

;
; The following lines will forward calls for 457 to someone
; running the SIP protocol:
;
; exten => _457,1,Dial(SIP/somebody_else@somewhere.net,60,Tt)
; exten => _457,2,Hangup


; 
; The following lines will forward calls for 37041111,
; to the "demo" context after 9 seconds:
;
; exten => _37041111,1,Wait(9)
; exten => _37041111,2,Goto(demo,s,1)

;
; The following lines will set the display
; variable, which is a message that should
; be displayed on the ISDN phone:
;
; exten => s,1,Set(_DISPLAY="My friend")
; exten => s,2,Dial(CAPI/ISDN2/37042222/,60)
;

;
; The following lines will forward various destinations to
; the internal ISDN network:
;
; exten => _37042222,1,Dial(CAPI/ISDN2/37042222/,60)
; exten => _37043333,1,Dial(CAPI/ISDN2/37042222/,60)
; exten => _38324444,1,Dial(CAPI/ISDN2/38324444/,60)
; exten => _38355555,1,Dial(CAPI/ISDN2/38324444/,60)

;
; The following lines will forward all 7-digit numbers
; starting with '2' to an external SIP network:
;
; exten => _2XXXXXX,1,NoOp(Outgoing call to ${EXTEN})
; exten => _2XXXXXX,2,SetCallerID(2000201)
; exten => _2XXXXXX,3,Dial(SIP/${EXTEN}@other_network.com,60,Tt)
; exten => _2XXXXXX,4,Hangup

;
; The following lines will forward an incoming call to 
; multiple devices at the same time, separated by '&'
; in the 'Dial(' string:
;
; exten => 82834,1,NoOp(Call to 82834)
: exten => 82834,2,SetAccount(2000000)
; exten => 82834,3,Dial(CAPI/ISDN2/50/b&SIP/2000000&CAPI/ISDN1/0107801791111111111/bl)
;

;
; The following lines will playback a message
; for all invalid extensions:
;
; exten => i,1,Playback(invalid)
; exten => i,2,Wait(5)
; exten => i,3,Playback(invalid)
; exten => i,4,Wait(5)
; exten => i,5,Hangup
;

[out_isdn]

;
; The following lines will forward calls to numbers
; starting with '0' to the external ISDN network:
;
; This line is used for debugging and will print 
; a message on the Asterisk console:
; exten => _0X.,1,NoOp(Dialing ${EXTEN})
;
; This line sets the calling number:
; exten => _0X.,2,SetCallerID(82834)
;
; This line will hide the calling number:
; exten => _0X.,3,SetCallerPres(prohib_not_screened)
;
; This line allows presentation of the calling number (default):
; exten => _0X.,4,SetCallerPres(allowed)
;
; This line dials the external number:
; NOTE: if the destination number is not complete,
; one should use the '/bol' options instead of '/bl'
; exten => _0X.,5,Dial(CAPI/ISDN1/${EXTEN}/bl,60)
;
; This line will tell asterisk to hangup:
; exten => _0X.,6,HangUp
;
; This line shows no early B3 and fake ring indication:
; exten => _X.,1,Dial(CAPI/ISDN1/${EXTEN},30,r)
;
; This line shows always early B3 and fake indicatons 
; if the exchange does not provide any indications:
; exten => _X.,1,Dial(CAPI/contr1/${EXTEN}/b,30,r)
;
;
; This line shows early B3 on success and fake indications
; if the exchange does not provide any indications:
; exten => _X.,1,Dial(CAPI/contr1/${EXTEN}/B,30,r)
;
;
; For normal PBX usage one would use the 'b' parameter, always early B3.
;

;
; Overlap sending (a.k.a. real dialtone)
;
; By dialing an empty number the channel will come up at once and give
; one the dialtone it gets from the local exchange. At this point the
; channel is like a legacy phone, now one can send DTMF digits to
; dial.
;
; exten => s,1,Dial(CAPI/ISDN1//b)
;