-
Notifications
You must be signed in to change notification settings - Fork 6
/
extensions-conf.html
325 lines (317 loc) · 20.9 KB
/
extensions-conf.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
<!DOCTYPE html>
<html lang="en">
<head>
<title>Dialplan Extensions</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
<link rel="shortcut icon" href="images/logo.svg">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:FILL@0..1">
<link rel="stylesheet" href="includes/theme.css">
<link rel="stylesheet" href="includes/prettify.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script src="includes/prettify.js"></script>
<script src="includes/lang-astexten.js"></script>
<script>
jQuery(window).on("load", function () {
prettyPrint();
});
</script>
</head>
<body>
<header>
<a href="/"><img src="images/logo.svg" alt=""></a>
<h2><<span>proxy</span>></h2><h1><span>USECALLMANAGER</span>.nz</h1><h2></<span>proxy</span>></h2>
</header>
<main>
<nav>
<ul>
<li><a href="documentation-overview.html"><span class="icon">home</span> Documentation Overview</a></li>
<li><a href="patching-asterisk.html"><span class="icon">build</span> Patching Asterisk</a></li>
</ul>
<ul>
<li><h3>Network Configuration</h3></li>
<li><a href="dhcpd-conf.html"><span class="icon">settings_ethernet</span> DHCP Options</a></li>
<li><a href="apache-conf.html"><span class="icon">file_download</span> HTTP Provisioning</a></li>
<li><a href="tftpd-conf.html"><span class="icon">file_download</span> TFTP Provisioning</a></li>
</ul>
<ul>
<li><h3>Phone Configuration</h3></li>
<li><a href="sepmac-cnf-xml.html"><span class="icon">settings_phone</span> SEPMAC.cnf.xml</a></li>
<li><a href="dial-template-xml.html"><span class="icon">dialpad</span> Dial Templates</a></li>
<li><a href="app-dial-rules-xml.html"><span class="icon">bluetooth</span> Application Dial Rules</a></li>
<li><a href="soft-keys-xml.html"><span class="icon">power_input</span> Soft Keys</a></li>
<li><a href="line-keys-xml.html"><span class="icon">format_list_bulleted</span> Line Keys</a></li>
<li><a href="feature-policy-xml.html"><span class="icon">fact_check</span> Feature Policy</a></li>
<li><a href="network-locale.html"><span class="icon">language</span> Network Locale</a></li>
<li><a href="user-locale.html"><span class="icon">face</span> User Locale</a></li>
<li><a href="load-information.html"><span class="icon">file_upload</span> Firmware Load Information</a></li>
<li><a href="image-list-xml.html"><span class="icon">wallpaper</span> Background Images</a></li>
<li><a href="ring-list-xml.html"><span class="icon">ring_volume</span> Ring Tones</a></li>
<li><a href="itl-file-tlv.html"><span class="icon">security</span> Device Security</a></li>
<li><a href="trust-verification.html"><span class="icon">verified</span> Trust Verification</a></li>
<li><a href="certificate-enrollment.html"><span class="icon">card_membership</span> Certificate Enrollment</a></li>
<li><a href="vpn-group.html"><span class="icon">vpn_key</span> VPN Connection</a></li>
</ul>
<ul>
<li><h3>Asterisk Configuration</h3></li>
<li><a href="sip-conf.html"><span class="icon">dialer_sip</span> SIP Peers</a></li>
<li><a href="sip-notify-conf.html"><span class="icon">settings_power</span> SIP Notify Commands</a></li>
<li><span class="icon selected">format_list_numbered</span> <b>Dialplan Extensions</b></li>
<li><a href="res-parking-conf.html"><span class="icon">local_parking</span> Call Parking</a></li>
<li><a href="sippeer-options.html"><span class="icon">code</span> SIPPEER Options</a></li>
<li><a href="rtp-streaming.html"><span class="icon">volume_up</span> RTP Streaming</a></li>
<li><a href="command-line.html"><span class="icon">keyboard_arrow_right</span> Command Line</a></li>
<li><a href="freepbx-integration.html"><span class="icon">view_kanban</span> FreePBX Integration</a></li>
</ul>
<ul>
<li><h3>XML Services</h3></li>
<li><a href="phone-services-xml.html"><span class="icon">settings</span> Phone Services</a></li>
<li><a href="cgi-execute-xml.html"><span class="icon">phone_forwarded</span> CGI Execute</a></li>
</ul>
<ul>
<li><h3>Additional Features</h3></li>
<li><a href="as-feature-events.html"><span class="icon">extension</span> AS Feature Events</a></li>
</ul>
</nav>
<article>
<h1>Dialplan Extensions</h1>
Example extension dialplan configuration sections in <code class="literal">extensions.conf</code>. Phone features such as call-forwarding, pickup and parking require <a href="extensions-conf.html#x-cisco-serviceuri">x-cisco-serviceuri</a> extensions to be configured.<br>
<br>
<h2 id="call-extension">call-extension <a href="#call-extension" title="Link">link</a></h2>
Context to call a SIP phone extension. Call-forwarding and Alert-Info as well as an optional voice mailbox is supported.<br>
<br>
<code class="prettify lang-astexten">[call-extension]
exten => _X.,1,Set(PEERNAME=${EXTEN})
; By manually checking for call-forwarding, the call can be forwarded even if the phone is unregistered
same => next,Set(CALLFORWARD=${SIPPEER(${PEERNAME},callforward)})
same => next,GotoIf($[${LEN(${CALLFORWARD})} != 0]?callforward,1)
same => next,Set(MAILBOX=${SIPPEER(${PEERNAME},mailbox)})
; Phones can be made to play a different ring using the Alert-Info header, see Ring Tones for examples
same => next,ExecIf($[${LEN(${ALERT_INFO})} != 0]?SIPAddHeader(Alert-Info: <${ALERT_INFO}>))
same => next,Dial(SIP/${PEERNAME},30)
same => next,Goto(${TOLOWER(${DIALSTATUS})},1)
; Check if forwarded to the phone's voicemail extension
exten => callforward,1,GotoIf($[${CALLFORWARD} = ${SIPPEER(${PEERNAME},vmexten)}]?busy,1)
; Cisco SIP phones support displaying diversion information
same => next,Set(REDIRECTING(from-all,i)="${SIPPEER(${PEERNAME},callerid_name)}" <${SIPPEER(${PEERNAME},callerid_num)}>)
same => next,Set(REDIRECTING(reason,i)=cfu)
same => next,Goto(extensions,${CALLFORWARD},1)
; If ${MAILBOX} is empty send congestion, otherwise go to voicemail extension below
exten => congestion,1,ExecIf($[${LEN(${MAILBOX})} = 0]?Congestion(10))
same => next,Set(GREETING=u)
same => next,Goto(voicemail,1)
; If ${MAILBOX} is empty send busy, otherwise go to voicemail extension below
exten => busy,1,ExecIf($[${LEN(${MAILBOX})} = 0]?Busy(10))
same => next,Set(GREETING=b)
same => next,Goto(voicemail,1)
exten => noanswer,1,Goto(congestion,1)
exten => chanunavail,1,Goto(congestion,1)
exten => voicemail,1,Answer()
same => next,Wait(0.5)
same => next,VoiceMail(${MAILBOX},${GREETING})
same => next,Hangup(normal_clearing)</code>
<br>
<h2 id="extensions">extensions <a href="#extensions" title="Link">link</a></h2>
Incoming context for local phone extensions. <b>Note</b>: when defining a <code class="keyword">hint</code> the peer name needs to be specified twice as there are two independant states, the device state and the presence state.<br>
<br>
<code class="prettify lang-astexten">[extensions]
exten => 301,1,Goto(call-extension,${EXTEN},1)
; Note the duplication of the hint peername
same => hint,SIP/301,SIP/301
exten => 302,1,Goto(call-extension,${EXTEN},1)
same => hint,SIP/302,SIP/302
exten => 303,1,Goto(call-extension,${EXTEN},1)
same => hint,SIP/303,SIP/303
...</code>
<br>
<h2 id="huntgroup">huntgroup <a href="#huntgroup" title="Link">link</a></h2>
Hunt-group login. Ring only those peers that are logged into the hunt-group.<br>
<br>
<code class="prettify lang-astexten">; Clear dial group first
exten => 370,1,Set(DIALGROUP(huntgroup)=)
same => next,Set(PEERNAMES=301&302&303)
same => next,While($[${LEN(${PEERNAMES})} != 0])
same => next,Set(PEERNAME=${SHIFT(PEERNAMES,&)})
; Check if peer is logged-in to the hunt group and add them to the dial group if they are
same => next,ExecIf($[${SIPPEER(${PEERNAME},huntgroup)} = yes]?Set(DIALGROUP(huntgroup,add)=SIP/${PEERNAME}))
same => next,EndWhile()
; Send congestion if the dial group is empty
same => next,ExecIf($[${LEN(${DIALGROUP(huntgroup)})} = 0]?Congestion(10))
; Phones support 'Answered Elsewhere' so the 'c' flag is included
; Later series need to be logged into the hunt-group and have CISCO_HUNTPILOT set to not record answered calls as missed
same => next,Set(_CISCO_HUNTPILOT="Ring All" <${EXTEN}>)
same => next,Dial(${DIALGROUP(huntgroup)},30,ic)
same => next,Hangup(${HANGUPCAUSE})</code>
<br>
<h2 id="paging">paging <a href="#paging" title="Link">link</a></h2>
Page a group of phones using the <a href="rtp-streaming.html">RTP streaming</a> API. See <a href="#cisco_autoanswer">cisco_autoanswer</a> for an additional paging method.<br>
<br>
<code class="prettify lang-astexten">; Only allow one page at a time
exten => 380,1,Set(GROUP()=paging)
same => next,ExecIf($[${GROUP_COUNT(paging)} != 1]?Busy(10))
; Multicast audio mode is enabled using the m() option
same => next,SIPCiscoPage(301&302&303,om(224.0.1.1)d(From ${CALLERID(number)}))
same => next,Hangup(normal_clearing)</code>
<br>
<h2 id="intercom">intercom <a href="#intercom" title="Link">link</a></h2>
Call the intercom line on multiple phones. Intercom is specified as a <a href="line-keys-xml.html#Intercom">line key</a>. See <a href="extensions-conf.html#paging">paging</a> for how to page phones without requiring an intercom line.<br>
<br>
<code class="prettify lang-astexten">; Clear dial group first
exten => 390,1,Set(DIALGROUP(intercom)=)
; The list of SIP peers and their associated intercom line peer. List could be dynamically specified using EVAL() or DB() allowing for multiple intercom groups.
same => next,Set(PEERNAMES=301/391&302/392&303/393)
same => next,While($[${LEN(${PEERNAMES})} != 0])
same => next,Set(PEERNAME=${SHIFT(PEERNAMES,/)})
same => next,Set(INTERCOM_PEERNAME=${SHIFT(PEERNAMES,&)})
same => next,ExecIf($[${DEVICE_STATE(SIP/${PEERNAME})} = NOT_INUSE]?Set(DIALGROUP(intercom,add)=SIP/${INTERCOM_PEERNAME}))
same => next,EndWhile()
same => next,ExecIf($[${LEN(${DIALGROUP(intercom)})} = 0]?Busy(10))
same => next,Page(${DIALGROUP(intercom)},is,3)
same => next,Hangup(normal_clearing)</code>
<br>
<h2 id="voicemail">voicemail <a href="#voicemail" title="Link">link</a></h2>
Extension for the messages (voicemail) button, set by <<code class="tag">messagesNumber</code>> as part of the <a href="line-keys-xml.html#Line">line key</a> definition.<br>
<br>
<code class="prettify lang-astexten">exten => 399,1,Set(CONNECTEDLINE(all)="Voice Mail" <${EXTEN}>)
same => next,Answer()
same => next,Wait(0.5)
same => next,Set(MAILBOX=${SIPPEER(${CHANNEL(peername)},mailbox)})
same => next,VoiceMailMain(${MAILBOX},s)
same => next,Hangup(normal_clearing)</code>
<br>
<h2 id="x-cisco-serviceuri">x-cisco-serviceuri <a href="#x-cisco-serviceuri" title="Link">link</a></h2>
Dialplan features used by the Cisco phones are prefixed with <code class="literal">x-cisco-serviceuri-</code>, start by stripping it off. <b>Note</b>: <code class="literal">x</code> needs to be surrounded by <code class="literal">[]</code> otherwise it will be interpreted as to match any digit. Available feature extensions are listed below.<br>
<br>
<code class="prettify lang-astexten">exten => _[x]-cisco-serviceuri-.,1,Goto(${EXTEN:19},1)</code>
<br>
<h2 id="pickup">pickup <a href="#pickup" title="Link">link</a></h2>
Call Pickup. Hangup with <code class="literal">normal_circuit_congestion</code> which maps to SIP cause <code class="literal">503</code> so that <code class="literal">No call available for pickup</code> appears on the phone.<br>
<br>
<code class="prettify lang-astexten">exten => pickup,1,Pickup()
same => next,Hangup(normal_circuit_congestion)</code>
<br>
<h2 id="blfpickup">blfpickup <a href="#blfpickup" title="Link">link</a></h2>
Busy Lamp Field Directed Call Pickup, ${<code class="variable">EXTEN</code>:<code class="literal">10</code>} is the number specified as the <<code class="tag">speedDialNumber</code>> in a BLF speed-dial <a href="line-keys-xml.html#BLF-Speed-Dial">line key</a> definition, also needs to have a matching <code class="literal">subscribe</code> entry in <a href="sip-conf.html">sip.conf.</a><br>
<br>
<code class="prettify lang-astexten">exten => _blfpickup-.,1,PickupChan(SIP/${EXTEN:10})
same => next,Hangup(normal_circuit_congestion)</code>
<br>
<h2 id="gpickup">gpickup <a href="#gpickup" title="Link">link</a></h2>
Group Call Pickup, manually sets the pickup extension or group.<br>
<br>
<code class="prettify lang-astexten">; Try pickup on channel first
exten => _gpickup-.,1,PickupChan(SIP/${EXTEN:8})
; Otherwise, treat exten as pickup group
same => next,Set(CHANNEL(pickupgroup)=${EXTEN:8})
same => next,Pickup()
same => next,Hangup(normal_circut_congestion)</code>
<br>
<h2 id="opickup">opickup <a href="#opickup" title="Link">link</a></h2>
Other Call Pickup, example uses ${<code class="variable">OTHERPICKUPGROUP</code>} which is set in the phone's <a href="sip-conf.html">sip.conf.</a> entry.<br>
<br>
<code class="prettify lang-astexten">exten => opickup,1,Set(CHANNEL(pickupgroup)=${OTHERPICKUPGROUP})
same => next,Pickup()
same => next,Hangup(normal_circut_congestion)</code>
<br>
<h2 id="park">park <a href="#park" title="Link">link</a></h2>
Park Call. You can omit the <code class="literal">park</code> exten if you have <code class="literal">parkexten</code> set to <code class="literal">park</code> in <a href="res-parking-conf.html">res_parking.conf</a>. <b>Note</b>: the extension priority of the <code class="literal">Park</code> application must be <code class="literal">1</code>.<br>
<br>
<code class="prettify lang-astexten">; If the parked call isn't retrieved in 60 seconds it will be sent to extension 370
exten => park,1,Park(default,st(60)T(50)c(extensions,370,1))
; Remember to include the parked calls context
include => parked-calls</code>
<br>
<h2 id="dpark">dpark <a href="#dpark" title="Link">link</a></h2>
Directed BLF Call Park, blind-transfers the current call to this extension. ${<code class="variable">EXTEN</code>:<code class="literal">6</code>} is the number specified as the <<code class="tag">speedDialNumber</code>> in a BLF Directed Call Park <a href="line-keys-xml.html#BLF-Directed-Call-Park">line key</a> definition, also needs to have a matching <code class="literal">subscribe</code> entry in <a href="sip-conf.html">sip.conf</a>. The <code class="literal">dpark</code> prefix is only used when that parking extension is not in use, otherwise it uses the optional <<code class="tag">retrievalPrefix</code>>.<br>
<br>
<code class="prettify lang-astexten">exten => _dpark-.,1,Set(PARKINGEXTEN=${EXTEN:6})
same => next,Goto(park,1)</code>
<br>
<h2 id="cfwdall">cfwdall <a href="#cfwdall" title="Link">link</a></h2>
Call Forwarding, you can reject invalid forwarding target extensions by hanging up with <code class="literal">normal_circuit_congestion</code> which maps to SIP cause <code class="literal">503</code>. <br>
<br>
<code class="prettify lang-astexten">; Enable call-forwarding
exten => _cfwdall-.,1,Answer()
same => next,Set(SIPPEER(${CHANNEL(peername)},callforward)=${EXTEN:8})
same => next,Hangup(normal_clearing)
; Disable call-forwarding
exten => cfwdall,1,Answer()
same => next,Set(SIPPEER(${CHANNEL(peername)},callforward)=)
same => next,Hangup(normal_clearing)</code>
<br>
<h2 id="record">record <a href="#record" title="Link">link</a></h2>
Record call, inbound and outbound legs are recorded separately so <code class="function">ConfBridge</code> is used to merge them together.<br>
<br>
<code class="prettify lang-astexten">exten => record,1,Answer()
same => next,Wait(0.5)
same => next,Set(CONFBRIDGE(bridge,record_conference)=yes)
same => next,Set(CONFBRIDGE(bridge,record_file)=${RECORD_PEERNAME})
same => next,Set(CONFBRIDGE(user,quiet)=yes)
; Other channel variables available are ${RECORD_CHANNEL} and ${RECORD_DIRECTION}.
same => next,ConfBridge(${RECORD_UNIQUEID})
same => next,Hangup(normal_clearing)</code>
<br>
<h2 id="abbrdial">abbrdial <a href="#abbrdial" title="Link">link</a></h2>
Abbrievated (or speed) dials, soft key is available from the dial number screen. Example uses ${<code class="variable">SPEEDDIAL_<i>XXX</i></code>} which is set in the phone's <a href="sip-conf.html">sip.conf</a> entry.<br>
<br>
<code class="prettify lang-astexten">exten => _abbrdial-.,1,Set(SPEEDDIAL=${EVAL(SPEEDDIAL_${EXTEN:9})})
same => next,GotoIf($[${LEN(${SPEEDDIAL})} != 0]?extensions,${SPEEDDIAL},1)
same => next,Hangup(unallocated)</code>
<br>
<h2 id="meetme">meetme <a href="#meetme" title="Link">link</a></h2>
Meetme Conferencing, used to detect creation of a conference bridge as opposed to just joining one.<br>
<br>
<code class="prettify lang-astexten">; Only allow creation of conference bridge if no one else has first
exten => _meetme-36X,1,ExecIf($[${CONFBRIDGE_INFO(${EXTEN:7},parties)} != 0]?Hangup(normal_circuit_congestion))
same => next,Set(CONFBRIDGE(bridge,template)=default_bridge)
same => next,Set(CONFBRIDGE(user,template)=default_user)
same => next,Set(CONFBRIDGE(user,admin)=yes)
same => next,ConfBridge(${EXTEN:7})
same => next,Hangup(normal_clearing)
; Reject calls to conference bridges that haven't been created
exten => _36X,1,ExecIf($[${CONFBRIDGE_INFO(${EXTEN},parties)} = 0]?Hangup(unallocated))
same => next,Set(CONFBRIDGE(bridge,template)=default_bridge)
same => next,Set(CONFBRIDGE(user,template)=default_user)
same => next,Set(CONFBRIDGE(user,admin)=no)
same => next,ConfBridge(${EXTEN})
same => next,Hangup(normal_clearing)</code>
<br>
<h2 id="idivert">idivert <a href="#idivert" title="Link">link</a></h2>
Divert (Connected), allow call to be diverted to voicemail after being answered.<br>
<br>
<code class="prettify lang-astexten">exten => idivert,1,Answer()
same => next,Wait(0.5)
same => next,Set(MAILBOX=${SIPPEER(${IDIVERT_PEERNAME},mailbox)})
same => next,VoiceMail(${MAILBOX},b)
same => next,Hangup(normal_clearing)</code>
<br>
<h2 id="cisco_callback_number">cisco_callback_number <a href="#cisco_callback_number" title="Link">link</a></h2>
Specifies the number the phone stores in the call history without modifying the caller-ID number. Example use is to include a prefix required for an outside line so it can be dialed unedited from the call history entry.<br>
<br>
<code class="prettify lang-astexten">; If dialing outside numbers requires that they be prefixed with a '1'
exten => _X.,1,Set(_CISCO_CALLBACK_NUMBER=1${CALLERID(number)})
same => next,Dial(SIP/${EXTEN},,30)
...</code>
<br>
<h2 id="cisco_huntpilot">cisco_huntpilot <a href="#cisco_huntpilot" title="Link">link</a></h2>
Specifies the caller-ID for the hunt-group which will be shown on the phone and stored in the call history. For later models this needs to be set to avoid logging calls answered on other phones as missed calls. <b>Note</b>: The phone must be logged-in to the hunt-group for the information to be shown.<br>
<br>
<code class="prettify lang-astexten">; Specify a name and number for the hunt-group.
exten => _X.,1,Set(_CISCO_HUNTGROUP="Ring All" <${EXTEN}>))
same => next,Dial(SIP/301&SIP/302&SIP/303,,30)
...</code>
<br>
<h2 id="cisco_autoanswer">cisco_autoanswer <a href="#cisco_autoanswer" title="Link">link</a></h2>
When enabled phone will be requested to automatically answer the call after it sends back a ringing response.<br>
<br>
<code class="prettify lang-astexten">exten => _X.,1,Set(_CISCO_AUTOANSWER=yes)
same => next,Page(SIP/301&SIP/302,sni,30)
...</code>
</article>
</main>
<footer>
<span class="icon">copyright</span> Gareth Palmer and individual contributors. Documentation distributed under <a href="LICENSE">CC BY 4.0</a>.
</footer>
</body>
</html>