123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527 |
- [general]
- static = yes
- writeprotect = no
- autofallthrough = no
- clearglobalvars = yes
- priorityjumping = no
- [macro-trunkdial-failover]
- exten => s,1,Set(__calltype=outgoing)
- exten => s,n,Set(num=4)
- exten => s,n(noadd),AGI(getoutcid.php,${CID},${OUTNUM})
- exten => s,n,execIf($[${LEN(${OUTCID})} > 0]?Set(CALLERID(all)=${OUTCID}))
- exten => s,n,GotoIf($[${LEN(${RECORDOUT_${CID}})} = 0]?parse)
- exten => s,n(record),Macro(stdexten-record,${CID},${OUTNUM})
- exten => s,n(dial),Set(TRUNK=${CUT(ARG${num},/,2)})
- exten => s,n,MSet(__VOIPDID=${TRUNK},TRUNK_CID=${CID_${TRUNK}})
- exten => s,n,execIf($[${LEN(${TRUNK_CID})} > 0 && ${LEN(${OUTCID})} = 0]?Set(CALLERID(all)="${TRUNK_CID}" <${TRUNK_CID}>))
- exten => s,n,SIPRemoveHeader()
- exten => s,n,GotoIf($["${CUT(ARG${num},/,1)}" != "DAHDI"]?ppi)
- exten => s,n,ExecIf($["foo${isDENOISE}" = "fooyes"]?MSet(DENOISE(rx)=on,DENOISE(tx)=on))
- exten => s,n,ExecIf($["foo${isENDPOUND}" != "fooyes"]?Set(ARG${num}=${ARG${num}}#))
- exten => s,n(ppi),GotoIf($["foo${isPPI}" != "foo1"]?nosetPPI)
- exten => s,n,Macro(set-sipheader,${ARG${num}})
- exten => s,n(nosetPPI),Dial(${ARG${num}},600,X)
- exten => s,n,Set(num=$[${num}+1])
- exten => s,n,GotoIf(${LEN(${ARG${num}})}>0?s-${DIALSTATUS},1:s-out,1)
- exten => s-CHANUNAVAIL,1,Goto(s,dial)
- exten => s-CONGESTION,1,Goto(s,dial)
- exten => s-out,1,StopMixMonitor
- exten => s-out,n,Hangup()
- exten => _s-.,1,Goto(s-out,1)
- [macro-set-sipheader]
- exten => s,1,GotoIf($[${CUT(ARG1,/,1)} != SIP]?end)
- exten => s,n,Set(TRUNK=${CUT(ARG1,/,2)})
- exten => s,n,Set(HOSTINFO=${SIPPEER(${TRUNK},ip)}:${SIPPEER(${TRUNK},port)})
- exten => s,n,SipAddHeader(P-Preferred-Identity:<sip:${CALLERID(num)}@${HOSTINFO}>)
- exten => s,n(end),NoOp(Return)
- [macro-user-context]
- exten => s,1,AGI(getcontext.agi,${ARG1})
- exten => s,n(end),NoOp(${EXTCONTEXT})
- [macro-stdexten]
- exten => s,1,NoOp(Call Exten)
- same => n,GotoIf($["foo${CALLERID(num)}"="foo"]?nocid)
- same => n,Goto(cid)
- same => n(nocid),Set(CALLERID(num)=Unknown)
- same => n(cid),MSet(__CAID=${CALLERID(num)},__CAEE=${ARG1})
- same => n,ExecIf($["foo${calltype}"=="foo"]?Set(__calltype=internal))
- same => n,Macro(stdexten-record,${CAID},${CAEE})
- same => n,ExecIf($[${ISNULL(USERID)}]?Set(__USERID=0))
- same => n,ExecIf($[${ISNULL(USERL)}]?Set(__USERL=12))
- same => n,ExecIf($[${ISNULL(SERVICEL)}]?Set(__SERVICEL=12))
- same => n,UserEvent(callExtenEvent,userid:${USERID},src:${CAID},dest:${CAEE},uuid:${UUID},user_level:${USERL},service_level:${SERVICEL},status:call)
- same => n(dial),Dial(${ARG2},${RINGTIME},${DIALOPTIONS}M(answered)b(ringevent^s^1))
- same => n,Set(SV_DIALSTATUS=${DIALSTATUS})
- same => n,Goto(s-${SV_DIALSTATUS},1)
- exten => s-NOANSWER,1,UserEvent(callExtenEvent,userid:${USERID},src:${CAID},dest:${CAEE},uuid:${UUID},user_level:${USERL},service_level:${SERVICEL},status:noanswer)
- same => n,Hangup
- exten => s-BUSY,1,UserEvent(callExtenEvent,userid:${USERID},src:${CAID},dest:${CAEE},uuid:${UUID},user_level:${USERL},service_level:${SERVICEL},status:busy)
- same => n,Hangup
- exten => _s-.,1,UserEvent(callExtenEvent,userid:${USERID},src:${CAID},dest:${CAEE},uuid:${UUID},user_level:${USERL},service_level:${SERVICEL},status:failed)
- same => n,Hangup
- exten => h,1,UserEvent(callExtenEvent,userid:${USERID},src:${CAID},dest:${CAEE},uuid:${UUID},user_level:${USERL},service_level:${SERVICEL},status:hangup)
- [macro-stdexten-withoutvm]
- exten => s,1,NoOp(Call Exten)
- same => n,GotoIf($["foo${CALLERID(num)}"="foo"]?nocid)
- same => n,Goto(cid)
- same => n(nocid),Set(CALLERID(num)=Unknown)
- same => n(cid),MSet(__CAID=${CALLERID(num)},__CAEE=${ARG1})
- same => n,Macro(stdexten-record,${CAID},${CAEE})
- same => n,ExecIf($[${ISNULL(USERID)}]?Set(__USERID=0))
- same => n,ExecIf($[${ISNULL(USERL)}]?Set(__USERL=12))
- same => n,ExecIf($[${ISNULL(SERVICEL)}]?Set(__SERVICEL=12))
- same => n,UserEvent(callExtenEvent,userid:${USERID},src:${CAID},dest:${CAEE},uuid:${UUID},user_level:${USERL},service_level:${SERVICEL},status:call)
- same => n(dial),Dial(${ARG2},${RINGTIME},${DIALOPTIONS}M(answered)b(ringevent^s^1))
- same => n,Set(SV_DIALSTATUS=${DIALSTATUS})
- same => n,Goto(s-${SV_DIALSTATUS},1)
- exten => s-NOANSWER,1,UserEvent(callExtenEvent,userid:${USERID},src:${CAID},dest:${CAEE},uuid:${UUID},user_level:${USERL},service_level:${SERVICEL},status:noanswer)
- same => n,Hangup
- exten => s-BUSY,1,UserEvent(callExtenEvent,userid:${USERID},src:${CAID},dest:${CAEE},uuid:${UUID},user_level:${USERL},service_level:${SERVICEL},status:busy)
- same => n,Hangup
- exten => _s-.,1,UserEvent(callExtenEvent,userid:${USERID},src:${CAID},dest:${CAEE},uuid:${UUID},user_level:${USERL},service_level:${SERVICEL},status:failed)
- same => n,Hangup
- exten => h,1,UserEvent(callExtenEvent,userid:${USERID},src:${CAID},dest:${CAEE},uuid:${UUID},user_level:${USERL},service_level:${SERVICEL},status:hangup)
- [macro-answered]
- exten = s,1,UserEvent(callExtenEvent,userid:${USERID},src:${CAID},dest:${CAEE},uuid:${UUID},user_level:${USERL},service_level:${SERVICEL},status:answered)
- [ringevent]
- exten => s,1,UserEvent(callExtenEvent,userid:${USERID},src:${CAID},dest:${CAEE},uuid:${UUID},user_level:${USERL},service_level:${SERVICEL},status:ringing)
- same => n,Return()
- [macro-stdexten-old]
- exten => s,1,Set(__DYNAMIC_FEATURES=nway-start)
- exten => s,n,GotoIf($["foo${CALLERID(num)}"="foo"]?nocid)
- exten => s,n,Goto(cid)
- exten => s,n(nocid),Set(CID=Unknown)
- exten => s,n(cid),MSet(EXTTOCALL=${ARG1},__CAID=${CALLERID(num)},__CAEE=${ARG1})
- exten => s,n,Set(CFEXT=${DB(CF/${EXTTOCALL})})
- exten => s,n,Set(CFUEXT=${DB(CFU/${EXTTOCALL})})
- exten => s,n,Set(CFBEXT=${DB(CFB/${EXTTOCALL})})
- exten => s,n,Set(TOUCH_MIXMONITOR=${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}-${CID}-${EXTTOCALL}-${UNIQUEID})
- exten => s,n,Set(TOUCH_MIXMONITOR_FORMAT=${RCDFORMAT})
- exten => s,n(checkrecord),Macro(stdexten-record,${CID},${EXTTOCALL})
- exten => s,n(calldocf),GotoIf($["foo${CFEXT}"!="foo"]?docf,1)
- exten => s,n,Set(CFURingTime=${DB(CFURingTime/${EXTTOCALL})})
- exten => s,n,ExecIf($[${LEN(${CFURingTime})} > 0]?Set(RINGTIME=${CFURingTime}))
- exten => s,n(dial),Dial(${ARG2},${RINGTIME},${DIALOPTIONS})
- exten => s,n,GotoIf($["${DIALSTATUS}"="ANSWER"]?hangup)
- exten => s,n,GotoIf($["${BLINDTRANSFER}"!="" & "${BLCB}"="yes"]?bl,1)
- exten => s,n(calldocfu),GosubIf($["${DIALSTATUS}"="NOANSWER" & "foo${CFUEXT}"!="foo"]?docfu,1)
- exten => s,n,GosubIf($["${DIALSTATUS}"="CHANUNAVAIL" & "foo${CFUEXT}"!="foo"]?docfu,1)
- exten => s,n(calldocfb),GosubIf($["${DIALSTATUS}"="BUSY" & "foo${CFBEXT}"!="foo"]?docfb,1)
- exten => s,n,ExecIf($["foo${DIALSTATUS}"="foo"]?Set(SV_DIALSTATUS=BUSY):Set(SV_DIALSTATUS=${DIALSTATUS}))
- exten => s,n,Goto(s-${SV_DIALSTATUS},1)
- exten => docf,1,Macro(user-context,${EXTTOCALL})
- exten => docf,n,GotoIf($["foo${EXTCONTEXT}"="foo"]?s-NOANSWER,1)
- exten => docf,n,Set(CFCID=${EXTTOCALL})
- exten => docf,n,Goto(${EXTCONTEXT},${CFEXT},1)
- exten => docf,n,Goto(s-${DIALSTATUS},1)
- exten => docfu,1,Macro(user-context,${EXTTOCALL})
- exten => docfu,n,GotoIf($["foo${EXTCONTEXT}"="foo"]?s-NOANSWER,1)
- exten => docfu,n,Set(CFCID=${EXTTOCALL})
- exten => docfu,n,Goto(${EXTCONTEXT},${CFUEXT},1)
- exten => docfu,n,Return()
- exten => docfb,1,Macro(user-context,${EXTTOCALL})
- exten => docfb,n,GotoIf($["foo${EXTCONTEXT}"="foo"]?s-BUSY,1)
- exten => docfb,n,Set(CFCID=${EXTTOCALL})
- exten => docfb,n,Goto(${EXTCONTEXT},${CFBEXT},1)
- exten => docfb,n,Return()
- exten => s-NOANSWER,1,Goto(app-voicemail,vm-${EXTTOCALL},${EXTEN})
- exten => s-NOANSWER,n,Hangup
- exten => s-BUSY,1,Goto(app-voicemail,vm-${EXTTOCALL},${EXTEN})
- exten => s-BUSY,n,Hangup
- exten => _s-.,1,Goto(s-NOANSWER,1)
- exten => a,1,VoicemailMain(${EXTTOCALL})
- exten => bl,1,Set(ORIG=${CUT(BLINDTRANSFER,-,1)})
- exten => bl,n,Wait(5)
- exten => bl,n,Dial(${ORIG},${RINGTIME},${DIALOPTIONS})
- [macro-stdexten-withoutvm-old]
- exten => s,1,Set(__DYNAMIC_FEATURES=nway-start)
- exten => s,n,GotoIf($["foo${CALLERID(num)}"="foo"]?nocid)
- exten => s,n,Goto(cid)
- exten => s,n(nocid),Set(CID=Unknown)
- exten => s,n(cid),MSet(EXTTOCALL=${ARG1},__CAID=${CALLERID(num)},__CAEE=${ARG1})
- exten => s,n,Set(CFEXT=${DB(CF/${EXTTOCALL})})
- exten => s,n,Set(CFUEXT=${DB(CFU/${EXTTOCALL})})
- exten => s,n,Set(CFBEXT=${DB(CFB/${EXTTOCALL})})
- exten => s,n,Set(TOUCH_MIXMONITOR=${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}-${CID}-${EXTTOCALL}-${UNIQUEID})
- exten => s,n,Set(TOUCH_MIXMONITOR_FORMAT=${RCDFORMAT})
- exten => s,n(checkrecord),Macro(stdexten-record,${CID},${EXTTOCALL})
- exten => s,n(calldocf),GotoIf($["foo${CFEXT}"!="foo"]?docf,1)
- exten => s,n,Set(CFURingTime=${DB(CFURingTime/${EXTTOCALL})})
- exten => s,n,ExecIf($[${LEN(${CFURingTime})} > 0]?Set(RINGTIME=${CFURingTime}))
- exten => s,n(dial),Dial(${ARG2},${RINGTIME},${DIALOPTIONS})
- exten => s,n,GotoIf($["${DIALSTATUS}"="ANSWER"]?hangup)
- exten => s,n,GotoIf($["${BLINDTRANSFER}"!="" & "${BLCB}"="yes"]?bl,1)
- exten => s,n(calldocfu),GosubIf($["${DIALSTATUS}"="NOANSWER" & "foo${CFUEXT}"!="foo"]?docfu,1)
- exten => s,n,GosubIf($["${DIALSTATUS}"="CHANUNAVAIL" & "foo${CFUEXT}"!="foo"]?docfu,1)
- exten => s,n(calldocfb),GosubIf($["${DIALSTATUS}"="BUSY" & "foo${CFBEXT}"!="foo"]?docfb,1)
- exten => s,n,ExecIf($["foo${DIALSTATUS}"="foo"]?Set(SV_DIALSTATUS=BUSY):Set(SV_DIALSTATUS=${DIALSTATUS}))
- exten => s,n,Goto(s-${SV_DIALSTATUS},1)
- exten => docf,1,Macro(user-context,${EXTTOCALL})
- exten => docf,n,GotoIf($["foo${EXTCONTEXT}"="foo"]?s-NOANSWER,1)
- exten => docf,n,Set(CFCID=${EXTTOCALL})
- exten => docf,n,Goto(${EXTCONTEXT},${CFEXT},1)
- exten => docf,n,Goto(s-${DIALSTATUS},1)
- exten => docfu,1,Macro(user-context,${EXTTOCALL})
- exten => docfu,n,GotoIf($["foo${EXTCONTEXT}"="foo"]?s-NOANSWER,1)
- exten => docfu,n,Set(CFCID=${EXTTOCALL})
- exten => docfu,n,Goto(${EXTCONTEXT},${CFUEXT},1)
- exten => docfu,n,Return()
- exten => docfb,1,Macro(user-context,${EXTTOCALL})
- exten => docfb,n,GotoIf($["foo${EXTCONTEXT}"="foo"]?s-BUSY,1)
- exten => docfb,n,Set(CFCID=${EXTTOCALL})
- exten => docfb,n,Goto(${EXTCONTEXT},${CFBEXT},1)
- exten => docfb,n,Return()
- exten => s-NOANSWER,1,Hangup
- exten => s-BUSY,1,Hangup
- exten => _s-.,1,Goto(s-NOANSWER,1)
- exten => a,1,VoicemailMain(${EXTTOCALL})
- exten => bl,1,Set(ORIG=${CUT(BLINDTRANSFER,-,1)})
- exten => bl,n,Wait(5)
- exten => bl,n,Dial(${ORIG},${RINGTIME},${DIALOPTIONS})
- [macro-stdexten-record]
- exten => s,1,GotoIf($["${ARG1}" = "${ARG2}"]?unmatch)
- same => n,Goto(record)
- same => n,ExecIf($[${LEN(${RECORDOUT_${ARG1}})} = 0]?AGI(getrecordconf.php,${ARG1},${ARG2}))
- same => n,GotoIf($[${LEN(${RECORDIN_${ARG2}})} > 0]?recordin)
- same => n(checkout),GotoIf($[${LEN(${RECORDOUT_${ARG1}})} > 0]?recordout:unmatch)
- same => n(recordin),Set(RECORDTIME=${RECORDIN_${ARG2}})
- same => n,GotoIf($[${LEN(${RECORDTIME})} = 1]?record)
- same => n,GotoIfTime(${RECORDTIME}?record)
- same => n,Goto(checkout)
- same => n(recordout),Set(RECORDTIME=${RECORDOUT_${ARG1}})
- same => n,GotoIf($[${LEN(${RECORDTIME})} = 1]?record)
- same => n,GotoIfTime(${RECORDTIME}?record)
- same => n,Goto(unmatch)
- same => n(record),Set(DATE=${STRFTIME(${EPOCH},,%Y%m%d)})
- same => n,System(/bin/sh /etc/scripts/shell_scripts.sh mkrcdir recording ${DATE})
- same => n,ExecIf($["foo${UUID}" = "foo"]?SET(UUID=${UNIQUEID}))
- same => n,Set(FILENAME=recording/${DATE}/recording-${ARG1}-${ARG2}-${calltype}-${UUID}.${RCDFORMAT})
- same => n,MixMonitor(${FILENAME},b)
- same => n(unmatch),NoOp(leave out record)
- [macro-page]
- exten => s,1,Set(ALERTINFO=Alert-Info: Ring Answer)
- exten => s,n,Set(CALLINFO=Call-Info: <uri>\;answer-after=0)
- exten => s,n,ExecIf($["${ALERTINFO}" !=""]?SIPAddHeader(${ALERTINFO}))
- exten => s,n,ExecIf($["${CALLINFO}" !=""]?SIPAddHeader(${CALLINFO}))
- exten => s,n,NoOp(Paging)
- exten => s,n,Page(${ARG1},${ARG2},)
- exten => s,n,Hangup
- [app-paging]
- exten => _[a-zA-Z0-9+*#].,1,MSet(DESTNUM=${EXTEN},CALLERID(num)=${SRCNUM})
- same => n,ChanIsAvail(SIP/${EXTEN},js)
- same => n,GoToIf($["${AVAILSTATUS}" = "1"]?autoanswer:fail)
- same => n(autoanswer),Set(ALERTINFO=Alert-Info: Ring Answer)
- same => n,Set(CALLINFO=Call-Info: <uri>\;answer-after=0)
- same => n,ExecIf($["${ALERTINFO}" !=""]?SIPAddHeader(${ALERTINFO}))
- same => n,ExecIf($["${CALLINFO}" !=""]?SIPAddHeader(${CALLINFO}))
- same => n,NoOp(Paging)
- same => n,Page(SIP/${EXTEN})
- same => n(fail),Hangup
- [clicktocall]
- exten => _[a-zA-Z0-9+*#].,1,MSet(DESTNUM=${EXTEN},CALLERID(num)=${SRCNUM})
- same => n,Macro(user-context,${SRCEXTEN})
- same => n,Goto(${EXTCONTEXT},${DESTNUM},1)
- [clicktointercom]
- exten => _[a-zA-Z0-9+*#].,1,ChanIsAvail(SIP/${EXTEN},js)
- same => n,GoToIf($["${AVAILSTATUS}" = "1"]?autoanswer:fail)
- same => n(autoanswer),MSet(CALLERID(num)=${SRCEXTEN},__CALLEE=${EXTEN},DATE=${STRFTIME(${EPOCH},,%Y%m%d)},__UUID=${UNIQUEID},ALERTINFO=Alert-Info: Ring Answer,CALLINFO=Call-Info: <uri>\;answer-after=0)
- same => n,SIPAddHeader(${ALERTINFO})
- same => n,SIPAddHeader(${CALLINFO})
- same => n,System(/bin/sh /etc/scripts/shell_scripts.sh mkrcdir intercom ${DATE})
- same => n,Set(FILENAME=intercom/${DATE}/intercom-${SRCEXTEN}-${CALLEE}-${UUID}.wav)
- same => n,MixMonitor(${FILENAME},b)
- same => n,UserEvent(intercomEvent,userid:${USERID},src:${SRCEXTEN},dest:${EXTEN},uuid:${UUID},user_level:${USERL},service_level:${SERVICEL},status:intercom)
- same => n,Dial(SIP/${EXTEN})
- same => n,Hangup
- same => n(fail),UserEvent(intercomEvent,userid:${USERID},src:${SRCEXTEN},dest:${CALLEE},uuid:${UUID},user_level:${USERL},service_level:${SERVICEL},status:failed)
- same => n,Hangup
- exten => h,1,UserEvent(intercomEvent,userid:${USERID},src:${SRCEXTEN},dest:${CALLEE},uuid:${UUID},user_level:${USERL},service_level:${SERVICEL},status:hangup)
- same => n,NoOp(Intercom End)
- [clicktopaging]
- exten => s,1,MSet(CALLERID(num)=${SRCEXTEN},DATE=${STRFTIME(${EPOCH},,%Y%m%d)},__UUID=${UNIQUEID},ALERTINFO=Alert-Info: Ring Answer,CALLINFO=Call-Info: <uri>\;answer-after=0)
- same => n,SIPAddHeader(${ALERTINFO})
- same => n,SIPAddHeader(${CALLINFO})
- same => n,System(/bin/sh /etc/scripts/shell_scripts.sh mkrcdir paging ${DATE})
- same => n,Set(FILENAME=paging/${DATE}/paging-${SRCEXTEN}-${UUID}.wav)
- same => n,MixMonitor(${FILENAME},b)
- same => n,Page(${CHANS},b(paging-update-status^s^1)q)
- same => n,Hangup
- exten => h,1,UserEvent(pagingEvent,userid:${USERID},src:${SRCEXTEN},dest:${DESTS},uuid:${UUID},user_level:${USERL},service_level:${SERVICEL},status:hangup)
- same => n,NoOp(Paging End)
- [paging-update-status]
- exten => s,1,Set(CALLEE=${CALLERID(num)})
- same => n,UserEvent(pagingEvent,userid:${USERID},src:${SRCEXTEN},dest:${CALLEE},uuid:${UUID},user_level:${USERL},service_level:${SERVICEL},status:paging)
- same => n,Return()
- [playback-ttspaging]
- exten => s,1,NoOp()
- same => n,Set(loop=${LOOPTIME})
- same => n(loop),Playback(${AUDIOFILE})
- same => n,Set(loop=$[${loop} - 1])
- same => n,GotoIf($[${loop} > 0 ]?loop)
- same => n,hangup
- exten => h,1,System(/bin/rm -f ${AUDIOFILE})
- [ipinfo]
- exten => **11,1,Answer
- exten => **11,n,agi(wanip.sh)
- exten => **11,n,NoOp(${IP_ADD})
- exten => **11,n,wait(1)
- exten => **11,n,SayAlpha(${IP_ADD})
- exten => **11,n,Hangup
- exten => **12,1,Answer
- exten => **12,n,agi(lanip.sh)
- exten => **12,n,NoOp(${IP_ADD})
- exten => **12,n,wait(1)
- exten => **12,n,SayAlpha(${IP_ADD})
- exten => **12,n,Hangup
- exten => **13,1,Answer
- exten => **13,n,Set(PhoneNUM=${CALLERID(num)})
- exten => **13,n,NoOp(${PhoneNUM})
- exten => **13,n,wait(1)
- exten => **13,n,GotoIf($["foo${PhoneNUM}"="foo"]?nonum)
- exten => **13,n,Playback(yourphonenumberis)
- exten => **13,n,SayAlpha(${PhoneNUM})
- exten => **13,n,Hangup
- exten => **13,n(nonum),Playback(port-nonum)
- exten => **13,n,Hangup
- ;exten => _**15[*#],1,Goto(**15,1)
- ;exten => **15,n,Gosub(set-network-mode,s,1)
- ;exten => **15,n,Hangup
- ;exten => _**16[*#],1,Goto(**16,1)
- ;exten => **16,n,Gosub(set-network,s,1)
- ;exten => **16,n,Hangup
- [set-network]
- exten => s,1,Answer
- exten => s,n(setnetwork),NoOp(Set Network ...)
- exten => s,n,Set(__part=wanip)
- exten => s,n,Set(LOOPIPCOUNT=4)
- exten => s,n(retry),ExecIf($["foo${part}"="foowanip"]?Read(IP,inputwanip):Read(IP,inputgateip))
- exten => s,n,AGI(string_to_ip.agi,${IP})
- exten => s,n,NoOp(${JUDGE})
- exten => s,n,ExecIf($["foo${JUDGE}"="fooyes"]?Goto(say):Goto(add))
- exten => s,n(add),Set(LOOPIPCOUNT=$[${LOOPIPCOUNT}-1])
- exten => s,n,GotoIf($[${LOOPIPCOUNT}>1]?retry:return)
- exten => s,n(say),ExecIf($["foo${part}"="foowanip"]?Playback(playwanip):Playback(playgateip))
- exten => s,n,SayAlpha(${GETIP})
- exten => s,n,Set(LOOPSURECOUNT=4)
- exten => s,n(sureretry),Read(SURE,plssure,1)
- exten => s,n,ExecIf($["foo${SURE}"="foo1"]?Goto(next))
- exten => s,n,ExecIf($["foo${SURE}"="foo2"]?Goto(retry)
- exten => s,n,ExecIf($["foo${SURE}"="foo"]?Goto(sureadd)
- exten => s,n,Playback(inputerror)
- exten => s,n(sureadd),Set(LOOPSURECOUNT=$[${LOOPSURECOUNT}-1])
- exten => s,n,GotoIf($[${LOOPSURECOUNT}>1]?sureretry:return)
- exten => s,n(next),ExecIf($["foo${part}"="foowanip"]?Set(__wan_ip=${GETIP}):Set(__gate_ip=${GETIP}))
- exten => s,n,ExecIf($["foo${part}"="foowanip"]?Set(__part=gateip):Goto(execip))
- exten => s,n,Goto(retry)
- exten => s,n(execip),AGI(set_network.agi,${wan_ip},${gate_ip})
- exten => s,n(return),Return()
- [set-network-mode]
- exten => s,1,Answer
- exten => s,n,Set(COUNT=6)
- exten => s,n(setmode),NoOp(Set Network Mode...)
- exten => s,n(retry),Read(MODE,selectmode,1)
- exten => s,n,ExecIf($["foo${MODE}"="foo1"]?Goto(static))
- exten => s,n,ExecIf($["foo${MODE}"="foo2"]?Goto(dhcp))
- exten => s,n,Playback(inputerror)
- exten => s,n,Set(COUNT=$[${COUNT}-1])
- exten => s,n,GotoIf($[${COUNT}>1]?setmode)
- exten => s,n(static),AGI(set_network.agi,"static")
- exten => s,n,Return()
- exten => s,n(dhcp),AGI(set_network.agi,"dhcp")
- exten => s,n,Return()
- [app-voicemail]
- exten => _X.,1,Voicemail(${EXTEN})
- same => n,Hangup
- exten => _vm-X.,1,NoOp(voicemail)
- same => n(s-NOANSWER),Voicemail(${EXTEN:3},u)
- same => n,Hangup
- same => n(s-BUSY),Voicemail(${EXTEN:3},b)
- same => n,Hangup
- same => n(VM),Voicemail(${EXTEN:3})
- same => n,Hangup
- [app-cf-on]
- exten => _cf-X.,1,Answer
- exten => _cf-X.,n,Wait(1)
- exten => _cf-X.,n,Set(fromext=${CALLERID(num)})
- exten => _cf-X.,n,Set(toext=${EXTEN:3})
- exten => _cf-X.,n,Playback(vm-extension)
- exten => _cf-X.,n,SayDigits(${fromext})
- exten => _cf-X.,n,Playback(call-fwd-unconditional&is-set-to)
- exten => _cf-X.,n,SayDigits(${toext})
- exten => _cf-X.,n,Playback(if-correct-press&digits/1)
- exten => _cf-X.,n,Noop(Waiting for input)
- exten => _cf-X.,n(end),WaitExten(60,)
- exten => _cf-X.,n,Playback(sorry-youre-having-problems&goodbye)
- exten => _cf-X.,n,Hangup
- exten => _1!,1,Set(DB(CF/${fromext})=${toext})
- exten => _1!,n,Noop(Deleting: CFB/${fromext} ${DB_DELETE(CFB/${fromext})})
- exten => _1!,n,Noop(Deleting: CFU/${fromext} ${DB_DELETE(CFU/${fromext})})
- exten => _1!,n,Playback(vm-saved&goodbye)
- exten => _1!,n,Hangup
- [app-cf-off]
- exten => s,1,Answer
- exten => s,n,Wait(1)
- exten => s,n,Set(fromext=${CALLERID(num)})
- exten => s,n,Noop(Deleting: CF/${fromext} ${DB_DELETE(CF/${fromext})})
- exten => s,n,Playback(call-fwd-unconditional&de-activated)
- exten => s,n,Hangup
- [app-cf-busy-on]
- exten => _cf-X.,1,Answer
- exten => _cf-X.,n,Wait(1)
- exten => _cf-X.,n,Set(fromext=${CALLERID(num)})
- exten => _cf-X.,n,Set(toext=${EXTEN:3})
- exten => _cf-X.,n,Playback(vm-extension)
- exten => _cf-X.,n,SayDigits(${fromext})
- exten => _cf-X.,n,Playback(call-fwd-on-busy&is-set-to)
- exten => _cf-X.,n,SayDigits(${toext})
- exten => _cf-X.,n,Playback(if-correct-press&digits/1)
- exten => _cf-X.,n,Noop(Waiting for input)
- exten => _cf-X.,n(end),WaitExten(60,)
- exten => _cf-X.,n,Playback(sorry-youre-having-problems&goodbye)
- exten => _cf-X.,n,Hangup
- exten => _1!,1,Set(DB(CFB/${fromext})=${toext})
- exten => _1!,n,Noop(Deleting: CF/${fromext} ${DB_DELETE(CF/${fromext})})
- exten => _1!,n,Playback(vm-saved&goodbye)
- exten => _1!,n,Hangup
- [app-cf-busy-off]
- exten => s,1,Answer
- exten => s,n,Wait(1)
- exten => s,n,Set(fromext=${CALLERID(num)})
- exten => s,n,Noop(Deleting: CFB/${fromext} ${DB_DELETE(CFB/${fromext})})
- exten => s,n,Playback(call-fwd-on-busy&de-activated)
- exten => s,n,Hangup
- [app-cf-unavailable-on]
- exten => _cf-X.,1,Answer
- exten => _cf-X.,n,Wait(1)
- exten => _cf-X.,n,Set(fromext=${CALLERID(num)})
- exten => _cf-X.,n,Set(toext=${EXTEN:3})
- exten => _cf-X.,n,Playback(vm-extension)
- exten => _cf-X.,n,SayDigits(${fromext})
- exten => _cf-X.,n,Playback(call-fwd-no-ans&is-set-to)
- exten => _cf-X.,n,SayDigits(${toext})
- exten => _cf-X.,n,Playback(if-correct-press&digits/1)
- exten => _cf-X.,n,Noop(Waiting for input)
- exten => _cf-X.,n(end),WaitExten(60,)
- exten => _cf-X.,n,Playback(sorry-youre-having-problems&goodbye)
- exten => _cf-X.,n,Hangup
- exten => _1!,1,Set(DB(CFU/${fromext})=${toext})
- exten => _1!,n,Noop(Deleting: CF/${fromext} ${DB_DELETE(CF/${fromext})})
- exten => _1!,n,Playback(vm-saved&goodbye)
- exten => _1!,n,Hangup
- [app-cf-unavailable-off]
- exten => s,1,Answer
- exten => s,n,Wait(1)
- exten => s,n,Set(fromext=${CALLERID(num)})
- exten => s,n,Noop(Deleting: CFU/${fromext} ${DB_DELETE(CFU/${fromext})} ${DB_DELETE(CFURingTime/${fromext})})
- exten => s,n(hook_1),Playback(call-fwd-no-ans&de-activated)
- exten => s,n,Hangup
- [macro-queue-settings]
- exten => s,1,Set(__DYNAMIC_FEATURES=nway-start)
- exten => s,n,Set(CALLER=${CIDNUM})
- exten => s,n,Set(CALLEE=${CALLERID(ani)})
- exten => s,n,Macro(user-context,${CALLEE})
- exten => s,n,Set(TRANSFER_CONTEXT=${EXTCONTEXT})
- exten => s,n,Set(TOUCH_MIXMONITOR=${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}-${CALLER}-${CALLEE}-${UNIQUEID})
- exten => s,n,Set(TOUCH_MIXMONITOR_FORMAT=${RCDFORMAT})
- exten => s,n(checkrecord),Macro(stdexten-record,${CALLER},${CALLEE})
- exten => s,n(exit),NoOp(settings exit.)
- [macro-queue]
- exten => s,1,NoOp(QUEUE)
- same => n,Answer
- same => n,Queue(${EXTEN},CctkXx,,,${WAITTIME})
- same => n,Hangup
- exten => _q-X.,1,Queue(${EXTEN:2},ctkXx,,,${WAITTIME},,,,,1)
- same => n,Hangup
- [asterisk_guitools]
- exten = record_vmenu,1,Answer
- exten = record_vmenu,n,Playback(vm-intro)
- exten = record_vmenu,n,Record(${var1},,,k)
- exten = record_vmenu,n,Playback(vm-saved)
- exten = record_vmenu,n,Playback(vm-goodbye)
- exten = record_vmenu,n,Hangup
- exten = play_file,1,Answer
- exten = play_file,n,Playback(${var1})
- exten = play_file,n,Hangup
- [from-voip]
- exten = s,1,MSet(FROMTYPE=voip,TIMEOUT(digit)=3,__calltype=incoming,__CAID=${CALLERID(num)})
- exten = s,n,Goto(from-voip-custom,s,1)
- exten = _[a-zA-Z0-9+].,1,MSet(FROMTYPE=voip,TIMEOUT(digit)=3,__calltype=incoming,__CAID=${CALLERID(num)})
- exten = _[a-zA-Z0-9+].,n,Goto(from-voip-custom,${EXTEN},1)
- [exten_dod]
- #include extensions_extendod_custom.conf
- [custom-did]
- #include extensions_extendid_custom.conf
- include = custom-did-voip
- include = default
- exten = i,1,Goto(direct-voip,direct,1)
- [from-voip-custom]
- include = inbound-voip
- [inbound-voip]
- exten = s,1,GotoIf($["foo${AutoAnswer}"!="foo" & "${AutoAnswer}" != "0"]?answer:notanswer)
- exten = s,n(answer),Answer()
- exten = s,n,Wait(${AutoAnswer})
- exten = s,n(notanswer),Set(__VOIPDID=${CUT(CUT(SIP_HEADER(To),@,1),:,2)})
- exten = s,n,GotoIf($["${VOIPDID}"!="s"]?match)
- exten = s,n,Goto(direct-voip,direct,1)
- exten = s,n(match),Goto(custom-did,${VOIPDID},1)
- exten = _[a-zA-Z0-9+].,1,GotoIf($["foo${AutoAnswer}"!="foo" & "${AutoAnswer}" != "0"]?answer:notanswer)
- exten = _[a-zA-Z0-9+].,n(answer),Answer()
- exten = _[a-zA-Z0-9+].,n,Wait(${AutoAnswer})
- exten = _[a-zA-Z0-9+].,n(notanswer),Set(__VOIPDID=${EXTEN})
- exten = _[a-zA-Z0-9+].,n,Goto(custom-did,${EXTEN},1)
- [from-analog]
- exten = s,1,Set(CALLERID(name)=)
- exten = s,n,GotoIf($["foo${isDENOISE}" != "fooyes"]?incoming)
- exten = s,n,Set(DENOISE(rx)=on)
- exten = s,n,Set(DENOISE(tx)=on)
- exten = s,n(incoming),MSet(FROMTYPE=analog,TIMEOUT(digit)=3,__calltype=incoming,__CAID=${CALLERID(num)})
- exten = s,n,Goto(from-analog-custom,s,1)
- [from-analog-custom]
- include = inbound-analog
- [inbound-analog]
- exten = s,1,Set(CHANTMP=${CUT(CHANNEL,/,2)})
- exten = s,n,Set(DAHDICHAN=${CUT(CHANTMP,-,1)})
- exten = s,n,GotoIf($["foo${AutoAnswer}"!="foo" & "${AutoAnswer}" != "0"]?answer:notanswer)
- exten = s,n(answer),Answer()
- exten = s,n,Wait(${AutoAnswer})
- exten = s,n(notanswer),Macro(analog-custom-${DAHDICHAN})
- exten = s,n,Goto(direct-analog,direct,1)
|