Advertisement
Guest User

Dialplan

a guest
May 27th, 2019
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. [globals]
  2. INTERNAL_DIAL_OPT=,30
  3.  
  4.  
  5.  
  6. [features]
  7. exten = *29,1,Verbose(1, "User ${CALLERID(num)} dialed the voicemail feature.")
  8.  same = n,VoiceMailMain(${CHANNEL(endpoint)}@backpackbang,s)
  9.  same = n,Hangup()
  10.  
  11. exten = 8000,1,Verbose(1, "User ${CALLERID(num)} dialed the voicemail feature.")
  12.  same = n,VoiceMailMain(09614204020@backpackbang)
  13.  same = n,Hangup()
  14.  
  15.  
  16.  
  17. [dialing-errors]
  18. exten = _X.,1,Verbose(1, "User ${CALLERID(num)} dialed an invalid number.")
  19.  same = n,Playback(pbx-invalid)
  20.  same = n,Hangup()
  21.  
  22.  
  23.  
  24. [dial-users]
  25. exten = _100X,1,Verbose(1, "User ${CALLERID(num)} dialed ${EXTEN}.")
  26.  same = n,Set(DIALED_EXTEN=${EXTEN})
  27.  same = n,Gotoif($[${DEVICE_STATE(PJSIP/${EXTEN})} = BUSY]?dialed-BUSY,1:)
  28.  same = n,Dial(PJSIP/${EXTEN}${INTERNAL_DIAL_OPT})
  29.  same = n,Goto(dialed-${DIALSTATUS},1)
  30.  
  31. exten = dialed-NOANSWER,1,NoOp()
  32.  same = n,Voicemail(${DIALED_EXTEN}@backpackbang,u)
  33.  same = n,Hangup()
  34.  
  35. exten = dialed-BUSY,1,NoOp()
  36.  same = n,Voicemail(${DIALED_EXTEN}@backpackbang,b)
  37.  same = n,Hangup()
  38.  
  39. exten = dialed-CHANUNAVAIL,1,NoOp()
  40.  same = n,Playback(pbx-invalid)
  41.  same = n,Hangup()
  42.  
  43. exten = _dialed-.,1,Goto(dialed-NOANSWER,1)
  44.  
  45. exten = h,1,Hangup()
  46.  
  47.  
  48.  
  49. [outbound-dial]
  50. exten = _011.,1,Hangup() ; a sample to identify what to restrict
  51. ; Dial outbound through our SIP ITSP when number is atleast 9 digits beginning 0
  52. exten = _0XXXXXXXX!,1,Verbose(1, "Didn't match any restricted numbers, proceeding with outbound dial.")
  53.  same = n,Set(CALLERID(name)=Backpack Technologies Inc.)
  54.  same = n,Set(CALLERID(num)=09614204020)
  55.  same = n,Dial(PJSIP/${EXTEN}@support)
  56.  same = n,Hangup()
  57.  
  58.  
  59.  
  60. [internal-main]
  61. ; The order of includes here is important for matching the right extensions.
  62. include = features
  63. include = dial-users
  64. include = queues
  65. include = outbound-dial
  66. include = dialing-errors
  67.  
  68.  
  69.  
  70. [queues]
  71. exten = 4020,1,Goto(ivr-greeting,1)
  72.  
  73. exten = ivr-greeting,1,NoOp(${CALLERID(all)} is in the greeting section)
  74.  same = n,Answer()
  75.  same = n(options),NoOp(In OPTIONS section)
  76.  same = n,GotoIf($[${EXISTS(${LoopCount})}]?read)
  77.  same = n,Set(LoopCount=0)
  78.  same = n(read),NoOp(${LoopCount})
  79.  same = n,Read(MENUCHOICE,/etc/asterisk/asterisk-main-menu,1,s,2,3)
  80.  same = n,GotoIf($[ "${MENUCHOICE}" = "1"]?ivr-intent-bangla)
  81.  same = n,GotoIf($[ "${MENUCHOICE}" = "2"]?ivr-intent-english)
  82.  same = n(invalid),SayDigits(${MENUCHOICE})
  83.  same = n,Playback(pbx-invalid)
  84.  same = n,Set(LoopCount=$[${LoopCount} + 1])
  85.  same = n,GotoIf($[ "${LoopCount}" <= "2"]?options)
  86.  same = n,Voicemail(09614204020@example,u)
  87.  same = n,Hangup()
  88.  same = n(ivr-intent-bangla),Goto(ivr-intent-bangla,1)
  89.  same = n(ivr-intent-english),Goto(ivr-intent-english,1)
  90.  
  91. exten = ivr-intent-english,1,NoOp(${CALLERID(all)} is in now Intent English Section)
  92.  same = n,Answer()
  93.  same = n(options),NoOp(In OPTIONS - Intent english section)
  94.  same = n,GotoIf($[${EXISTS(${LoopCount})}]?read)
  95.  same = n,Set(LoopCount=0)
  96.  same = n(read),NoOp(${LoopCount})
  97.  same = n,Read(ENGLISHINTENTCHOICE,/etc/asterisk/asterisk-intent-english,1,s,2,3)
  98.  same = n,GotoIf($[ "${ENGLISHINTENTCHOICE}" = "1"]?sales)
  99.  same = n,GotoIf($[ "${ENGLISHINTENTCHOICE}" = "2"]?ivr-invoice-english)
  100.  same = n(invalid),SayDigits(${ENGLISHINTENTCHOICE})
  101.  same = n,Playback(pbx-invalid)
  102.  same = n,Set(LoopCount=$[${LoopCount} + 1])
  103.  same = n,GotoIf($[ "${LoopCount}" <= "2"]?options)
  104.  same = n,Voicemail(09614204020@example,u)
  105.  same = n,Hangup()
  106.  same = n(sales),Goto(sales,1)
  107.  same = n(ivr-invoice-english),Goto(ivr-invoice-english,1)
  108.  
  109. exten = ivr-intent-bangla,1,NoOp(${CALLERID(all)} is in now Intent Bangla Section)
  110.  same = n,Answer()
  111.  same = n(options),NoOp(In OPTIONS - Intent Bangla Section)
  112.  same = n,GotoIf($[${EXISTS(${LoopCount})}]?read)
  113.  same = n,Set(LoopCount=0)
  114.  same = n(read),NoOp(${LoopCount})
  115.  same = n,Read(BANGLAINTENTCHOICE,/etc/asterisk/asterisk-intent-bangla,1,s,2,3)
  116.  same = n,GotoIf($[ "${BANGLAINTENTCHOICE}" = "1"]?sales)
  117.  same = n,GotoIf($[ "${BANGLAINTENTCHOICE}" = "2"]?ivr-invoice-bangla)
  118.  same = n(invalid),SayDigits(${BANGLAINTENTCHOICE})
  119.  same = n,Playback(pbx-invalid)
  120.  same = n,Set(LoopCount=$[${LoopCount} + 1])
  121.  same = n,GotoIf($[ "${LoopCount}" <= "2"]?options)
  122.  same = n,Voicemail(09614204020@example,u)
  123.  same = n,Hangup()
  124.  same = n(sales),Goto(sales,1)
  125.  same = n(ivr-invoice-bangla),Goto(ivr-invoice-bangla,1)
  126.  
  127. exten = ivr-invoice-english,1,NoOp(${CALLERID(all)} is in now Invoice English section)
  128.  same = n,Answer()
  129.  same = n(options),NoOp(In OPTIONS section - Invoice English Section)
  130.  same = n,GotoIf($[${EXISTS(${LoopCount})}]?read)
  131.  same = n,Set(LoopCount=0)
  132.  same = n(read),NoOp(${LoopCount})
  133.  same = n,Read(ENGLISHINVOICENUMBER,/etc/asterisk/invoice-intent-english,6,s,1,12)
  134.  same = n,Set(CALLERID(name)=INVOICE#${ENGLISHINVOICENUMBER})
  135.  same = n,Goto(support)
  136.  same = n(invalid),SayDigits(${ENGLISHINVOICENUMBER})
  137.  same = n,Playback(pbx-invalid)
  138.  same = n,Set(LoopCount=$[${LoopCount} + 1])
  139.  same = n,GotoIf($[ "${LoopCount}" <= "2"]?options)
  140.  same = n,Voicemail(09614204020@example,u)
  141.  same = n,Hangup()
  142.  same = n(support),Goto(support,1)
  143.  
  144. exten = ivr-invoice-bangla,1,NoOp(${CALLERID(all)} is in now Invoice Bangla section)
  145.  same = n,Answer()
  146.  same = n(options),NoOp(In OPTIONS section - Invoice Bangla Section)
  147.  same = n,GotoIf($[${EXISTS(${LoopCount})}]?read)
  148.  same = n,Set(LoopCount=0)
  149.  same = n(read),NoOp(${LoopCount})
  150.  same = n,Read(BANGLAINVOICENUMBER,/etc/asterisk/invoice-intent-bangla,6,s,1,12)
  151.  same = n,Set(CALLERID(name)=INVOICE#${BANGLAINVOICENUMBER})
  152.  same = n,Goto(support)
  153.  same = n(invalid),SayDigits(${INTENTCHOICE})
  154.  same = n,Playback(pbx-invalid)
  155.  same = n,Set(LoopCount=$[${LoopCount} + 1])
  156.  same = n,GotoIf($[ "${LoopCount}" <= "2"]?options)
  157.  same = n,Voicemail(09614204020@example,u)
  158.  same = n,Hangup()
  159.  same = n(support),Goto(support,1)
  160.  
  161. exten = sales,1,Verbose(1, "${CALLERID(all)} entering sales queue")
  162.  same = n,Answer()
  163.  same = n,Queue(sales)
  164.  same = n,Voicemail(09614204020@backpackbang,u)
  165.  same = n,Hangup()
  166.  
  167.  
  168. exten = support,1,Verbose(1, "${CALLERID(all)} entering support queue")
  169.  same = n,Answer()
  170.  same = n,Queue(support)
  171.  same = n,Voicemail(09614204020@backpackbang,u)
  172.  same = n,Hangup()
  173.  
  174.  
  175. exten = *54,1,Verbose(1, "Logging in Queue Member ${Queues}")
  176.  same = n,Set(QueuesBuffer=${Queues})
  177.  same = n,Set(MemberChannel=${CHANNEL(channeltype)}/${CHANNEL(endpoint)})
  178.  same = n,While($["${SET(next=${POP(QueuesBuffer,^)})}" != ""])
  179.  same = n,Verbose(1, "Logging in Queue Member ${MemberChannel} to ${next}")
  180.  same = n,AddQueueMember(${next},${MemberChannel},,,${MemberChannel})
  181.  same = n,Verbose(1, "${AQMSTATUS}")
  182.  same = n,EndWhile
  183.  same = n,Playback(agent-loginok)
  184.  same = n,Hangup()
  185.  
  186.  
  187. exten = *56,1,Verbose(1, "Logging off Queue Member")
  188.  same = n,Set(QueuesBuffer=${Queues})
  189.  same = n,Set(MemberChannel=${CHANNEL(channeltype)}/${CHANNEL(endpoint)})
  190.  same = n,While($["${SET(next=${POP(QueuesBuffer,^)})}" != ""])
  191.  same = n,Verbose(1, "Logging off Queue Member ${MemberChannel} from ${next}")
  192.  same = n,RemoveQueueMember(${next},${MemberChannel})
  193.  same = n,Verbose(1, "${RQMSTATUS}")
  194.  same = n,EndWhile
  195.  same = n,Playback(agent-loggedoff)
  196.  same = n,Hangup()
  197.  
  198.  
  199. exten = *72,1,Verbose(1, "Pause Queue Member")
  200.  same = n,Set(MemberChannel=${CHANNEL(channeltype)}/${CHANNEL(endpoint)})
  201.  same = n,PauseQueueMember(,${MemberChannel})
  202.  same = n,Verbose(1, "${PQMSTATUS}")
  203.  same = n,Playback(dictate/paused)
  204.  same = n,Hangup()
  205.  
  206.  
  207. exten = *87,1,Verbose(1, "Unpause Queue Member")
  208.  same = n,Set(MemberChannel=${CHANNEL(channeltype)}/${CHANNEL(endpoint)})
  209.  same = n,UnpauseQueueMember(,${MemberChannel})
  210.  same = n,Verbose(1, "${UPQMSTATUS}")
  211.  same = n,Playback(agent-loginok)
  212.  same = n,Hangup()
  213.  
  214.  
  215.  
  216. [local]
  217. exten = _X.,1,NoOp()
  218.  same = n,Verbose(1, "${CALLERID(all)} dialed.")
  219.  same = n,Set(CDR_PROP(disable)=1)
  220.  same = n,Goto(internal-main,${EXTEN},1)
  221.  
  222. exten = _*X.,1,NoOp()
  223.  same = n,Verbose(1, "${CALLERID(all)} dialed.")
  224.  same = n,Set(CDR_PROP(disable)=1)
  225.  same = n,Goto(internal-main,${EXTEN},1)
  226.  
  227.  
  228.  
  229. [trunk-incoming]
  230. exten = 09614204020,1,Verbose(1, "New caller, ${CALLERID(num)} dialed from external to hunt number.")
  231.  same = n,Goto(queues,ivr-greeting,1)
  232.  
  233.  
  234. exten = _+X.,1,Goto(invalid,1)
  235. exten = _X.,1,Goto(invalid,1)
  236.  
  237.  
  238. exten = invalid,1,Verbose(1, "Invalid extension")
  239.  same = n,Answer()
  240.  same = n,Playback(pbx-invalid)
  241.  same = n,Hangup()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement