Guest User

Untitled

a guest
Jan 19th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.13 KB | None | 0 0
  1. ;
  2. ; Static extension configuration file, used by
  3. ; the pbx_config module. This is where you configure all your
  4. ; inbound and outbound calls in Asterisk.
  5. ;
  6. ; This configuration file is reloaded
  7. ; - With the "extensions reload" command in the CLI
  8. ; - With the "reload" command (that reloads everything) in the CLI
  9.  
  10. ;
  11. ; The "General" category is for certain variables.
  12. ;
  13. [general]
  14. ;
  15. ; If static is set to no, or omitted, then the pbx_config will rewrite
  16. ; this file when extensions are modified. Remember that all comments
  17. ; made in the file will be lost when that happens.
  18. ;
  19. ; XXX Not yet implemented XXX
  20. ;
  21. static=yes
  22. ;
  23. ; if static=yes and writeprotect=no, you can save dialplan by
  24. ; CLI command 'save dialplan' too
  25. ;
  26. writeprotect=no
  27. ;
  28. ; If autofallthrough is set, then if an extension runs out of
  29. ; things to do, it will terminate the call with BUSY, CONGESTION
  30. ; or HANGUP depending on Asterisk's best guess (strongly recommended).
  31. ;
  32. ; If autofallthrough is not set, then if an extension runs out of
  33. ; things to do, asterisk will wait for a new extension to be dialed
  34. ; (this is the original behavior of Asterisk 1.0 and earlier).
  35. ;
  36. autofallthrough=no
  37. ;
  38. ; If clearglobalvars is set, global variables will be cleared
  39. ; and reparsed on an extensions reload, or Asterisk reload.
  40. ;
  41. ; If clearglobalvars is not set, then global variables will persist
  42. ; through reloads, and even if deleted from the extensions.conf or
  43. ; one of its included files, will remain set to the previous value.
  44. ;
  45. clearglobalvars=no
  46. ;
  47. ; If priorityjumping is set to 'yes', then applications that support
  48. ; 'jumping' to a different priority based on the result of their operations
  49. ; will do so (this is backwards compatible behavior with pre-1.2 releases
  50. ; of Asterisk). Individual applications can also be requested to do this
  51. ; by passing a 'j' option in their arguments.
  52. ;
  53. priorityjumping=no
  54. ;
  55. ; You can include other config files, use the #include command
  56. ; (without the ';'). Note that this is different from the "include" command
  57. ; that includes contexts within other contexts. The #include command works
  58. ; in all asterisk configuration files.
  59. ;#include "filename.conf"
  60.  
  61. ; The "Globals" category contains global variables that can be referenced
  62. ; in the dialplan with ${VARIABLE} or ${ENV(VARIABLE)} for Environmental
  63. ; variables,
  64. ; ${${VARIABLE}} or ${text${VARIABLE}} or any hybrid
  65. ;
  66.  
  67. [globals]
  68.  
  69. VOICEPULSE_API_KEY=sdajdghajsd
  70. ;VOICEPULSE_API_KEY=sdasdasda
  71. VOICEPULSE_API_PREFIX=VOICEPULSE_
  72.  
  73. DID1=2222222222
  74. DID2=1111111111
  75. CIDNAME1=blarg
  76.  
  77. ; .........................................................
  78. ; Peers
  79. ; .........................................................
  80.  
  81. VOICEPULSE_GATEWAY_OUT_A=voicepulse01
  82. VOICEPULSE_GATEWAY_OUT_B=voicepulse02
  83.  
  84. ; ---------------------------------------------------------
  85. ; [arbitrary-name] is the context referred to by the
  86. ; [voicepulse-in-01] user in iax.conf. This is where your
  87. ; custom incoming call processing should go.
  88. ;
  89. ; For sample purposes, this section will read back the
  90. ; dialed number and then test DTMF by reading back each
  91. ; digit pressed by the caller.
  92. ; ---------------------------------------------------------
  93.  
  94. [voicepulse-in] ; <-- Should match the context you have
  95. ; under [voicepulse-in-01] in iax.conf
  96.  
  97. exten => _1${DID1},1,Ringing
  98. exten => _1${DID1},2,Wait(6)
  99. exten => _1${DID1},3,Goto(teeheee,s,1)
  100. exten => _1${DID1},4,Hangup
  101.  
  102. exten => _1${DID2},1,Ringing
  103. exten => _1${DID2},2,Wait(6)
  104. exten => _1${DID2},3,Voicemail(130)
  105. exten => _1${DID2},4,Hangup
  106.  
  107. exten => a, 1, VoicemailMain(@default)
  108. exten => a, 2, Hangup
  109.  
  110. exten => t,1,Voicemail(110,u)
  111. exten => i,1,Hangup
  112.  
  113. ;
  114. ; teehee Menu
  115. ;
  116. [teehee]
  117. include => common
  118. exten => s,1,Answer
  119. exten => s,2,Dial(SIP/100&SIP/110&SIP/111,15,trx)
  120. exten => s,3,Voicemail(110,u)
  121. ;exten => s,3,Background(custom/blargh)
  122. ;exten => _0,1,Voicemail(100,u)
  123. ;exten => _1,1,Voicemail(110,u)
  124. ;exten => _2,1,Voicemail(111,u)
  125. exten => 999,1,VoicemailMain
  126. exten => *0*,1,Authenticate(21986129878610249)
  127. exten => *0*,2,Playback(agent-loginok)
  128. exten => *0*,3,Goto(outgoing,s,1)
  129. exten => t,1,Hangup
  130. exten => i,1,Hangup
  131.  
  132. ;
  133. ; Main Menu
  134. ;
  135. [main]
  136. include => common
  137. exten => s,1,Answer
  138. exten => s,2,Background(custom/blargh)
  139. exten => _0,1,Voicemail(101,u)
  140. exten => _1,1,Dial(SIP/100,15)
  141. exten => _1,2,Voicemail(100,u)
  142. exten => _1,102,Voicemail(100,u)
  143. exten => _2,1,Dial(SIP/100,15)
  144. exten => _2,2,Voicemail(100,u)
  145. exten => _2,102,Voicemail(100,u)
  146. exten => 999,1,VoicemailMain
  147. exten => *0*,1,Authenticate(555)
  148. exten => *0*,2,Playback(agent-loginok)
  149. exten => *0*,3,Goto(outgoing,s,1)
  150. exten => t,1,Hangup
  151. exten => i,1,Hangup
  152.  
  153.  
  154. ;
  155. ; Select an outgoing context
  156. ;
  157. [outgoing]
  158. include => common
  159. include => parkedcalls
  160. exten => s,1,Wait(1)
  161. exten => _1NXXNXXXXXX,1,Goto(outgoing-voicepulse,${EXTEN},1)
  162. exten => _21NXXNXXXXXX,1,Goto(outgoing-voicepulse,${EXTEN:1},1)
  163. exten => 911,1,Dial(SIP/+12129279711@${VOICEPULSE_GATEWAY_OUT_A})
  164. exten => 999,1,Playback(beep)
  165. exten => 999,2,VoicemailMain(${CALLERID(number)},s)
  166. exten => _*91XX,1,Playback(beep)
  167. exten => _*91XX,2,VoiceMailMain(s${EXTEN:2})
  168. exten => _*51XX,1,SIPAddHeader(Alert-Info: Ring Answer)
  169. exten => _*51XX,2,Dial(SIP/${EXTEN:2})
  170. exten => _*51XX,3,Hangup
  171. ;exten => *0*,1,Authenticate(555)
  172. ;exten => *0*,2,Playback(agent-loginok)
  173. ;exten => *0*,3,Goto(internal,s,1)
  174. exten => t,1,Hangup
  175. exten => i,1,Hangup
  176.  
  177.  
  178. ;
  179. ; Shared Extensions
  180. ;
  181. [common]
  182. exten => _1XX,1,Dial(SIP/${EXTEN},15,X)
  183. exten => _1XX,2,Voicemail(${EXTEN},u)
  184. exten => _1XX,102,Voicemail(${EXTEN},u)
  185. exten => _11XX,1,SIPAddHeader(Alert-Info: Ring Answer)
  186. exten => _11XX,2,Dial(sip/${EXTEN:1})
  187. exten => _11XX,3,Voicemail(${EXTEN:1},u)
  188. exten => _11XX,103,Voicemail(${EXTEN:1},u)
  189. exten => *3,1,Playback(beep)
  190. exten => *3,2,Echo
  191. exten => *7,1,Set(TIMEOUT(digit)=3)
  192. exten => *7,n,Set(TIMEOUT(response)=5)
  193. exten => *7,n,Answer
  194. exten => *7,n,Read(callfrom,beep,11)
  195. exten => *7,n,Read(callto,beep,11)
  196. exten => *7,n,NoOp(${callfrom})
  197. exten => *7,n,NoOp(${callto})
  198. ;exten => *7,n,SetCIDNum(${callfrom})
  199. exten => *7,n,Set(CALLERID(name)=Blargggh)
  200. exten => *7,n,Set(CALLERID(number)=${callfrom})
  201. exten => *7,n,Dial(SIP/+${callto}@${VOICEPULSE_GATEWAY_OUT_A})
  202. exten => *7,n,Hangup
  203.  
  204. ;
  205. ; Internal Functions
  206. ;
  207. [internal]
  208. exten => s,1,Wait(1)
  209. exten => _*1XX,1,Answer()
  210. exten => _*1XX,n,System(/usr/sbin/asterisk -rx "sip notify polycom-check-cfg ${EXTEN:1}")
  211. exten => _*1XX,n,Hangup()
  212. exten => t,1,Hangup
  213. exten => i,1,Hangup
  214.  
  215. ;
  216. ; Just Voicemail
  217. ;
  218. [voicemail-only]
  219. exten => s,1,Wait(1)
  220. exten => 999,1,Playback(beep)
  221. exten => 999,2,VoicemailMain(${CALLERID(number)},s)
  222. exten => t,1,Hangup
  223. exten => i,1,Hangup
  224.  
  225. [outgoing-voicepulse]
  226. exten => _1NXXNXXXXXX,1,Set(CALLERID(num)=${DID1},a)
  227. exten => _1NXXNXXXXXX,2,Set(CALLERID(name)=${CIDNAME1},a)
  228. exten => _1NXXNXXXXXX,3,Set(TOUCH_MIXMONITOR_FORMAT=wav)
  229. exten => _1NXXNXXXXXX,4,NoOp(${TOUCH_MIXMONITOR_FORMAT})
  230. exten => _1NXXNXXXXXX,5,Dial(SIP/+${EXTEN}@${VOICEPULSE_GATEWAY_OUT_A},,X)
  231. exten => _1NXXNXXXXXX,6,GotoIf($[${DIALSTATUS}=CHANUNAVAIL]?${EXTEN},10)
  232. exten => _1NXXNXXXXXX,10,Dial(SIP/+${EXTEN}@${VOICEPULSE_GATEWAY_OUT_B},,X)
Add Comment
Please, Sign In to add comment