Skip to content

Commit 9cfa123

Browse files
seanbrightgtjoseph
authored andcommitted
docs: Don't escape special characters inside code blocks.
Inside a code block, `*` and `-` and `_` are not special and should not be escaped.
1 parent cbe15d1 commit 9cfa123

File tree

90 files changed

+1008
-1009
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+1008
-1009
lines changed

Diff for: docs/Configuration/Applications/Asterisk-Queues/Building-Queues.md

+42-42
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ What we're doing here is creating a [std-device] template and applying it to a p
5050
Then our devices can register to Asterisk. In my case I have a hard phone and a soft phone registered. I can verify their connectivity by running 'sip show peers'.
5151

5252
```
53-
\*CLI> sip show peers
53+
*CLI> sip show peers
5454
Name/username Host Dyn Nat ACL Port Status
5555
0004f2040001/0004f2040001 192.168.128.145 D 5060 Unmonitored
5656
0004f2040002/0004f2040002 192.168.128.126 D 5060 Unmonitored
@@ -63,7 +63,7 @@ Name/username Host Dyn Nat ACL Port Status
6363
Next, we need to configure our system to track the state of the devices. We do this by defining a 'hint' in the dialplan which creates the ability for a device subscription to be retained in memory. By default we can see there are no hints registered in our system by running the 'core show hints' command.
6464

6565
```
66-
\*CLI> core show hints
66+
*CLI> core show hints
6767
There are no registered dialplan hint
6868
6969
```
@@ -84,7 +84,7 @@ Then perform a 'dialplan reload' in order to reload the dialplan.
8484
After reloading our dialplan, you can see the status of the devices with 'core show hints' again.
8585

8686
```
87-
\*CLI> core show hints
87+
*CLI> core show hints
8888
8989
-= Registered Asterisk Dial Plan Hints =-
9090
0004f2040002@default : SIP/0004f2040002 State:Idle Watchers 0
@@ -110,11 +110,11 @@ exten => 555,1,Playback(tt-monkeys)
110110
Dial that extension and then check the state of your device on the console.
111111

112112
```
113-
\*CLI> == Using SIP RTP CoS mark 5
113+
*CLI> == Using SIP RTP CoS mark 5
114114
-- Executing [555@devices:1] Playback("SIP/0004f2040001-00000001", "tt-monkeys") in new stack
115115
-- <SIP/0004f2040001-00000001> Playing 'tt-monkeys.slin' (language 'en')
116116
117-
\*CLI> core show hints
117+
*CLI> core show hints
118118
119119
-= Registered Asterisk Dial Plan Hints =-
120120
0004f2040002@default : SIP/0004f2040002 State:Idle Watchers 0
@@ -149,11 +149,11 @@ callcounter=yes ; <-- add this
149149
Then reload chan_sip with 'sip reload' and perform our 555 test again. Dial 555 and then check the device state with 'core show hints'.
150150

151151
```
152-
\*CLI> == Using SIP RTP CoS mark 5
152+
*CLI> == Using SIP RTP CoS mark 5
153153
-- Executing [555@devices:1] Playback("SIP/0004f2040001-00000002", "tt-monkeys") in new stack
154154
-- <SIP/0004f2040001-00000002> Playing 'tt-monkeys.slin' (language 'en')
155155
156-
\*CLI> core show hints
156+
*CLI> core show hints
157157
158158
-= Registered Asterisk Dial Plan Hints =-
159159
0004f2040002@default : SIP/0004f2040002 State:Idle Watchers 0
@@ -207,7 +207,7 @@ ringinuse=no ; don't ring members when already InUse
207207
After defining our queues, lets reload our app_queue.so module.
208208

209209
```
210-
\*CLI> module reload app_queue.so
210+
*CLI> module reload app_queue.so
211211
-- Reloading module 'app_queue.so' (True Call Queueing)
212212
213213
== Parsing '/etc/asterisk/queues.conf': == Found
@@ -217,7 +217,7 @@ After defining our queues, lets reload our app_queue.so module.
217217
Then verify our queues loaded with 'queue show'.
218218

219219
```
220-
\*CLI> queue show
220+
*CLI> queue show
221221
support has 0 calls (max unlimited) in 'rrmemory' strategy (0s holdtime, 0s talktime), W:0, C:0, A:0, SL:0.0% within 0s
222222
No Members
223223
No Callers
@@ -245,15 +245,15 @@ The penalty, membername, and state_interface are all optional values. Special at
245245
Lets add our device located at SIP/0004f2040001
246246

