Fix: merge conflict
[myslice.git] / third-party / codemirror-3.15 / mode / asterisk / index.html
1 <!doctype html>
2 <html>
3   <head>
4     <meta charset="utf-8">
5     <title>CodeMirror: Asterisk dialplan mode</title>
6     <link rel="stylesheet" href="../../lib/codemirror.css">
7     <script src="../../lib/codemirror.js"></script>
8     <script src="asterisk.js"></script>
9     <style>
10       .CodeMirror {border: 1px solid #999;}
11       .cm-s-default span.cm-arrow { color: red; }
12     </style>
13     <link rel="stylesheet" href="../../doc/docs.css">
14   </head>
15   <body>
16     <h1>CodeMirror: Asterisk dialplan mode</h1>
17     <form><textarea id="code" name="code">
18 ; extensions.conf - the Asterisk dial plan
19 ;
20
21 [general]
22 ;
23 ; If static is set to no, or omitted, then the pbx_config will rewrite
24 ; this file when extensions are modified.  Remember that all comments
25 ; made in the file will be lost when that happens.
26 static=yes
27
28 #include "/etc/asterisk/additional_general.conf
29
30 [iaxprovider]
31 switch => IAX2/user:[key]@myserver/mycontext
32
33 [dynamic]
34 #exec /usr/bin/dynamic-peers.pl
35
36 [trunkint]
37 ;
38 ; International long distance through trunk
39 ;
40 exten => _9011.,1,Macro(dundi-e164,${EXTEN:4})
41 exten => _9011.,n,Dial(${GLOBAL(TRUNK)}/${FILTER(0-9,${EXTEN:${GLOBAL(TRUNKMSD)}})})
42
43 [local]
44 ;
45 ; Master context for local, toll-free, and iaxtel calls only
46 ;
47 ignorepat => 9
48 include => default
49
50 [demo]
51 include => stdexten
52 ;
53 ; We start with what to do when a call first comes in.
54 ;
55 exten => s,1,Wait(1)                    ; Wait a second, just for fun
56 same  => n,Answer                       ; Answer the line
57 same  => n,Set(TIMEOUT(digit)=5)        ; Set Digit Timeout to 5 seconds
58 same  => n,Set(TIMEOUT(response)=10)    ; Set Response Timeout to 10 seconds
59 same  => n(restart),BackGround(demo-congrats)   ; Play a congratulatory message
60 same  => n(instruct),BackGround(demo-instruct)  ; Play some instructions
61 same  => n,WaitExten                    ; Wait for an extension to be dialed.
62
63 exten => 2,1,BackGround(demo-moreinfo)  ; Give some more information.
64 exten => 2,n,Goto(s,instruct)
65
66 exten => 3,1,Set(LANGUAGE()=fr)         ; Set language to french
67 exten => 3,n,Goto(s,restart)            ; Start with the congratulations
68
69 exten => 1000,1,Goto(default,s,1)
70 ;
71 ; We also create an example user, 1234, who is on the console and has
72 ; voicemail, etc.
73 ;
74 exten => 1234,1,Playback(transfer,skip)         ; "Please hold while..."
75                                         ; (but skip if channel is not up)
76 exten => 1234,n,Gosub(${EXTEN},stdexten(${GLOBAL(CONSOLE)}))
77 exten => 1234,n,Goto(default,s,1)               ; exited Voicemail
78
79 exten => 1235,1,Voicemail(1234,u)               ; Right to voicemail
80
81 exten => 1236,1,Dial(Console/dsp)               ; Ring forever
82 exten => 1236,n,Voicemail(1234,b)               ; Unless busy
83
84 ;
85 ; # for when they're done with the demo
86 ;
87 exten => #,1,Playback(demo-thanks)      ; "Thanks for trying the demo"
88 exten => #,n,Hangup                     ; Hang them up.
89
90 ;
91 ; A timeout and "invalid extension rule"
92 ;
93 exten => t,1,Goto(#,1)                  ; If they take too long, give up
94 exten => i,1,Playback(invalid)          ; "That's not valid, try again"
95
96 ;
97 ; Create an extension, 500, for dialing the
98 ; Asterisk demo.
99 ;
100 exten => 500,1,Playback(demo-abouttotry); Let them know what's going on
101 exten => 500,n,Dial(IAX2/guest@pbx.digium.com/s@default)        ; Call the Asterisk demo
102 exten => 500,n,Playback(demo-nogo)      ; Couldn't connect to the demo site
103 exten => 500,n,Goto(s,6)                ; Return to the start over message.
104
105 ;
106 ; Create an extension, 600, for evaluating echo latency.
107 ;
108 exten => 600,1,Playback(demo-echotest)  ; Let them know what's going on
109 exten => 600,n,Echo                     ; Do the echo test
110 exten => 600,n,Playback(demo-echodone)  ; Let them know it's over
111 exten => 600,n,Goto(s,6)                ; Start over
112
113 ;
114 ;       You can use the Macro Page to intercom a individual user
115 exten => 76245,1,Macro(page,SIP/Grandstream1)
116 ; or if your peernames are the same as extensions
117 exten => _7XXX,1,Macro(page,SIP/${EXTEN})
118 ;
119 ;
120 ; System Wide Page at extension 7999
121 ;
122 exten => 7999,1,Set(TIMEOUT(absolute)=60)
123 exten => 7999,2,Page(Local/Grandstream1@page&Local/Xlite1@page&Local/1234@page/n,d)
124
125 ; Give voicemail at extension 8500
126 ;
127 exten => 8500,1,VoicemailMain
128 exten => 8500,n,Goto(s,6)
129
130     </textarea></form>
131     <script>
132       var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
133         mode: "text/x-asterisk",
134         matchBrackets: true,
135         lineNumber: true
136       });
137     </script>
138
139     <p><strong>MIME types defined:</strong> <code>text/x-asterisk</code>.</p>
140
141   </body>
142 </html>