extensions_custom.conf

From Ender, 3 Days ago, written in Plain Text, viewed 2 times. This paste will bite the big one in 3 Weeks.
URL https://pastebin.freepbx.org/view/50767592 Embed
Download Paste or View Raw
  1. ;extensions_custom.conf
  2. ; ----- External calls, lock codec to prevent video
  3. exten => _0.,1,Set(__SIP_CODEC=alaw)
  4. same => next,Goto(outbound-allroutes,${EXTEN},1)
  5.  
  6. ; ----- Feature codes, lock codec to prevent video
  7. exten => _*.,1,Set(__SIP_CODEC=g722)
  8. same => next,Goto(from-internal,${EXTEN},4)
  9.  
  10. ; ----- CISCO custom
  11. [from-internal-custom]
  12. ; ----- Strip the x-cisco-serviceuri- prefix to make handling the cisco events in the dialplan a little simpler
  13. exten => _[x].,1,Goto(${EXTEN:19},1)
  14.  
  15. ; ----- Group Pickup softkey
  16. exten => pickup,1,Pickup()
  17. same => next,Hangup(normal_circuit_congestion)
  18.  
  19. ; ----- BLF Pickup softkey
  20. exten => _blfpickup-.,1,PickupChan(SIP/${EXTEN:10})
  21. same => next,Hangup(normal_circuit_congestion)
  22.  
  23. ; ----- AdHoc call recording softkey
  24. exten => record,1,Answer()
  25. same => next,Wait(0.5)
  26. same => next,Set(CONFBRIDGE(bridge,record_conference)=yes)
  27. same => next,Set(CONFBRIDGE(bridge,record_file)=${RECORD_PEERNAME})
  28. same => next,Set(CONFBRIDGE(user,quiet)=yes)
  29. same => next,ConfBridge(${RECORD_UNIQUEID})
  30. same => next,Hangup(normal_clearing)
  31.  
  32. ; Cisco SIP phones support displaying diversion information
  33. ; ** this part not currently working **
  34. ; exten => forward,SIPAddHeader(Diversion: "${SIPPEER(${PEERNAME},callerid_name)}" <sip:${PEERNAME}@localhost>\;screen=yes\;privacy=off)
  35. ; same => Goto(extensions,${CALLFORWARD},1)
  36.  
  37. ; Enable forwarding
  38. exten => _cfwdall-.,1,Answer
  39. same => next,Set(SIPPEER(${CHANNEL(peername)},callforward)=${EXTEN:8})
  40. same => next,Hangup(normal_clearing)
  41.  
  42. ; Disable forwarding
  43. exten => cfwdall,1,Answer
  44. same => next,Set(SIPPEER(${CHANNEL(peername)},callforward)=)
  45. same => next,Hangup(normal_clearing)
  46.  
  47. [call-extension]
  48. exten => _X.,1,Set(PEERNAME=${EXTEN})
  49. ; By manually checking for call-forwarding, the call can be forwarded even if the phone is unregistered
  50. same => next,Set(CALLFORWARD=${SIPPEER(${PEERNAME},callforward)})
  51. same => next,GotoIf($[${LEN(${CALLFORWARD})} != 0]?callforward,1)
  52. same => next,Set(MAILBOX=${SIPPEER(${PEERNAME},mailbox)})
  53. ; Phones can be made to play a different ring using the Alert-Info header, see Ring Tones for examples
  54. same => next,ExecIf($[${LEN(${ALERT_INFO})} != 0]?SIPAddHeader(Alert-Info: <${ALERT_INFO}>))
  55. same => next,Dial(SIP/${PEERNAME},30)
  56. same => next,Goto(${TOLOWER(${DIALSTATUS})},1)
  57.  
  58. ; Check if forwarded to the phone's voicemail extension
  59. exten => callforward,1,GotoIf($[${CALLFORWARD} = ${SIPPEER(${PEERNAME},vmexten)}]?busy,1)
  60. ; Cisco SIP phones support displaying diversion information
  61. same => next,Set(REDIRECTING(from-all,i)="${SIPPEER(${PEERNAME},callerid_name)}" <${SIPPEER(${PEERNAME},callerid_num)}>)
  62. same => next,Set(REDIRECTING(reason,i)=cfu)
  63. same => next,Goto(extensions,${CALLFORWARD},1)
  64.  
  65. ; If ${MAILBOX} is empty send congestion, otherwise go to voicemail extension below
  66. exten => congestion,1,ExecIf($[${LEN(${MAILBOX})} = 0]?Congestion(10))
  67. same => next,Set(GREETING=u)
  68. same => next,Goto(voicemail,1)
  69.  
  70. ; If ${MAILBOX} is empty send busy, otherwise go to voicemail extension below
  71. exten => busy,1,ExecIf($[${LEN(${MAILBOX})} = 0]?Busy(10))
  72. same => next,Set(GREETING=b)
  73. same => next,Goto(voicemail,1)
  74.  
  75. exten => noanswer,1,Goto(congestion,1)
  76. exten => chanunavail,1,Goto(congestion,1)
  77.  
  78. exten => voicemail,1,Answer()
  79. same => next,Wait(0.5)
  80. same => next,VoiceMail(${MAILBOX},${GREETING})
  81. same => next,Hangup(normal_clearing)
  82.  
  83. [extensions]
  84. exten => 2001,1,Goto(call-extension,${EXTEN},1)
  85. ; Note the duplication of the hint peername
  86. same => hint,SIP/2001,SIP/2001
  87. exten => 2452,1,Goto(call-extension,${EXTEN},1)
  88. same => hint,SIP/2452,SIP/2452
  89. exten => 2271,1,Goto(call-extension,${EXTEN},1)
  90. same => hint,SIP/2271,SIP/2271
  91. exten => 2861,1,Goto(call-extension,${EXTEN},1)
  92. same => hint,PJSIP/2861,PJSIP/2861
  93.  
  94. ; Clear dial group first
  95. exten => 70001,1,Set(DIALGROUP(huntgroup)=)
  96. same => next,Set(PEERNAMES=301&302&303)
  97. same => next,While($[${LEN(${PEERNAMES})} != 0])
  98. same => next,Set(PEERNAME=${SHIFT(PEERNAMES,&)})
  99. ; Check if peer is logged-in to the hunt group and add them to the dial group if they are
  100. same => next,ExecIf($[${SIPPEER(${PEERNAME},huntgroup)} = yes]?Set(DIALGROUP(huntgroup,add)=SIP/${PEERNAME}))
  101. same => next,EndWhile()
  102. ; Send congestion if the dial group is empty
  103. same => next,ExecIf($[${LEN(${DIALGROUP(huntgroup)})} = 0]?Congestion(10))
  104. ; Phones support 'Answered Elsewhere' so the 'c' flag is included
  105. ; Later series need to be logged into the hunt-group and have CISCO_HUNTPILOT set to not record answered calls as missed
  106. same => next,Set(_CISCO_HUNTPILOT="Ring All" <${EXTEN}>)
  107. same => next,Dial(${DIALGROUP(huntgroup)},30,ic)
  108. same => next,Hangup(${HANGUPCAUSE})
  109. ; Clear dial group first
  110. exten => 70002,1,Set(DIALGROUP(huntgroup)=)
  111. same => next,Set(PEERNAMES=301&302&303)
  112. same => next,While($[${LEN(${PEERNAMES})} != 0])
  113. same => next,Set(PEERNAME=${SHIFT(PEERNAMES,&)})
  114. ; Check if peer is logged-in to the hunt group and add them to the dial group if they are
  115. same => next,ExecIf($[${SIPPEER(${PEERNAME},huntgroup)} = yes]?Set(DIALGROUP(huntgroup,add)=SIP/${PEERNAME}))
  116. same => next,EndWhile()
  117. ; Send congestion if the dial group is empty
  118. same => next,ExecIf($[${LEN(${DIALGROUP(huntgroup)})} = 0]?Congestion(10))
  119. ; Phones support 'Answered Elsewhere' so the 'c' flag is included
  120. ; Later series need to be logged into the hunt-group and have CISCO_HUNTPILOT set to not record answered calls as missed
  121. same => next,Set(_CISCO_HUNTPILOT="Ring All" <${EXTEN}>)
  122. same => next,Dial(${DIALGROUP(huntgroup)},30,ic)
  123. same => next,Hangup(${HANGUPCAUSE})
  124. ; Clear dial group first
  125. exten => 70003,1,Set(DIALGROUP(huntgroup)=)
  126. same => next,Set(PEERNAMES=301&302&303)
  127. same => next,While($[${LEN(${PEERNAMES})} != 0])
  128. same => next,Set(PEERNAME=${SHIFT(PEERNAMES,&)})
  129. ; Check if peer is logged-in to the hunt group and add them to the dial group if they are
  130. same => next,ExecIf($[${SIPPEER(${PEERNAME},huntgroup)} = yes]?Set(DIALGROUP(huntgroup,add)=SIP/${PEERNAME}))
  131. same => next,EndWhile()
  132. ; Send congestion if the dial group is empty
  133. same => next,ExecIf($[${LEN(${DIALGROUP(huntgroup)})} = 0]?Congestion(10))
  134. ; Phones support 'Answered Elsewhere' so the 'c' flag is included
  135. ; Later series need to be logged into the hunt-group and have CISCO_HUNTPILOT set to not record answered calls as missed
  136. same => next,Set(_CISCO_HUNTPILOT="Ring All" <${EXTEN}>)
  137. same => next,Dial(${DIALGROUP(huntgroup)},30,ic)
  138. same => next,Hangup(${HANGUPCAUSE})
  139.  
  140. ; Only allow one page at a time
  141. exten => 7255,1,Set(GROUP()=paging)
  142. same => next,ExecIf($[${GROUP_COUNT(paging)} != 1]?Busy(10))
  143. ; Multicast audio mode is enabled using the m() option
  144. same => next,SIPCiscoPage(2452&2001&2271,om(224.0.1.1)d(From ${CALLERID(number)}))
  145. same => next,Hangup(normal_clearing)
  146.  
  147. exten => _blfpickup-.,1,PickupChan(SIP/${EXTEN:10})
  148. same => next,Hangup(normal_circuit_congestion)
  149.  
  150. ; Enable call-forwarding
  151. exten => _cfwdall-.,1,Answer()
  152. same => next,Set(SIPPEER(${CHANNEL(peername)},callforward)=${EXTEN:8})
  153. same => next,Hangup(normal_clearing)
  154.  
  155. ; Disable call-forwarding
  156. exten => cfwdall,1,Answer()
  157. same => next,Set(SIPPEER(${CHANNEL(peername)},callforward)=)
  158. same => next,Hangup(normal_clearing)
  159.  
  160. exten => record,1,Answer()
  161. same => next,Wait(0.5)
  162. same => next,Set(CONFBRIDGE(bridge,record_conference)=yes)
  163. same => next,Set(CONFBRIDGE(bridge,record_file)=${RECORD_PEERNAME})
  164. same => next,Set(CONFBRIDGE(user,quiet)=yes)
  165. ; Other channel variables available are ${RECORD_CHANNEL} and ${RECORD_DIRECTION}.
  166. same => next,ConfBridge(${RECORD_UNIQUEID})
  167. same => next,Hangup(normal_clearing)
  168.  
  169. exten => _X.,1,Set(_CISCO_AUTOANSWER=yes)
  170. same => next,Page(SIP/2001&SIP/2452,sni,30)

Reply to "extensions_custom.conf"

Here you can reply to the paste above