OK, here are sanitized versions of my sip.conf and extensions.conf
;------------------------------
;Relevant portions of my SIP.Conf
;------------------------------
[9004]
type=friend
secret=
host=dynamic
context=outgoing
dtmfmode=rfc2833
nat=yes
subscribecontext=BLF_Group_1
call-limit=20
mailbox=9004@office
deny=0.0.0.0/0
permit=IP.IP.IP.IP/24
[8004]
type=friend
secret=
host=dynamic
context=outgoing
dtmfmode=rfc2833
nat=yes
subscribecontext=BLF_Group_1
call-limit=20
mailbox=8004@office
deny=0.0.0.0/0
permit=IP.IP.IP.IP/24
;------------------------------------------
;Relevant portions of Extensions.conf
;-------------------------------------------
[global]
[default]
[inbound]
;---------------------
;DID Lines
;---------------------
exten => 19999994005,1,Goto(inbound,9004,1)
exten => 19999994126,1,Goto(inbound,8004,1)
exten => 19999992677,1,Answer()
exten => 19999992677,n,Wait(1)
exten => 19999992677,n,Background(/var/asterisk/Prompts/JSI_Welcome01)
exten => 19999992677,n,Background(/var/asterisk/Prompts/JSI_Welcome02)
exten => 19999992677,n,Background(/var/asterisk/Prompts/JSI_Extension9004)
exten => 19999992677,n,Background(/var/asterisk/Prompts/JSI_Extension8004)
exten => 19999992677,n,wait(5)
exten => 19999992677,n,goto(19999992677,1)
; ---------------------------------------
; – Extension (Dial Desktop)
; ---------------------------------------
exten => 8004,1,Answer()
exten => 8004,n,Set(cCallerID=CompanyName, Inc. <9999992677>)
exten => 8004,n,Wait(1)
exten => 8004,n,Playback(/var/asterisk/Prompts/JSI_Recorded)
exten => 8004,n,Set(CDRGUID=UnAssigned)
exten => 8004,n,AGI(PBXInitiateCall.php,${CALLERID(num)},${EXTEN:0},8,${CALLERID(name)})
exten => 8004,n,AGI(PBXStartBilling.php,${CDRGUID})
exten => 8004,n,Mixmonitor(/var/asterisk/${CDRGUID}.wav)
exten => 8004,n,Set(CALLERID(all)=${cCallerID})
exten => 8004,n,Set(__PICKUPMARK=8003)
exten => 8004,n,Dial(SIP/8003,30)
exten => 8004,n,VoiceMail(8003@office)
exten => 8004,n,Hangup()
; ---------------------------------------
; – Extension (Dial Cell and Desktop)
; ---------------------------------------
exten => 9004,1,Answer()
exten => 9004,n,Set(cCallerID=CompanyName, Inc. <9999992677>)
exten => 9004,n,wait(1)
exten => 9004,n,Playback(/var/asterisk/Prompts/JSI_Recorded)
exten => 9004,n,Set(CDRGUID=UnAssigned)
exten => 9004,n,AGI(PBXInitiateCall.php,${CALLERID(num)},${EXTEN:0},8,${CALLERID(name)})
exten => 9004,n,AGI(PBXStartBilling.php,${CDRGUID})
exten => 9004,n,Set(CALLERID(all)=${cCallerID})
exten => 9004,n,Mixmonitor(/var/asterisk/${CDRGUID}.wav)
exten => 9004,n,Set(__PICKUPMARK=9004)
exten => 9004,n,Dial(SIP/9004,40)
exten => 9004,n,VoiceMail(9004@office)
exten => 9004,n,Hangup()
; ---------------------------------------
; – When a call is hungup
; ---------------------------------------
exten => h,1,NoOp(Call was Hungup)
exten => h,n,NoOp(${HANGUPCAUSE})
exten => h,n,AGI(PBXEndBilling.php,${CDRGUID})
exten => h,n,AGI(PBXTerminateCall.php,${CDRGUID},${HANGUPCAUSE},${GOTO_ON_BLINDXFR},${TRANSFER_CONTEXT},${BLINDTRANSFER},${UNIQUEID})
[outgoing]
include => inbound
include => voicemail
exten => _1.,1,Set(CDRGUID=UnAssigned)
exten => _1.,n,AGI(PBXInitiateCall.php,${CALLERID(num)},${EXTEN:0},8,${CALLERID(name)})
exten => _1.,n,AGI(PBXStartBilling.php,${CDRGUID})
exten => _1.,n,Set(CALLERID(all)=“CompanyName, Inc.” <9999992677>)
exten => _1.,n,Mixmonitor(/var/asterisk/${CDRGUID}.wav)
exten => _1.,n,Dial(SIP/88888888*${EXTEN:0}@flowroute)
; --------------------------------------
; – To support Line Pickup
; --------------------------------------
exten => _**9XXX,1,Pickup(${EXTEN:2}@PICKUPMARK)
exten => _**9XX,n,Hangup()
exten => _**8XXX,1,Pickup(${EXTEN:2})
exten => _**8XXX,n,Hangup()
[macro-screen]
exten => s,1,Wait(0.2)
exten => s,n,set(CDRGUID=${ARG2})
exten => s,n,NoOp(GUID coming next)
exten => s,n,NoOp(${CDRGUID})
exten => s,n,Playback(/var/lib/asterisk/JPSSounds/screen-from)
exten => s,n,Playback(${ARG1})
exten => s,n,Read(ACCEPT,/var/lib/asterisk/JPSSounds/screen-accept,1)
exten => s,n,GotoIf($[${ACCEPT} = 1 ] ?yes:no)
;exten => s,n(yes),Set(MACRO_RESULT=CONTINUE)
exten => s,n(yes),AGI(JPSStartBilling.php,${CDRGUID})
exten => s,n(no),System(/bin/rm ${ARG1})
[BLF_Group_1]
exten => 9004,hint,SIP/9004
exten => 8004,hint,SIP/8004