- ;EXTENSIONS_OVERRIDE_FREEPBX.CONF
- [extensions]
- exten => 2001,0,Goto(call-extension,${EXTEN},1)
- ; Note the duplication of the hint peername
- same => hint,SIP/2001,SIP/2001
- exten => 2452,0,Goto(call-extension,${EXTEN},1)
- same => hint,SIP/2452,SIP/2452
- exten => 2271,0,Goto(call-extension,${EXTEN},1)
- same => hint,SIP/2271,SIP/2271
- exten => 2861,0,Goto(call-extension,${EXTEN},1)
- same => hint,SIP/2861,SIP/2861
- [ext-local]
- exten => 2001,hint,SIP/${EXTEN},SIP/${EXTEN}
- exten => 2271,hint,SIP/${EXTEN},SIP/${EXTEN}
- exten => 2861,hint,SIP/${EXTEN},SIP/${EXTEN}
- exten => 2452,hint,SIP/${EXTEN},SIP/${EXTEN}
- ;SIP_CUSTOM_POST.CONF
- [cisco](!)
- cisco_usecallmanager=yes
- cisco_pickupnotify_alert=from,to
- cisco_pickupnotify_timer=5
- dndbusy=no
- rpid_update=yes
- rpid_immediate=yes
- allowsubscribe=yes
- notifyhold=yes
- [2452](+,cisco)
- subscribe=2001@ext-local,2861@ext-local
- [2001](+,cisco)
- subscribe=2452@ext-local
- [2861](+,polycom)
- subscribe=2452@ext-local
- [2271](+,cisco)
- subscribe=2452@ext-local
- ;EXTENSIONS_CUSTOM.CONF
- ; ----- External calls, lock codec to prevent video
- exten => _9,.,Set(__SIP_CODEC=alaw)
- same => next,Goto(outbound-allroutes,${EXTEN},1)
- ; ----- Feature codes, lock codec to prevent video
- exten => _*.,1,Set(__SIP_CODEC=g722)
- same => next,Goto(from-internal,${EXTEN},3)
- ; ----- CISCO custom
- [from-internal-custom]
- ; ----- Strip the x-cisco-serviceuri- prefix to make handling the cisco events in the dialplan a little simpler
- exten => _[x]-cisco-serviceuri-.,1,Goto(${EXTEN:19},1)
- ; ----- Group Pickup softkey
- exten => pickup,1,Pickup()
- same => next,Hangup(normal_circuit_congestion)
- ; ----- BLF Pickup softkey
- exten => _blfpickup-.,1,PickupChan(SIP/${EXTEN:10})
- same => next,Hangup(normal_circuit_congestion)
- ; ----- AdHoc call recording softkey
- exten => record,1,Answer()
- same => next,Wait(0.5)
- same => next,Set(CONFBRIDGE(bridge,record_conference)=yes)
- same => next,Set(CONFBRIDGE(bridge,record_file)=${RECORD_PEERNAME})
- same => next,Set(CONFBRIDGE(user,quiet)=yes)
- same => next,ConfBridge(${RECORD_UNIQUEID})
- same => next,Hangup(normal_clearing)
- ; Cisco SIP phones support displaying diversion information
- ; ** this part not currently working **
- ; exten => forward,SIPAddHeader(Diversion: "${SIPPEER(${PEERNAME},callerid_name)}" <sip:${PEERNAME}@localhost>\;screen=yes\;privacy=off)
- ; same => Goto(extensions,${CALLFORWARD},1)
- [call-extension]
- exten => _.,1,Set(PEERNAME=${EXTEN})
- ; By manually checking for call-forwarding, the call can be forwarded even if the phone is unregistered
- same => next,Set(CALLFORWARD=${SIPPEER(${PEERNAME},callforward)})
- same => next,GotoIf($[${LEN(${CALLFORWARD})} != 0]?callforward,1)
- same => next,Set(MAILBOX=${SIPPEER(${PEERNAME},mailbox)})
- ; Phones can be made to play a different ring using the Alert-Info header, see Ring Tones for examples
- same => next,ExecIf($[${LEN(${ALERT_INFO})} != 0]?SIPAddHeader(Alert-Info: <${ALERT_INFO}>))
- same => next,Dial(SIP/${PEERNAME},30)
- same => next,Goto(${TOLOWER(${DIALSTATUS})},1)
- ; Check if forwarded to the phone's voicemail extension
- exten => callforward,1,GotoIf($[${CALLFORWARD} = ${SIPPEER(${PEERNAME},vmexten)}]?busy,1)
- ; Cisco SIP phones support displaying diversion information
- same => next,Set(REDIRECTING(from-all,i)="${SIPPEER(${PEERNAME},callerid_name)}" <${SIPPEER(${PEERNAME},callerid_num)}>)
- same => next,Set(REDIRECTING(reason,i)=cfu)
- same => next,Goto(extensions,${CALLFORWARD},1)
- ; If ${MAILBOX} is empty send congestion, otherwise go to voicemail extension below
- exten => congestion,1,ExecIf($[${LEN(${MAILBOX})} = 0]?Congestion(10))
- same => next,Set(GREETING=u)
- same => next,Goto(voicemail,1)
- ; If ${MAILBOX} is empty send busy, otherwise go to voicemail extension below
- exten => busy,1,ExecIf($[${LEN(${MAILBOX})} = 0]?Busy(10))
- same => next,Set(GREETING=b)
- same => next,Goto(voicemail,1)
- exten => noanswer,1,Goto(congestion,1)
- exten => chanunavail,1,Goto(congestion,1)
- exten => voicemail,1,Answer()
- same => next,Wait(0.5)
- same => next,VoiceMail(${MAILBOX},${GREETING})
- same => next,Hangup(normal_clearing)
- ; Clear dial group first
- exten => 70001,0,Set(DIALGROUP(huntgroup)=)
- same => next,Set(PEERNAMES=301&302&303)
- same => next,While($[${LEN(${PEERNAMES})} != 0])
- same => next,Set(PEERNAME=${SHIFT(PEERNAMES,&)})
- ; Check if peer is logged-in to the hunt group and add them to the dial group if they are
- same => next,ExecIf($[${SIPPEER(${PEERNAME},huntgroup)} = yes]?Set(DIALGROUP(huntgroup,add)=SIP/${PEERNAME}))
- same => next,EndWhile()
- ; Send congestion if the dial group is empty
- same => next,ExecIf($[${LEN(${DIALGROUP(huntgroup)})} = 0]?Congestion(10))
- ; Phones support 'Answered Elsewhere' so the 'c' flag is included
- ; Later series need to be logged into the hunt-group and have CISCO_HUNTPILOT set to not record answered calls as missed
- same => next,Set(_CISCO_HUNTPILOT="Ring All" <${EXTEN}>)
- same => next,Dial(${DIALGROUP(huntgroup)},30,ic)
- same => next,Hangup(${HANGUPCAUSE})
- ; Clear dial group first
- exten => 70002,0,Set(DIALGROUP(huntgroup)=)
- same => next,Set(PEERNAMES=301&302&303)
- same => next,While($[${LEN(${PEERNAMES})} != 0])
- same => next,Set(PEERNAME=${SHIFT(PEERNAMES,&)})
- ; Check if peer is logged-in to the hunt group and add them to the dial group if they are
- same => next,ExecIf($[${SIPPEER(${PEERNAME},huntgroup)} = yes]?Set(DIALGROUP(huntgroup,add)=SIP/${PEERNAME}))
- same => next,EndWhile()
- ; Send congestion if the dial group is empty
- same => next,ExecIf($[${LEN(${DIALGROUP(huntgroup)})} = 0]?Congestion(10))
- ; Phones support 'Answered Elsewhere' so the 'c' flag is included
- ; Later series need to be logged into the hunt-group and have CISCO_HUNTPILOT set to not record answered calls as missed
- same => next,Set(_CISCO_HUNTPILOT="Ring All" <${EXTEN}>)
- same => next,Dial(${DIALGROUP(huntgroup)},30,ic)
- same => next,Hangup(${HANGUPCAUSE})
- ; Clear dial group first
- exten => 70003,0,Set(DIALGROUP(huntgroup)=)
- same => next,Set(PEERNAMES=301&302&303)
- same => next,While($[${LEN(${PEERNAMES})} != 0])
- same => next,Set(PEERNAME=${SHIFT(PEERNAMES,&)})
- ; Check if peer is logged-in to the hunt group and add them to the dial group if they are
- same => next,ExecIf($[${SIPPEER(${PEERNAME},huntgroup)} = yes]?Set(DIALGROUP(huntgroup,add)=SIP/${PEERNAME}))
- same => next,EndWhile()
- ; Send congestion if the dial group is empty
- same => next,ExecIf($[${LEN(${DIALGROUP(huntgroup)})} = 0]?Congestion(10))
- ; Phones support 'Answered Elsewhere' so the 'c' flag is included
- ; Later series need to be logged into the hunt-group and have CISCO_HUNTPILOT set to not record answered calls as missed
- same => next,Set(_CISCO_HUNTPILOT="Ring All" <${EXTEN}>)
- same => next,Dial(${DIALGROUP(huntgroup)},30,ic)
- same => next,Hangup(${HANGUPCAUSE})
- ; Clear dial group first
- exten => 20011,0,Set(DIALGROUP(huntgroup)=)
- same => next,Set(PEERNAMES=301&302&303)
- same => next,While($[${LEN(${PEERNAMES})} != 0])
- same => next,Set(PEERNAME=${SHIFT(PEERNAMES,&)})
- ; Check if peer is logged-in to the hunt group and add them to the dial group if they are
- same => next,ExecIf($[${SIPPEER(${PEERNAME},huntgroup)} = yes]?Set(DIALGROUP(huntgroup,add)=SIP/${PEERNAME}))
- same => next,EndWhile()
- ; Send congestion if the dial group is empty
- same => next,ExecIf($[${LEN(${DIALGROUP(huntgroup)})} = 0]?Congestion(10))
- ; Phones support 'Answered Elsewhere' so the 'c' flag is included
- ; Later series need to be logged into the hunt-group and have CISCO_HUNTPILOT set to not record answered calls as missed
- same => next,Set(_CISCO_HUNTPILOT="Ring All" <${EXTEN}>)
- same => next,Dial(${DIALGROUP(huntgroup)},30,ic)
- same => next,Hangup(${HANGUPCAUSE})
- ; Clear dial group first
- exten => 20012,0,Set(DIALGROUP(huntgroup)=)
- same => next,Set(PEERNAMES=301&302&303)
- same => next,While($[${LEN(${PEERNAMES})} != 0])
- same => next,Set(PEERNAME=${SHIFT(PEERNAMES,&)})
- ; Check if peer is logged-in to the hunt group and add them to the dial group if they are
- same => next,ExecIf($[${SIPPEER(${PEERNAME},huntgroup)} = yes]?Set(DIALGROUP(huntgroup,add)=SIP/${PEERNAME}))
- same => next,EndWhile()
- ; Send congestion if the dial group is empty
- same => next,ExecIf($[${LEN(${DIALGROUP(huntgroup)})} = 0]?Congestion(10))
- ; Phones support 'Answered Elsewhere' so the 'c' flag is included
- ; Later series need to be logged into the hunt-group and have CISCO_HUNTPILOT set to not record answered calls as missed
- same => next,Set(_CISCO_HUNTPILOT="Ring All" <${EXTEN}>)
- same => next,Dial(${DIALGROUP(huntgroup)},30,ic)
- same => next,Hangup(${HANGUPCAUSE})
- ; Clear dial group first
- exten => 20013,0,Set(DIALGROUP(huntgroup)=)
- same => next,Set(PEERNAMES=301&302&303)
- same => next,While($[${LEN(${PEERNAMES})} != 0])
- same => next,Set(PEERNAME=${SHIFT(PEERNAMES,&)})
- ; Check if peer is logged-in to the hunt group and add them to the dial group if they are
- same => next,ExecIf($[${SIPPEER(${PEERNAME},huntgroup)} = yes]?Set(DIALGROUP(huntgroup,add)=SIP/${PEERNAME}))
- same => next,EndWhile()
- ; Send congestion if the dial group is empty
- same => next,ExecIf($[${LEN(${DIALGROUP(huntgroup)})} = 0]?Congestion(10))
- ; Phones support 'Answered Elsewhere' so the 'c' flag is included
- ; Later series need to be logged into the hunt-group and have CISCO_HUNTPILOT set to not record answered calls as missed
- same => next,Set(_CISCO_HUNTPILOT="Ring All" <${EXTEN}>)
- same => next,Dial(${DIALGROUP(huntgroup)},30,ic)
- same => next,Hangup(${HANGUPCAUSE})
- ; Clear dial group first
- exten => 24521,0,Set(DIALGROUP(huntgroup)=)
- same => next,Set(PEERNAMES=301&302&303)
- same => next,While($[${LEN(${PEERNAMES})} != 0])
- same => next,Set(PEERNAME=${SHIFT(PEERNAMES,&)})
- ; Check if peer is logged-in to the hunt group and add them to the dial group if they are
- same => next,ExecIf($[${SIPPEER(${PEERNAME},huntgroup)} = yes]?Set(DIALGROUP(huntgroup,add)=SIP/${PEERNAME}))
- same => next,EndWhile()
- ; Send congestion if the dial group is empty
- same => next,ExecIf($[${LEN(${DIALGROUP(huntgroup)})} = 0]?Congestion(10))
- ; Phones support 'Answered Elsewhere' so the 'c' flag is included
- ; Later series need to be logged into the hunt-group and have CISCO_HUNTPILOT set to not record answered calls as missed
- same => next,Set(_CISCO_HUNTPILOT="Ring All" <${EXTEN}>)
- same => next,Dial(${DIALGROUP(huntgroup)},30,ic)
- same => next,Hangup(${HANGUPCAUSE})
- ; Clear dial group first
- exten => 24522,0,Set(DIALGROUP(huntgroup)=)
- same => next,Set(PEERNAMES=301&302&303)
- same => next,While($[${LEN(${PEERNAMES})} != 0])
- same => next,Set(PEERNAME=${SHIFT(PEERNAMES,&)})
- ; Check if peer is logged-in to the hunt group and add them to the dial group if they are
- same => next,ExecIf($[${SIPPEER(${PEERNAME},huntgroup)} = yes]?Set(DIALGROUP(huntgroup,add)=SIP/${PEERNAME}))
- same => next,EndWhile()
- ; Send congestion if the dial group is empty
- same => next,ExecIf($[${LEN(${DIALGROUP(huntgroup)})} = 0]?Congestion(10))
- ; Phones support 'Answered Elsewhere' so the 'c' flag is included
- ; Later series need to be logged into the hunt-group and have CISCO_HUNTPILOT set to not record answered calls as missed
- same => next,Set(_CISCO_HUNTPILOT="Ring All" <${EXTEN}>)
- same => next,Dial(${DIALGROUP(huntgroup)},30,ic)
- same => next,Hangup(${HANGUPCAUSE})
- ; Clear dial group first
- exten => 24523,0,Set(DIALGROUP(huntgroup)=)
- same => next,Set(PEERNAMES=301&302&303)
- same => next,While($[${LEN(${PEERNAMES})} != 0])
- same => next,Set(PEERNAME=${SHIFT(PEERNAMES,&)})
- ; Check if peer is logged-in to the hunt group and add them to the dial group if they are
- same => next,ExecIf($[${SIPPEER(${PEERNAME},huntgroup)} = yes]?Set(DIALGROUP(huntgroup,add)=SIP/${PEERNAME}))
- same => next,EndWhile()
- ; Send congestion if the dial group is empty
- same => next,ExecIf($[${LEN(${DIALGROUP(huntgroup)})} = 0]?Congestion(10))
- ; Phones support 'Answered Elsewhere' so the 'c' flag is included
- ; Later series need to be logged into the hunt-group and have CISCO_HUNTPILOT set to not record answered calls as missed
- same => next,Set(_CISCO_HUNTPILOT="Ring All" <${EXTEN}>)
- same => next,Dial(${DIALGROUP(huntgroup)},30,ic)
- same => next,Hangup(${HANGUPCAUSE})
- [paging]
- ; Only allow one page at a time
- exten => 7255,1,Set(GROUP()=paging)
- same => next,ExecIf($[${GROUP_COUNT(paging)} != 1]?Busy(10))
- ; Multicast audio mode is enabled using the m() option
- same => next,SIPCiscoPage(2452&2001,oad(From ${CALLERID(number)}))
- same => next,Hangup(normal_clearing)
- exten => _blfpickup-.,1,PickupChan(SIP/${EXTEN:10})
- same => next,Hangup(normal_circuit_congestion)
- exten => record,1,Answer()
- same => next,Wait(0.5)
- same => next,Set(CONFBRIDGE(bridge,record_conference)=yes)
- same => next,Set(CONFBRIDGE(bridge,record_file)=${RECORD_PEERNAME})
- same => next,Set(CONFBRIDGE(user,quiet)=yes)
- ; Other channel variables available are ${RECORD_CHANNEL} and ${RECORD_DIRECTION}.
- same => next,ConfBridge(${RECORD_UNIQUEID})
- same => next,Hangup(normal_clearing)
- exten => _7,1,Set(_CISCO_AUTOANSWER=yes)
- same => next,Page(SIP/2001&SIP/2452,sni,30)
- [app-blfpickup]
- include => app-pickup-custom
- exten => _[x]-cisco-serviceuri-blfpickup-.,1,Macro(user-callerid,)
- exten => _[x]-cisco-serviceuri-blfpickup-.,n,Set(PICKUP_EXTEN=${AMPUSER})
- exten => _[x]-cisco-serviceuri-blfpickup-.,n,Pickup(${EXTEN:29}&${EXTEN:29}@PICKUPMARK)
- exten => _[x]-cisco-serviceuri-blfpickup-.,n,Hangup
- ;SIP_CUSTOM.CONF
- [extension](!)
- type=friend
- context=extensions
- host=dynamic
- trustrpid=no
- parkinglot=default
- allowsubscribe=yes
- notifyhold=no
- callcounter=yes
- videosupport=no
- disallow=all
- allow=g722,ulaw,alaw,g729
- [cisco-usecallmanager](!,extension)
- transport=tcp
- nat=no
- directmedia=no
- sendrpid=rpid
- rpid_update=yes
- rpid_immediate=yes
- send_diversion=yes
- dndbusy=yes
- cisco_usecallmanager=yes
- cisco_pickupnotify_alert=from,to
- cisco_pickupnotify_timer=5
- cisco_keep_conference=no
- cisco_multiadmin_conference=yes
- huntgroup_default=no