extensions_general.conf 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527
  1. [general]
  2. static = yes
  3. writeprotect = no
  4. autofallthrough = no
  5. clearglobalvars = yes
  6. priorityjumping = no
  7. [macro-trunkdial-failover]
  8. exten => s,1,Set(__calltype=outgoing)
  9. exten => s,n,Set(num=4)
  10. exten => s,n(noadd),AGI(getoutcid.php,${CID},${OUTNUM})
  11. exten => s,n,execIf($[${LEN(${OUTCID})} > 0]?Set(CALLERID(all)=${OUTCID}))
  12. exten => s,n,GotoIf($[${LEN(${RECORDOUT_${CID}})} = 0]?parse)
  13. exten => s,n(record),Macro(stdexten-record,${CID},${OUTNUM})
  14. exten => s,n(dial),Set(TRUNK=${CUT(ARG${num},/,2)})
  15. exten => s,n,MSet(__VOIPDID=${TRUNK},TRUNK_CID=${CID_${TRUNK}})
  16. exten => s,n,execIf($[${LEN(${TRUNK_CID})} > 0 && ${LEN(${OUTCID})} = 0]?Set(CALLERID(all)="${TRUNK_CID}" <${TRUNK_CID}>))
  17. exten => s,n,SIPRemoveHeader()
  18. exten => s,n,GotoIf($["${CUT(ARG${num},/,1)}" != "DAHDI"]?ppi)
  19. exten => s,n,ExecIf($["foo${isDENOISE}" = "fooyes"]?MSet(DENOISE(rx)=on,DENOISE(tx)=on))
  20. exten => s,n,ExecIf($["foo${isENDPOUND}" != "fooyes"]?Set(ARG${num}=${ARG${num}}#))
  21. exten => s,n(ppi),GotoIf($["foo${isPPI}" != "foo1"]?nosetPPI)
  22. exten => s,n,Macro(set-sipheader,${ARG${num}})
  23. exten => s,n(nosetPPI),Dial(${ARG${num}},600,X)
  24. exten => s,n,Set(num=$[${num}+1])
  25. exten => s,n,GotoIf(${LEN(${ARG${num}})}>0?s-${DIALSTATUS},1:s-out,1)
  26. exten => s-CHANUNAVAIL,1,Goto(s,dial)
  27. exten => s-CONGESTION,1,Goto(s,dial)
  28. exten => s-out,1,StopMixMonitor
  29. exten => s-out,n,Hangup()
  30. exten => _s-.,1,Goto(s-out,1)
  31. [macro-set-sipheader]
  32. exten => s,1,GotoIf($[${CUT(ARG1,/,1)} != SIP]?end)
  33. exten => s,n,Set(TRUNK=${CUT(ARG1,/,2)})
  34. exten => s,n,Set(HOSTINFO=${SIPPEER(${TRUNK},ip)}:${SIPPEER(${TRUNK},port)})
  35. exten => s,n,SipAddHeader(P-Preferred-Identity:<sip:${CALLERID(num)}@${HOSTINFO}>)
  36. exten => s,n(end),NoOp(Return)
  37. [macro-user-context]
  38. exten => s,1,AGI(getcontext.agi,${ARG1})
  39. exten => s,n(end),NoOp(${EXTCONTEXT})
  40. [macro-stdexten]
  41. exten => s,1,NoOp(Call Exten)
  42. same => n,GotoIf($["foo${CALLERID(num)}"="foo"]?nocid)
  43. same => n,Goto(cid)
  44. same => n(nocid),Set(CALLERID(num)=Unknown)
  45. same => n(cid),MSet(__CAID=${CALLERID(num)},__CAEE=${ARG1})
  46. same => n,ExecIf($["foo${calltype}"=="foo"]?Set(__calltype=internal))
  47. same => n,Macro(stdexten-record,${CAID},${CAEE})
  48. same => n,ExecIf($[${ISNULL(USERID)}]?Set(__USERID=0))
  49. same => n,ExecIf($[${ISNULL(USERL)}]?Set(__USERL=12))
  50. same => n,ExecIf($[${ISNULL(SERVICEL)}]?Set(__SERVICEL=12))
  51. same => n,UserEvent(callExtenEvent,userid:${USERID},src:${CAID},dest:${CAEE},uuid:${UUID},user_level:${USERL},service_level:${SERVICEL},status:call)
  52. same => n(dial),Dial(${ARG2},${RINGTIME},${DIALOPTIONS}M(answered)b(ringevent^s^1))
  53. same => n,Set(SV_DIALSTATUS=${DIALSTATUS})
  54. same => n,Goto(s-${SV_DIALSTATUS},1)
  55. exten => s-NOANSWER,1,UserEvent(callExtenEvent,userid:${USERID},src:${CAID},dest:${CAEE},uuid:${UUID},user_level:${USERL},service_level:${SERVICEL},status:noanswer)
  56. same => n,Hangup
  57. exten => s-BUSY,1,UserEvent(callExtenEvent,userid:${USERID},src:${CAID},dest:${CAEE},uuid:${UUID},user_level:${USERL},service_level:${SERVICEL},status:busy)
  58. same => n,Hangup
  59. exten => _s-.,1,UserEvent(callExtenEvent,userid:${USERID},src:${CAID},dest:${CAEE},uuid:${UUID},user_level:${USERL},service_level:${SERVICEL},status:failed)
  60. same => n,Hangup
  61. exten => h,1,UserEvent(callExtenEvent,userid:${USERID},src:${CAID},dest:${CAEE},uuid:${UUID},user_level:${USERL},service_level:${SERVICEL},status:hangup)
  62. [macro-stdexten-withoutvm]
  63. exten => s,1,NoOp(Call Exten)
  64. same => n,GotoIf($["foo${CALLERID(num)}"="foo"]?nocid)
  65. same => n,Goto(cid)
  66. same => n(nocid),Set(CALLERID(num)=Unknown)
  67. same => n(cid),MSet(__CAID=${CALLERID(num)},__CAEE=${ARG1})
  68. same => n,Macro(stdexten-record,${CAID},${CAEE})
  69. same => n,ExecIf($[${ISNULL(USERID)}]?Set(__USERID=0))
  70. same => n,ExecIf($[${ISNULL(USERL)}]?Set(__USERL=12))
  71. same => n,ExecIf($[${ISNULL(SERVICEL)}]?Set(__SERVICEL=12))
  72. same => n,UserEvent(callExtenEvent,userid:${USERID},src:${CAID},dest:${CAEE},uuid:${UUID},user_level:${USERL},service_level:${SERVICEL},status:call)
  73. same => n(dial),Dial(${ARG2},${RINGTIME},${DIALOPTIONS}M(answered)b(ringevent^s^1))
  74. same => n,Set(SV_DIALSTATUS=${DIALSTATUS})
  75. same => n,Goto(s-${SV_DIALSTATUS},1)
  76. exten => s-NOANSWER,1,UserEvent(callExtenEvent,userid:${USERID},src:${CAID},dest:${CAEE},uuid:${UUID},user_level:${USERL},service_level:${SERVICEL},status:noanswer)
  77. same => n,Hangup
  78. exten => s-BUSY,1,UserEvent(callExtenEvent,userid:${USERID},src:${CAID},dest:${CAEE},uuid:${UUID},user_level:${USERL},service_level:${SERVICEL},status:busy)
  79. same => n,Hangup
  80. exten => _s-.,1,UserEvent(callExtenEvent,userid:${USERID},src:${CAID},dest:${CAEE},uuid:${UUID},user_level:${USERL},service_level:${SERVICEL},status:failed)
  81. same => n,Hangup
  82. exten => h,1,UserEvent(callExtenEvent,userid:${USERID},src:${CAID},dest:${CAEE},uuid:${UUID},user_level:${USERL},service_level:${SERVICEL},status:hangup)
  83. [macro-answered]
  84. exten = s,1,UserEvent(callExtenEvent,userid:${USERID},src:${CAID},dest:${CAEE},uuid:${UUID},user_level:${USERL},service_level:${SERVICEL},status:answered)
  85. [ringevent]
  86. exten => s,1,UserEvent(callExtenEvent,userid:${USERID},src:${CAID},dest:${CAEE},uuid:${UUID},user_level:${USERL},service_level:${SERVICEL},status:ringing)
  87. same => n,Return()
  88. [macro-stdexten-old]
  89. exten => s,1,Set(__DYNAMIC_FEATURES=nway-start)
  90. exten => s,n,GotoIf($["foo${CALLERID(num)}"="foo"]?nocid)
  91. exten => s,n,Goto(cid)
  92. exten => s,n(nocid),Set(CID=Unknown)
  93. exten => s,n(cid),MSet(EXTTOCALL=${ARG1},__CAID=${CALLERID(num)},__CAEE=${ARG1})
  94. exten => s,n,Set(CFEXT=${DB(CF/${EXTTOCALL})})
  95. exten => s,n,Set(CFUEXT=${DB(CFU/${EXTTOCALL})})
  96. exten => s,n,Set(CFBEXT=${DB(CFB/${EXTTOCALL})})
  97. exten => s,n,Set(TOUCH_MIXMONITOR=${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}-${CID}-${EXTTOCALL}-${UNIQUEID})
  98. exten => s,n,Set(TOUCH_MIXMONITOR_FORMAT=${RCDFORMAT})
  99. exten => s,n(checkrecord),Macro(stdexten-record,${CID},${EXTTOCALL})
  100. exten => s,n(calldocf),GotoIf($["foo${CFEXT}"!="foo"]?docf,1)
  101. exten => s,n,Set(CFURingTime=${DB(CFURingTime/${EXTTOCALL})})
  102. exten => s,n,ExecIf($[${LEN(${CFURingTime})} > 0]?Set(RINGTIME=${CFURingTime}))
  103. exten => s,n(dial),Dial(${ARG2},${RINGTIME},${DIALOPTIONS})
  104. exten => s,n,GotoIf($["${DIALSTATUS}"="ANSWER"]?hangup)
  105. exten => s,n,GotoIf($["${BLINDTRANSFER}"!="" & "${BLCB}"="yes"]?bl,1)
  106. exten => s,n(calldocfu),GosubIf($["${DIALSTATUS}"="NOANSWER" & "foo${CFUEXT}"!="foo"]?docfu,1)
  107. exten => s,n,GosubIf($["${DIALSTATUS}"="CHANUNAVAIL" & "foo${CFUEXT}"!="foo"]?docfu,1)
  108. exten => s,n(calldocfb),GosubIf($["${DIALSTATUS}"="BUSY" & "foo${CFBEXT}"!="foo"]?docfb,1)
  109. exten => s,n,ExecIf($["foo${DIALSTATUS}"="foo"]?Set(SV_DIALSTATUS=BUSY):Set(SV_DIALSTATUS=${DIALSTATUS}))
  110. exten => s,n,Goto(s-${SV_DIALSTATUS},1)
  111. exten => docf,1,Macro(user-context,${EXTTOCALL})
  112. exten => docf,n,GotoIf($["foo${EXTCONTEXT}"="foo"]?s-NOANSWER,1)
  113. exten => docf,n,Set(CFCID=${EXTTOCALL})
  114. exten => docf,n,Goto(${EXTCONTEXT},${CFEXT},1)
  115. exten => docf,n,Goto(s-${DIALSTATUS},1)
  116. exten => docfu,1,Macro(user-context,${EXTTOCALL})
  117. exten => docfu,n,GotoIf($["foo${EXTCONTEXT}"="foo"]?s-NOANSWER,1)
  118. exten => docfu,n,Set(CFCID=${EXTTOCALL})
  119. exten => docfu,n,Goto(${EXTCONTEXT},${CFUEXT},1)
  120. exten => docfu,n,Return()
  121. exten => docfb,1,Macro(user-context,${EXTTOCALL})
  122. exten => docfb,n,GotoIf($["foo${EXTCONTEXT}"="foo"]?s-BUSY,1)
  123. exten => docfb,n,Set(CFCID=${EXTTOCALL})
  124. exten => docfb,n,Goto(${EXTCONTEXT},${CFBEXT},1)
  125. exten => docfb,n,Return()
  126. exten => s-NOANSWER,1,Goto(app-voicemail,vm-${EXTTOCALL},${EXTEN})
  127. exten => s-NOANSWER,n,Hangup
  128. exten => s-BUSY,1,Goto(app-voicemail,vm-${EXTTOCALL},${EXTEN})
  129. exten => s-BUSY,n,Hangup
  130. exten => _s-.,1,Goto(s-NOANSWER,1)
  131. exten => a,1,VoicemailMain(${EXTTOCALL})
  132. exten => bl,1,Set(ORIG=${CUT(BLINDTRANSFER,-,1)})
  133. exten => bl,n,Wait(5)
  134. exten => bl,n,Dial(${ORIG},${RINGTIME},${DIALOPTIONS})
  135. [macro-stdexten-withoutvm-old]
  136. exten => s,1,Set(__DYNAMIC_FEATURES=nway-start)
  137. exten => s,n,GotoIf($["foo${CALLERID(num)}"="foo"]?nocid)
  138. exten => s,n,Goto(cid)
  139. exten => s,n(nocid),Set(CID=Unknown)
  140. exten => s,n(cid),MSet(EXTTOCALL=${ARG1},__CAID=${CALLERID(num)},__CAEE=${ARG1})
  141. exten => s,n,Set(CFEXT=${DB(CF/${EXTTOCALL})})
  142. exten => s,n,Set(CFUEXT=${DB(CFU/${EXTTOCALL})})
  143. exten => s,n,Set(CFBEXT=${DB(CFB/${EXTTOCALL})})
  144. exten => s,n,Set(TOUCH_MIXMONITOR=${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}-${CID}-${EXTTOCALL}-${UNIQUEID})
  145. exten => s,n,Set(TOUCH_MIXMONITOR_FORMAT=${RCDFORMAT})
  146. exten => s,n(checkrecord),Macro(stdexten-record,${CID},${EXTTOCALL})
  147. exten => s,n(calldocf),GotoIf($["foo${CFEXT}"!="foo"]?docf,1)
  148. exten => s,n,Set(CFURingTime=${DB(CFURingTime/${EXTTOCALL})})
  149. exten => s,n,ExecIf($[${LEN(${CFURingTime})} > 0]?Set(RINGTIME=${CFURingTime}))
  150. exten => s,n(dial),Dial(${ARG2},${RINGTIME},${DIALOPTIONS})
  151. exten => s,n,GotoIf($["${DIALSTATUS}"="ANSWER"]?hangup)
  152. exten => s,n,GotoIf($["${BLINDTRANSFER}"!="" & "${BLCB}"="yes"]?bl,1)
  153. exten => s,n(calldocfu),GosubIf($["${DIALSTATUS}"="NOANSWER" & "foo${CFUEXT}"!="foo"]?docfu,1)
  154. exten => s,n,GosubIf($["${DIALSTATUS}"="CHANUNAVAIL" & "foo${CFUEXT}"!="foo"]?docfu,1)
  155. exten => s,n(calldocfb),GosubIf($["${DIALSTATUS}"="BUSY" & "foo${CFBEXT}"!="foo"]?docfb,1)
  156. exten => s,n,ExecIf($["foo${DIALSTATUS}"="foo"]?Set(SV_DIALSTATUS=BUSY):Set(SV_DIALSTATUS=${DIALSTATUS}))
  157. exten => s,n,Goto(s-${SV_DIALSTATUS},1)
  158. exten => docf,1,Macro(user-context,${EXTTOCALL})
  159. exten => docf,n,GotoIf($["foo${EXTCONTEXT}"="foo"]?s-NOANSWER,1)
  160. exten => docf,n,Set(CFCID=${EXTTOCALL})
  161. exten => docf,n,Goto(${EXTCONTEXT},${CFEXT},1)
  162. exten => docf,n,Goto(s-${DIALSTATUS},1)
  163. exten => docfu,1,Macro(user-context,${EXTTOCALL})
  164. exten => docfu,n,GotoIf($["foo${EXTCONTEXT}"="foo"]?s-NOANSWER,1)
  165. exten => docfu,n,Set(CFCID=${EXTTOCALL})
  166. exten => docfu,n,Goto(${EXTCONTEXT},${CFUEXT},1)
  167. exten => docfu,n,Return()
  168. exten => docfb,1,Macro(user-context,${EXTTOCALL})
  169. exten => docfb,n,GotoIf($["foo${EXTCONTEXT}"="foo"]?s-BUSY,1)
  170. exten => docfb,n,Set(CFCID=${EXTTOCALL})
  171. exten => docfb,n,Goto(${EXTCONTEXT},${CFBEXT},1)
  172. exten => docfb,n,Return()
  173. exten => s-NOANSWER,1,Hangup
  174. exten => s-BUSY,1,Hangup
  175. exten => _s-.,1,Goto(s-NOANSWER,1)
  176. exten => a,1,VoicemailMain(${EXTTOCALL})
  177. exten => bl,1,Set(ORIG=${CUT(BLINDTRANSFER,-,1)})
  178. exten => bl,n,Wait(5)
  179. exten => bl,n,Dial(${ORIG},${RINGTIME},${DIALOPTIONS})
  180. [macro-stdexten-record]
  181. exten => s,1,GotoIf($["${ARG1}" = "${ARG2}"]?unmatch)
  182. same => n,Goto(record)
  183. same => n,ExecIf($[${LEN(${RECORDOUT_${ARG1}})} = 0]?AGI(getrecordconf.php,${ARG1},${ARG2}))
  184. same => n,GotoIf($[${LEN(${RECORDIN_${ARG2}})} > 0]?recordin)
  185. same => n(checkout),GotoIf($[${LEN(${RECORDOUT_${ARG1}})} > 0]?recordout:unmatch)
  186. same => n(recordin),Set(RECORDTIME=${RECORDIN_${ARG2}})
  187. same => n,GotoIf($[${LEN(${RECORDTIME})} = 1]?record)
  188. same => n,GotoIfTime(${RECORDTIME}?record)
  189. same => n,Goto(checkout)
  190. same => n(recordout),Set(RECORDTIME=${RECORDOUT_${ARG1}})
  191. same => n,GotoIf($[${LEN(${RECORDTIME})} = 1]?record)
  192. same => n,GotoIfTime(${RECORDTIME}?record)
  193. same => n,Goto(unmatch)
  194. same => n(record),Set(DATE=${STRFTIME(${EPOCH},,%Y%m%d)})
  195. same => n,System(/bin/sh /etc/scripts/shell_scripts.sh mkrcdir recording ${DATE})
  196. same => n,ExecIf($["foo${UUID}" = "foo"]?SET(UUID=${UNIQUEID}))
  197. same => n,Set(FILENAME=recording/${DATE}/recording-${ARG1}-${ARG2}-${calltype}-${UUID}.${RCDFORMAT})
  198. same => n,MixMonitor(${FILENAME},b)
  199. same => n(unmatch),NoOp(leave out record)
  200. [macro-page]
  201. exten => s,1,Set(ALERTINFO=Alert-Info: Ring Answer)
  202. exten => s,n,Set(CALLINFO=Call-Info: <uri>\;answer-after=0)
  203. exten => s,n,ExecIf($["${ALERTINFO}" !=""]?SIPAddHeader(${ALERTINFO}))
  204. exten => s,n,ExecIf($["${CALLINFO}" !=""]?SIPAddHeader(${CALLINFO}))
  205. exten => s,n,NoOp(Paging)
  206. exten => s,n,Page(${ARG1},${ARG2},)
  207. exten => s,n,Hangup
  208. [app-paging]
  209. exten => _[a-zA-Z0-9+*#].,1,MSet(DESTNUM=${EXTEN},CALLERID(num)=${SRCNUM})
  210. same => n,ChanIsAvail(SIP/${EXTEN},js)
  211. same => n,GoToIf($["${AVAILSTATUS}" = "1"]?autoanswer:fail)
  212. same => n(autoanswer),Set(ALERTINFO=Alert-Info: Ring Answer)
  213. same => n,Set(CALLINFO=Call-Info: <uri>\;answer-after=0)
  214. same => n,ExecIf($["${ALERTINFO}" !=""]?SIPAddHeader(${ALERTINFO}))
  215. same => n,ExecIf($["${CALLINFO}" !=""]?SIPAddHeader(${CALLINFO}))
  216. same => n,NoOp(Paging)
  217. same => n,Page(SIP/${EXTEN})
  218. same => n(fail),Hangup
  219. [clicktocall]
  220. exten => _[a-zA-Z0-9+*#].,1,MSet(DESTNUM=${EXTEN},CALLERID(num)=${SRCNUM})
  221. same => n,Macro(user-context,${SRCEXTEN})
  222. same => n,Goto(${EXTCONTEXT},${DESTNUM},1)
  223. [clicktointercom]
  224. exten => _[a-zA-Z0-9+*#].,1,ChanIsAvail(SIP/${EXTEN},js)
  225. same => n,GoToIf($["${AVAILSTATUS}" = "1"]?autoanswer:fail)
  226. 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)
  227. same => n,SIPAddHeader(${ALERTINFO})
  228. same => n,SIPAddHeader(${CALLINFO})
  229. same => n,System(/bin/sh /etc/scripts/shell_scripts.sh mkrcdir intercom ${DATE})
  230. same => n,Set(FILENAME=intercom/${DATE}/intercom-${SRCEXTEN}-${CALLEE}-${UUID}.wav)
  231. same => n,MixMonitor(${FILENAME},b)
  232. same => n,UserEvent(intercomEvent,userid:${USERID},src:${SRCEXTEN},dest:${EXTEN},uuid:${UUID},user_level:${USERL},service_level:${SERVICEL},status:intercom)
  233. same => n,Dial(SIP/${EXTEN})
  234. same => n,Hangup
  235. same => n(fail),UserEvent(intercomEvent,userid:${USERID},src:${SRCEXTEN},dest:${CALLEE},uuid:${UUID},user_level:${USERL},service_level:${SERVICEL},status:failed)
  236. same => n,Hangup
  237. exten => h,1,UserEvent(intercomEvent,userid:${USERID},src:${SRCEXTEN},dest:${CALLEE},uuid:${UUID},user_level:${USERL},service_level:${SERVICEL},status:hangup)
  238. same => n,NoOp(Intercom End)
  239. [clicktopaging]
  240. 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)
  241. same => n,SIPAddHeader(${ALERTINFO})
  242. same => n,SIPAddHeader(${CALLINFO})
  243. same => n,System(/bin/sh /etc/scripts/shell_scripts.sh mkrcdir paging ${DATE})
  244. same => n,Set(FILENAME=paging/${DATE}/paging-${SRCEXTEN}-${UUID}.wav)
  245. same => n,MixMonitor(${FILENAME},b)
  246. same => n,Page(${CHANS},b(paging-update-status^s^1)q)
  247. same => n,Hangup
  248. exten => h,1,UserEvent(pagingEvent,userid:${USERID},src:${SRCEXTEN},dest:${DESTS},uuid:${UUID},user_level:${USERL},service_level:${SERVICEL},status:hangup)
  249. same => n,NoOp(Paging End)
  250. [paging-update-status]
  251. exten => s,1,Set(CALLEE=${CALLERID(num)})
  252. same => n,UserEvent(pagingEvent,userid:${USERID},src:${SRCEXTEN},dest:${CALLEE},uuid:${UUID},user_level:${USERL},service_level:${SERVICEL},status:paging)
  253. same => n,Return()
  254. [playback-ttspaging]
  255. exten => s,1,NoOp()
  256. same => n,Set(loop=${LOOPTIME})
  257. same => n(loop),Playback(${AUDIOFILE})
  258. same => n,Set(loop=$[${loop} - 1])
  259. same => n,GotoIf($[${loop} > 0 ]?loop)
  260. same => n,hangup
  261. exten => h,1,System(/bin/rm -f ${AUDIOFILE})
  262. [ipinfo]
  263. exten => **11,1,Answer
  264. exten => **11,n,agi(wanip.sh)
  265. exten => **11,n,NoOp(${IP_ADD})
  266. exten => **11,n,wait(1)
  267. exten => **11,n,SayAlpha(${IP_ADD})
  268. exten => **11,n,Hangup
  269. exten => **12,1,Answer
  270. exten => **12,n,agi(lanip.sh)
  271. exten => **12,n,NoOp(${IP_ADD})
  272. exten => **12,n,wait(1)
  273. exten => **12,n,SayAlpha(${IP_ADD})
  274. exten => **12,n,Hangup
  275. exten => **13,1,Answer
  276. exten => **13,n,Set(PhoneNUM=${CALLERID(num)})
  277. exten => **13,n,NoOp(${PhoneNUM})
  278. exten => **13,n,wait(1)
  279. exten => **13,n,GotoIf($["foo${PhoneNUM}"="foo"]?nonum)
  280. exten => **13,n,Playback(yourphonenumberis)
  281. exten => **13,n,SayAlpha(${PhoneNUM})
  282. exten => **13,n,Hangup
  283. exten => **13,n(nonum),Playback(port-nonum)
  284. exten => **13,n,Hangup
  285. ;exten => _**15[*#],1,Goto(**15,1)
  286. ;exten => **15,n,Gosub(set-network-mode,s,1)
  287. ;exten => **15,n,Hangup
  288. ;exten => _**16[*#],1,Goto(**16,1)
  289. ;exten => **16,n,Gosub(set-network,s,1)
  290. ;exten => **16,n,Hangup
  291. [set-network]
  292. exten => s,1,Answer
  293. exten => s,n(setnetwork),NoOp(Set Network ...)
  294. exten => s,n,Set(__part=wanip)
  295. exten => s,n,Set(LOOPIPCOUNT=4)
  296. exten => s,n(retry),ExecIf($["foo${part}"="foowanip"]?Read(IP,inputwanip):Read(IP,inputgateip))
  297. exten => s,n,AGI(string_to_ip.agi,${IP})
  298. exten => s,n,NoOp(${JUDGE})
  299. exten => s,n,ExecIf($["foo${JUDGE}"="fooyes"]?Goto(say):Goto(add))
  300. exten => s,n(add),Set(LOOPIPCOUNT=$[${LOOPIPCOUNT}-1])
  301. exten => s,n,GotoIf($[${LOOPIPCOUNT}>1]?retry:return)
  302. exten => s,n(say),ExecIf($["foo${part}"="foowanip"]?Playback(playwanip):Playback(playgateip))
  303. exten => s,n,SayAlpha(${GETIP})
  304. exten => s,n,Set(LOOPSURECOUNT=4)
  305. exten => s,n(sureretry),Read(SURE,plssure,1)
  306. exten => s,n,ExecIf($["foo${SURE}"="foo1"]?Goto(next))
  307. exten => s,n,ExecIf($["foo${SURE}"="foo2"]?Goto(retry)
  308. exten => s,n,ExecIf($["foo${SURE}"="foo"]?Goto(sureadd)
  309. exten => s,n,Playback(inputerror)
  310. exten => s,n(sureadd),Set(LOOPSURECOUNT=$[${LOOPSURECOUNT}-1])
  311. exten => s,n,GotoIf($[${LOOPSURECOUNT}>1]?sureretry:return)
  312. exten => s,n(next),ExecIf($["foo${part}"="foowanip"]?Set(__wan_ip=${GETIP}):Set(__gate_ip=${GETIP}))
  313. exten => s,n,ExecIf($["foo${part}"="foowanip"]?Set(__part=gateip):Goto(execip))
  314. exten => s,n,Goto(retry)
  315. exten => s,n(execip),AGI(set_network.agi,${wan_ip},${gate_ip})
  316. exten => s,n(return),Return()
  317. [set-network-mode]
  318. exten => s,1,Answer
  319. exten => s,n,Set(COUNT=6)
  320. exten => s,n(setmode),NoOp(Set Network Mode...)
  321. exten => s,n(retry),Read(MODE,selectmode,1)
  322. exten => s,n,ExecIf($["foo${MODE}"="foo1"]?Goto(static))
  323. exten => s,n,ExecIf($["foo${MODE}"="foo2"]?Goto(dhcp))
  324. exten => s,n,Playback(inputerror)
  325. exten => s,n,Set(COUNT=$[${COUNT}-1])
  326. exten => s,n,GotoIf($[${COUNT}>1]?setmode)
  327. exten => s,n(static),AGI(set_network.agi,"static")
  328. exten => s,n,Return()
  329. exten => s,n(dhcp),AGI(set_network.agi,"dhcp")
  330. exten => s,n,Return()
  331. [app-voicemail]
  332. exten => _X.,1,Voicemail(${EXTEN})
  333. same => n,Hangup
  334. exten => _vm-X.,1,NoOp(voicemail)
  335. same => n(s-NOANSWER),Voicemail(${EXTEN:3},u)
  336. same => n,Hangup
  337. same => n(s-BUSY),Voicemail(${EXTEN:3},b)
  338. same => n,Hangup
  339. same => n(VM),Voicemail(${EXTEN:3})
  340. same => n,Hangup
  341. [app-cf-on]
  342. exten => _cf-X.,1,Answer
  343. exten => _cf-X.,n,Wait(1)
  344. exten => _cf-X.,n,Set(fromext=${CALLERID(num)})
  345. exten => _cf-X.,n,Set(toext=${EXTEN:3})
  346. exten => _cf-X.,n,Playback(vm-extension)
  347. exten => _cf-X.,n,SayDigits(${fromext})
  348. exten => _cf-X.,n,Playback(call-fwd-unconditional&is-set-to)
  349. exten => _cf-X.,n,SayDigits(${toext})
  350. exten => _cf-X.,n,Playback(if-correct-press&digits/1)
  351. exten => _cf-X.,n,Noop(Waiting for input)
  352. exten => _cf-X.,n(end),WaitExten(60,)
  353. exten => _cf-X.,n,Playback(sorry-youre-having-problems&goodbye)
  354. exten => _cf-X.,n,Hangup
  355. exten => _1!,1,Set(DB(CF/${fromext})=${toext})
  356. exten => _1!,n,Noop(Deleting: CFB/${fromext} ${DB_DELETE(CFB/${fromext})})
  357. exten => _1!,n,Noop(Deleting: CFU/${fromext} ${DB_DELETE(CFU/${fromext})})
  358. exten => _1!,n,Playback(vm-saved&goodbye)
  359. exten => _1!,n,Hangup
  360. [app-cf-off]
  361. exten => s,1,Answer
  362. exten => s,n,Wait(1)
  363. exten => s,n,Set(fromext=${CALLERID(num)})
  364. exten => s,n,Noop(Deleting: CF/${fromext} ${DB_DELETE(CF/${fromext})})
  365. exten => s,n,Playback(call-fwd-unconditional&de-activated)
  366. exten => s,n,Hangup
  367. [app-cf-busy-on]
  368. exten => _cf-X.,1,Answer
  369. exten => _cf-X.,n,Wait(1)
  370. exten => _cf-X.,n,Set(fromext=${CALLERID(num)})
  371. exten => _cf-X.,n,Set(toext=${EXTEN:3})
  372. exten => _cf-X.,n,Playback(vm-extension)
  373. exten => _cf-X.,n,SayDigits(${fromext})
  374. exten => _cf-X.,n,Playback(call-fwd-on-busy&is-set-to)
  375. exten => _cf-X.,n,SayDigits(${toext})
  376. exten => _cf-X.,n,Playback(if-correct-press&digits/1)
  377. exten => _cf-X.,n,Noop(Waiting for input)
  378. exten => _cf-X.,n(end),WaitExten(60,)
  379. exten => _cf-X.,n,Playback(sorry-youre-having-problems&goodbye)
  380. exten => _cf-X.,n,Hangup
  381. exten => _1!,1,Set(DB(CFB/${fromext})=${toext})
  382. exten => _1!,n,Noop(Deleting: CF/${fromext} ${DB_DELETE(CF/${fromext})})
  383. exten => _1!,n,Playback(vm-saved&goodbye)
  384. exten => _1!,n,Hangup
  385. [app-cf-busy-off]
  386. exten => s,1,Answer
  387. exten => s,n,Wait(1)
  388. exten => s,n,Set(fromext=${CALLERID(num)})
  389. exten => s,n,Noop(Deleting: CFB/${fromext} ${DB_DELETE(CFB/${fromext})})
  390. exten => s,n,Playback(call-fwd-on-busy&de-activated)
  391. exten => s,n,Hangup
  392. [app-cf-unavailable-on]
  393. exten => _cf-X.,1,Answer
  394. exten => _cf-X.,n,Wait(1)
  395. exten => _cf-X.,n,Set(fromext=${CALLERID(num)})
  396. exten => _cf-X.,n,Set(toext=${EXTEN:3})
  397. exten => _cf-X.,n,Playback(vm-extension)
  398. exten => _cf-X.,n,SayDigits(${fromext})
  399. exten => _cf-X.,n,Playback(call-fwd-no-ans&is-set-to)
  400. exten => _cf-X.,n,SayDigits(${toext})
  401. exten => _cf-X.,n,Playback(if-correct-press&digits/1)
  402. exten => _cf-X.,n,Noop(Waiting for input)
  403. exten => _cf-X.,n(end),WaitExten(60,)
  404. exten => _cf-X.,n,Playback(sorry-youre-having-problems&goodbye)
  405. exten => _cf-X.,n,Hangup
  406. exten => _1!,1,Set(DB(CFU/${fromext})=${toext})
  407. exten => _1!,n,Noop(Deleting: CF/${fromext} ${DB_DELETE(CF/${fromext})})
  408. exten => _1!,n,Playback(vm-saved&goodbye)
  409. exten => _1!,n,Hangup
  410. [app-cf-unavailable-off]
  411. exten => s,1,Answer
  412. exten => s,n,Wait(1)
  413. exten => s,n,Set(fromext=${CALLERID(num)})
  414. exten => s,n,Noop(Deleting: CFU/${fromext} ${DB_DELETE(CFU/${fromext})} ${DB_DELETE(CFURingTime/${fromext})})
  415. exten => s,n(hook_1),Playback(call-fwd-no-ans&de-activated)
  416. exten => s,n,Hangup
  417. [macro-queue-settings]
  418. exten => s,1,Set(__DYNAMIC_FEATURES=nway-start)
  419. exten => s,n,Set(CALLER=${CIDNUM})
  420. exten => s,n,Set(CALLEE=${CALLERID(ani)})
  421. exten => s,n,Macro(user-context,${CALLEE})
  422. exten => s,n,Set(TRANSFER_CONTEXT=${EXTCONTEXT})
  423. exten => s,n,Set(TOUCH_MIXMONITOR=${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}-${CALLER}-${CALLEE}-${UNIQUEID})
  424. exten => s,n,Set(TOUCH_MIXMONITOR_FORMAT=${RCDFORMAT})
  425. exten => s,n(checkrecord),Macro(stdexten-record,${CALLER},${CALLEE})
  426. exten => s,n(exit),NoOp(settings exit.)
  427. [macro-queue]
  428. exten => s,1,NoOp(QUEUE)
  429. same => n,Answer
  430. same => n,Queue(${EXTEN},CctkXx,,,${WAITTIME})
  431. same => n,Hangup
  432. exten => _q-X.,1,Queue(${EXTEN:2},ctkXx,,,${WAITTIME},,,,,1)
  433. same => n,Hangup
  434. [asterisk_guitools]
  435. exten = record_vmenu,1,Answer
  436. exten = record_vmenu,n,Playback(vm-intro)
  437. exten = record_vmenu,n,Record(${var1},,,k)
  438. exten = record_vmenu,n,Playback(vm-saved)
  439. exten = record_vmenu,n,Playback(vm-goodbye)
  440. exten = record_vmenu,n,Hangup
  441. exten = play_file,1,Answer
  442. exten = play_file,n,Playback(${var1})
  443. exten = play_file,n,Hangup
  444. [from-voip]
  445. exten = s,1,MSet(FROMTYPE=voip,TIMEOUT(digit)=3,__calltype=incoming,__CAID=${CALLERID(num)})
  446. exten = s,n,Goto(from-voip-custom,s,1)
  447. exten = _[a-zA-Z0-9+].,1,MSet(FROMTYPE=voip,TIMEOUT(digit)=3,__calltype=incoming,__CAID=${CALLERID(num)})
  448. exten = _[a-zA-Z0-9+].,n,Goto(from-voip-custom,${EXTEN},1)
  449. [exten_dod]
  450. #include extensions_extendod_custom.conf
  451. [custom-did]
  452. #include extensions_extendid_custom.conf
  453. include = custom-did-voip
  454. include = default
  455. exten = i,1,Goto(direct-voip,direct,1)
  456. [from-voip-custom]
  457. include = inbound-voip
  458. [inbound-voip]
  459. exten = s,1,GotoIf($["foo${AutoAnswer}"!="foo" & "${AutoAnswer}" != "0"]?answer:notanswer)
  460. exten = s,n(answer),Answer()
  461. exten = s,n,Wait(${AutoAnswer})
  462. exten = s,n(notanswer),Set(__VOIPDID=${CUT(CUT(SIP_HEADER(To),@,1),:,2)})
  463. exten = s,n,GotoIf($["${VOIPDID}"!="s"]?match)
  464. exten = s,n,Goto(direct-voip,direct,1)
  465. exten = s,n(match),Goto(custom-did,${VOIPDID},1)
  466. exten = _[a-zA-Z0-9+].,1,GotoIf($["foo${AutoAnswer}"!="foo" & "${AutoAnswer}" != "0"]?answer:notanswer)
  467. exten = _[a-zA-Z0-9+].,n(answer),Answer()
  468. exten = _[a-zA-Z0-9+].,n,Wait(${AutoAnswer})
  469. exten = _[a-zA-Z0-9+].,n(notanswer),Set(__VOIPDID=${EXTEN})
  470. exten = _[a-zA-Z0-9+].,n,Goto(custom-did,${EXTEN},1)
  471. [from-analog]
  472. exten = s,1,Set(CALLERID(name)=)
  473. exten = s,n,GotoIf($["foo${isDENOISE}" != "fooyes"]?incoming)
  474. exten = s,n,Set(DENOISE(rx)=on)
  475. exten = s,n,Set(DENOISE(tx)=on)
  476. exten = s,n(incoming),MSet(FROMTYPE=analog,TIMEOUT(digit)=3,__calltype=incoming,__CAID=${CALLERID(num)})
  477. exten = s,n,Goto(from-analog-custom,s,1)
  478. [from-analog-custom]
  479. include = inbound-analog
  480. [inbound-analog]
  481. exten = s,1,Set(CHANTMP=${CUT(CHANNEL,/,2)})
  482. exten = s,n,Set(DAHDICHAN=${CUT(CHANTMP,-,1)})
  483. exten = s,n,GotoIf($["foo${AutoAnswer}"!="foo" & "${AutoAnswer}" != "0"]?answer:notanswer)
  484. exten = s,n(answer),Answer()
  485. exten = s,n,Wait(${AutoAnswer})
  486. exten = s,n(notanswer),Macro(analog-custom-${DAHDICHAN})
  487. exten = s,n,Goto(direct-analog,direct,1)