247247
```
248-
\*CLI> queue add member SIP/0004f2040001 to sales
248+
*CLI> queue add member SIP/0004f2040001 to sales
249249
Added interface 'SIP/0004f2040001' to queue 'sales'
250250
251251
```
252252

253253
Then lets verify our member was indeed added.
254254

255255
```
256-
\*CLI> queue show sales
256+
*CLI> queue show sales
257257
sales has 0 calls (max unlimited) in 'rrmemory' strategy (0s holdtime, 0s talktime), W:0, C:0, A:0, SL:0.0% within 0s
258258
Members:
259259
SIP/0004f2040001 (dynamic) (Not in use) has taken no calls yet
@@ -264,11 +264,11 @@ sales has 0 calls (max unlimited) in 'rrmemory' strategy (0s holdtime, 0s talkti
264264
Now, if we dial our 555 extension, we should see that our member becomes InUse within the queue.
265265

266266
```
267-
\*CLI> == Using SIP RTP CoS mark 5
267+
*CLI> == Using SIP RTP CoS mark 5
268268
-- Executing [555@devices:1] Playback("SIP/0004f2040001-00000001", "tt-monkeys") in new stack
269269
-- <SIP/0004f2040001-00000001> Playing 'tt-monkeys.slin' (language 'en')
270270
271-
\*CLI> queue show sales
271+
*CLI> queue show sales
272272
sales has 0 calls (max unlimited) in 'rrmemory' strategy (0s holdtime, 0s talktime), W:0, C:0, A:0, SL:0.0% within 0s
273273
Members:
274274
SIP/0004f2040001 (dynamic) (In use) has taken no calls yet
@@ -279,7 +279,7 @@ sales has 0 calls (max unlimited) in 'rrmemory' strategy (0s holdtime, 0s talkti
279279
We can also remove our members from the queue using the 'queue remove' CLI command.
280280

281281
```
282-
\*CLI> queue remove member SIP/0004f2040001 from sales
282+
*CLI> queue remove member SIP/0004f2040001 from sales
283283
Removed interface 'SIP/0004f2040001' from queue 'sales'
284284
285285
```
@@ -304,14 +304,14 @@ exten => 101,1,Queue(support)
304304
Then reload the dialplan, and try calling extension 100 from SIP/0004f2040002, which is the device we have not logged into the queue.
305305

306306
```
307-
\*CLI> dialplan reload
307+
*CLI> dialplan reload
308308
309309
```
310310

311311
And now we call the queue at extension 100 which will ring our device at SIP/0004f2040001.
312312

313313
```
314-
\*CLI> == Using SIP RTP CoS mark 5
314+
*CLI> == Using SIP RTP CoS mark 5
315315
-- Executing [100@devices:1] Queue("SIP/0004f2040002-00000005", "sales") in new stack
316316
-- Started music on hold, class 'default', on SIP/0004f2040002-00000005
317317
== Using SIP RTP CoS mark 5
@@ -322,7 +322,7 @@ And now we call the queue at extension 100 which will ring our device at SIP/000
322322
We can see the device state has changed to Ringing while the device is ringing.
323323

324324
```
325-
\*CLI> queue show sales
325+
*CLI> queue show sales
326326
sales has 1 calls (max unlimited) in 'rrmemory' strategy (2s holdtime, 3s talktime), W:0, C:1, A:1, SL:0.0% within 0s
327327
Members:
328328
SIP/0004f2040001 (dynamic) (Ringing) has taken 1 calls (last was 14 secs ago)
@@ -334,7 +334,7 @@ sales has 1 calls (max unlimited) in 'rrmemory' strategy (2s holdtime, 3s talkti
334334
Our queue member then answers the phone.
335335

336336
```
337-
\*CLI> -- SIP/0004f2040001-00000006 answered SIP/0004f2040002-00000005
337+
*CLI> -- SIP/0004f2040001-00000006 answered SIP/0004f2040002-00000005
338338
-- Stopped music on hold on SIP/0004f2040002-00000005
339339
-- Native bridging SIP/0004f2040002-00000005 and SIP/0004f2040001-00000006
340340
@@ -343,7 +343,7 @@ Our queue member then answers the phone.
343343
And we can see the queue member is now in use.
344344

345345
```
346-
\*CLI> queue show sales
346+
*CLI> queue show sales
347347
sales has 0 calls (max unlimited) in 'rrmemory' strategy (3s holdtime, 3s talktime), W:0, C:1, A:1, SL:0.0% within 0s
348348
Members:
349349
SIP/0004f2040001 (dynamic) (In use) has taken 1 calls (last was 22 secs ago)
@@ -354,14 +354,14 @@ sales has 0 calls (max unlimited) in 'rrmemory' strategy (3s holdtime, 3s talkti
354354
Then the call is hung up.
355355

356356
```
357-
\*CLI> == Spawn extension (devices, 100, 1) exited non-zero on 'SIP/0004f2040002-00000005'
357+
*CLI> == Spawn extension (devices, 100, 1) exited non-zero on 'SIP/0004f2040002-00000005'
358358
359359
```
360360

361361
And we see that our queue member is available to take another call.
362362

363363
```
364-
\*CLI> queue show sales
364+
*CLI> queue show sales
365365
sales has 0 calls (max unlimited) in 'rrmemory' strategy (3s holdtime, 4s talktime), W:0, C:2, A:1, SL:0.0% within 0s
366366
Members:
367367
SIP/0004f2040001 (dynamic) (Not in use) has taken 2 calls (last was 6 secs ago)
@@ -426,9 +426,9 @@ Lets move into the nitty-gritty section and show how we can login and logout our
426426
First, we create a pattern match that takes star plus the queue number that we want to login or logout of. So to login/out of the sales queue (100) we would dial \*100. We use the same extension for logging in and out.
427427

428428
```
429-
; Extension \*100 or \*101 will login/logout a queue member from sales or support queues respectively.
430-
exten => _\*10[0-1],1,Set(xtn=${EXTEN:1}) ; save ${EXTEN} with \* chopped off to ${xtn}
431-
exten => _\*10[0-1],n,Goto(queueLoginLogout,member_check,1) ; check if already logged into a queue
429+
; Extension *100 or *101 will login/logout a queue member from sales or support queues respectively.
430+
exten => _*10[0-1],1,Set(xtn=${EXTEN:1}) ; save ${EXTEN} with * chopped off to ${xtn}
431+
exten => _*10[0-1],n,Goto(queueLoginLogout,member_check,1) ; check if already logged into a queue
432432
433433
```
434434

@@ -537,7 +537,7 @@ And that's it! Give it a shot and you should see console output similar to the f
537537
You can see there are already a couple of queue members logged into the sales queue.
538538

539539
```
540-
\*CLI> queue show sales
540+
*CLI> queue show sales
541541
sales has 0 calls (max unlimited) in 'rrmemory' strategy (3s holdtime, 4s talktime), W:0, C:2, A:1, SL:0.0% within 0s
542542
Members:
543543
SIP/0004f2040001 (dynamic) (Not in use) has taken no calls yet
@@ -549,9 +549,9 @@ sales has 0 calls (max unlimited) in 'rrmemory' strategy (3s holdtime, 4s talkti
549549
Then we dial \*100 to logout the active device from the sales queue.
550550

551551
```
552-
\*CLI> == Using SIP RTP CoS mark 5
553-
-- Executing [\*100@devices:1] Set("SIP/0004f2040001-00000012", "xtn=100") in new stack
554-
-- Executing [\*100@devices:2] Goto("SIP/0004f2040001-00000012", "queueLoginLogout,member_check,1") in new stack
552+
*CLI> == Using SIP RTP CoS mark 5
553+
-- Executing [*100@devices:1] Set("SIP/0004f2040001-00000012", "xtn=100") in new stack
554+
-- Executing [*100@devices:2] Goto("SIP/0004f2040001-00000012", "queueLoginLogout,member_check,1") in new stack
555555
-- Goto (queueLoginLogout,member_check,1)
556556
-- Executing [member_check@queueLoginLogout:1] Verbose("SIP/0004f2040001-00000012", "2,Logging queue member in or out of the request queue") in new stack
557557
== Logging queue member in or out of the request queue
@@ -585,7 +585,7 @@ Then we dial \*100 to logout the active device from the sales queue.
585585
And we can see that the device we loggd out by running 'queue show sales'.
586586

587587
```
588-
\*CLI> queue show sales
588+
*CLI> queue show sales
589589
sales has 0 calls (max unlimited) in 'rrmemory' strategy (3s holdtime, 4s talktime), W:0, C:2, A:1, SL:0.0% within 0s
590590
Members:
591591
SIP/0004f2040002 (dynamic) (Not in use) has taken no calls yet
@@ -600,7 +600,7 @@ Once we have our queue members logged in, it is inevitable that they will want t
600600
We have two devices logged into the sales queue as we can see with the 'queue show sales' CLI command.
601601

602602
```
603-
\*CLI> queue show sales
603+
*CLI> queue show sales
604604
sales has 0 calls (max unlimited) in 'rrmemory' strategy (0s holdtime, 0s talktime), W:0, C:0, A:0, SL:0.0% within 0s
605605
Members:
606606
SIP/0004f2040002 (dynamic) (Not in use) has taken no calls yet
@@ -622,15 +622,15 @@ Usage: queue {pause|unpause} member <member> [queue <queue> [reason <reason>]]
622622
Lets pause device 0004f2040001 in the sales queue by executing the following.
623623

624624
```
625-
\*CLI> queue pause member SIP/0004f2040001 queue sales
625+
*CLI> queue pause member SIP/0004f2040001 queue sales
626626
paused interface 'SIP/0004f2040001' in queue 'sales' for reason 'lunch'
627627
628628
```
629629

630630
And we can see they are paused with 'queue show sales'.
631631

632632
```
633-
\*CLI> queue show sales
633+
*CLI> queue show sales
634634
sales has 0 calls (max unlimited) in 'rrmemory' strategy (0s holdtime, 0s talktime), W:0, C:0, A:0, SL:0.0% within 0s
635635
Members:
636636
SIP/0004f2040002 (dynamic) (Not in use) has taken no calls yet
@@ -642,15 +642,15 @@ sales has 0 calls (max unlimited) in 'rrmemory' strategy (0s holdtime, 0s talkti
642642
At this point the queue member will no longer receive calls from the system. We can unpause them with the CLI command 'queue unpause member'.
643643

644644
```
645-
\*CLI> queue unpause member SIP/0004f2040001 queue sales
645+
*CLI> queue unpause member SIP/0004f2040001 queue sales
646646
unpaused interface 'SIP/0004f2040001' in queue 'sales'
647647
648648
```
649649

650650
And if you don't specify a queue, it will pause or unpause from all queues.
651651

652652
```
653-
\*CLI> queue pause member SIP/0004f2040001
653+
*CLI> queue pause member SIP/0004f2040001
654654
paused interface 'SIP/0004f2040001'
655655
656656
```
@@ -667,11 +667,11 @@ extensions.conf
667667
668668
; Allow queue members to pause and unpause themselves from all queues, or an individual queue.
669669
;
670-
; _\*0[01]! pattern match will match on \*00 and \*01 plus 0 or more digits.
671-
exten => _\*0[01]!,1,Verbose(2,Pausing or unpausing queue member from one or more queues)
672-
exten => _\*0[01]!,n,Set(xtn=${EXTEN:3}) ; save the queue extension to 'xtn'
673-
exten => _\*0[01]!,n,Set(thisQueue=${GLOBAL(QUEUE_${xtn})}) ; get the queue name if available
674-
exten => _\*0[01]!,n,GotoIf($[${ISNULL(${thisQueue})} & ${EXISTS(${xtn})}]?invalid_queue,1) ; if 'thisQueue' is blank and the
670+
; _*0[01]! pattern match will match on *00 and *01 plus 0 or more digits.
671+
exten => _*0[01]!,1,Verbose(2,Pausing or unpausing queue member from one or more queues)
672+
exten => _*0[01]!,n,Set(xtn=${EXTEN:3}) ; save the queue extension to 'xtn'
673+
exten => _*0[01]!,n,Set(thisQueue=${GLOBAL(QUEUE_${xtn})}) ; get the queue name if available
674+
exten => _*0[01]!,n,GotoIf($[${ISNULL(${thisQueue})} & ${EXISTS(${xtn})}]?invalid_queue,1) ; if 'thisQueue' is blank and the
675675
; the agent dialed a queue exten,
676676
; we will tell them it's invalid
677677
@@ -690,15 +690,15 @@ offset ^ ^ length
690690
Which causes the following.
691691

692692
```
693-
\*00100
693+
*00100
694694
^^ offset these characters
695695
696-
\*00100
696+
*00100
697697
^ then return a digit length of one, which is digit 0
698698
699699
```
700700
```
701-
exten => _\*0[01]!,n,GotoIf($[${EXTEN:2:1} = 0]?pause,1:unpause,1) ; determine if they wanted to pause
701+
exten => _*0[01]!,n,GotoIf($[${EXTEN:2:1} = 0]?pause,1:unpause,1) ; determine if they wanted to pause
702702
; or to unpause.
703703
704704
```

0 commit comments

Comments
 (0)