Here is the complete contents of iax.conf and extensions.conf. Details obviously changed for privacy.
iax.conf:
[general]
register => 6662229999:666secret@iax.provider.com
register => 7773339999:777secret@iax.provider.com
[6662229999]
disallow=all
allow=ulaw
context=from-pstn
host=iax.provider.com
secret=666secret
type=friend
canreinvite=no
username=6662229999
qualify=yes
qualifyfreqok=500
trunk=yes
accountcode=Main
language=en
callerid="It's me!" <6662229999>
[7773339999]
type=user
context=7773339999-in
Extensions.conf:
[general]
static=yes
writeprotect=no
clearglobalvars=no
[globals]
DIAL_OPTIONS=tr
DIAL_TIMEOUT=40
[macro-prepend-cid]
exten => s,1,GotoIf($["${RGPREFIX}" = ""]?REPCID)
same => n,GotoIf($["${RGPREFIX}" != "${CALLERID(name):0:${LEN(${RGPREFIX})}}"]?REPCID)
same => n,Set(CALLERID(name)=${CALLERID(name):${LEN(${RGPREFIX})}})
same => n,Set(_RGPREFIX=)
same => n(REPCID),Set(_RGPREFIX=${ARG1})
same => n,Set(CALLERID(name)=${RGPREFIX}${CALLERID(name)})
;--== end of [macro-prepend-cid] ==--;
[from-pstn]
include = thisplace-welcome
include = thisplace-users
include = voicemail
include = directory
[from-internal]
include = thisplace-users
include = voicemail
include = directory
include = outgoing
[thisplace-welcome]
; IRV menus
exten => 6662229999,1,Verbose(Call received on main line)
same => n,Set(CHANNEL(language)=en)
; same => n,Answer()
same => n,Background(tpwelcome-2015-11)
same => n,WaitExten(5)
same => n,Background(tpwelcome-2015-11)
same => n,WaitExten(10)
same => n,Background(tpwelcome-2015-11)
same => n,WaitExten(10)
[thisplace-users]
;; Extension '0' Rings phone 1
exten => 0,1,Verbose(Call received to General0)
same => n,Macro(prepend-cid,General:)
; same => n,Dial(SIP/Linksys1,${DIAL_TIMEOUT},${DIAL_OPTIONS})
same => n,Dial(SIP/Gold1,${DIAL_TIMEOUT},${DIAL_OPTIONS})
same => n,voicemail(1@thisplace-voicemail,u)
same => n,Wait(2)
same => n,Hangup()
;; Extension '1'
exten => 1,1,Verbose(Call received to Ext1)
same => n,Macro(prepend-cid,Ext1:)
; same => n,Dial(SIP/Linksys1,${DIAL_TIMEOUT},${DIAL_OPTIONS})
same => n,Dial(SIP/Gold1,${DIAL_TIMEOUT},${DIAL_OPTIONS})
same => n,voicemail(1@thisplace-voicemail,u)
same => n,Wait(2)
same => n,Hangup()
;; Extension '2'
exten => 2,1,Verbose(Call received to Ext2)
same => n,Macro(prepend-cid,Ext2:)
; same => n,Dial(SIP/Linksys2,${DIAL_TIMEOUT},${DIAL_OPTIONS})
same => n,Dial(SIP/Gold2,${DIAL_TIMEOUT},${DIAL_OPTIONS})
same => n,voicemail(2@thisplace-voicemail,u)
same => n,Wait(2)
same => n,Hangup()
;; Extension '3'
exten => 3,1,Verbose(Call received to Ext3)
same => n,Set(CALLERID(num)=0003339999)
same => n,Set(CALLERID(name)=thisplace)
;; Uncomment one of the following
;; MG's cell
same => n,Goto(Outbound-Internal-Dial,0003339999,1)
;; Extension '4'
exten => 4,1,Verbose(Call received to Ext4)
same => n,Macro(prepend-cid,Ext4:)
same => n,Dial(SIP/Aastra4,${DIAL_TIMEOUT},${DIAL_OPTIONS})
same => n,voicemail(4@thisplace-voicemail,u)
same => n,Wait(2)
same => n,Hangup()
;; Extension '5'
exten => 5,1,Verbose(Call received to Ext5)
same => n,Macro(prepend-cid,Ext5:)
; same => n,Dial(SIP/Linksys2,20,${DIAL_OPTIONS})
same => n,Dial(SIP/Gold2,20,${DIAL_OPTIONS})
same => n,voicemail(5@thisplace-voicemail,u)
same => n,Wait(2)
same => n,Hangup()
;; Extension '6'
exten => 6,1,Verbose(Call received to Ext6)
same => n,Macro(prepend-cid,Ext6:)
same => n,Dial(SIP/Phone6,20,${DIAL_OPTIONS})
same => n,Wait(2)
same => n,Hangup()
;; Extension '7'
exten => 7,1,Verbose(Call received to Cell)
same => n,Goto(Outbound-Internal-Dial,1234567899,1)
;; Extension '9'
exten => 9,1,Verbose(Call received to Cell)
same => n,Goto(Outbound-Internal-Dial,9876543211,1)
;; Extension '11'
exten => 11,1,Verbose(Call received to Cell)
same => n,Goto(Outbound-Internal-Dial,8528528522,1)
;; Extension '23'
exten => 23,1,Verbose(Call received to Cell)
same => n,Goto(Outbound-Internal-Dial,9639639633,1)
;; Extension '12'
exten => 12,1,Verbose(Call received to Cell)
same => n,Goto(Outbound-Internal-Dial,7417417411,1)
;; Extension '24'
exten => 24,1,Verbose(Call received to cell)
same => n,Goto(Outbound-Internal-Dial,7897897899,1)
; Outbound-Internal-Dial
;
; This is the single point for dialing "internal" extensions that are actually external
[Outbound-Internal-Dial]
; Dial outbound through our IAX Trunk.
exten => _X.,1,Set(CDR(accountCode)=Int-6662229999)
same => n,Set(CALLERID(num)=6662229999)
same => n,Set(CALLERID(name)="thisplace Forward")
same => n,Set(CALLERID(all)="thisplace Forward" <6662229999>)
same => n,Dial(IAX2/6662229999/${EXTEN},60,${DIAL_OPTIONS})
same => n,Hangup()
; Outbound-Dial
;
; Before we dial, see if the extension matches our restricted number patterns.
; Note that this is a basic set of numbers which could incur a fee if dialed.
; The NANP includes many other numbers that you may want to block. If you feel
; it is necessary to block further number patterns you'll have to add them below
; or you may consider implementing a blacklist via methods beyond the scope of
; this example.
[Outbound-Dial]
; Dial outbound through our IAX Trunk.
exten => _X.,1,Set(CDR(accountCode)=Out-6662229999)
same => n,Set(CALLERID(num)=6662229999)
same => n,Set(CALLERID(name)=thisplace)
same => n,Set(CALLERID(all)="thisplace" <6662229999>)
same => n,Dial(IAX2/6136866736/${EXTEN},60,r)
same => n,Hangup()
[outgoing]
exten => _011X.,1,Goto(Outbound-Dial,${EXTEN},1)
exten => _911.,1,Goto(Outbound-Dial,${EXTEN},1)
; local 7 & 10 digit
exten => _NXXXXXX,1,Goto(Outbound-Dial,613${EXTEN},1)
exten => _666NXXXXXX,1,Goto(Outbound-Dial,${EXTEN},1)
; toll-free
exten => _1800NXXXXXX,1,Goto(Outbound-Dial,${EXTEN},1)
exten => _1888NXXXXXX,1,Goto(Outbound-Dial,${EXTEN},1)
exten => _1877NXXXXXX,1,Goto(Outbound-Dial,${EXTEN},1)
exten => _1866NXXXXXX,1,Goto(Outbound-Dial,${EXTEN},1)
; non-local 10 && 11 digit
exten => _NXXNXXXXXX,1,Goto(Outbound-Dial,1${EXTEN},1)
exten => _1NXXNXXXXXX,1,Goto(Outbound-Dial,${EXTEN},1)
[voicemail]
exten => *98,1,Answer
same => n,VoiceMailMain(@thisplace-voicemail)
;exten => *98,n,VoiceMailMain(${CALLERID(num)}@thisplace-voicemail,s)
[directory]
exten => #,1,Answer()
same => n,Directory(thisplace-voicemail,thisplace-users)
exten => 9,1,Answer()
same => n,Directory(thisplace-voicemail,thisplace-users)