-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathextensions.conf
More file actions
139 lines (120 loc) · 5.26 KB
/
extensions.conf
File metadata and controls
139 lines (120 loc) · 5.26 KB
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
; extensions.conf - the Asterisk dial plan
[general]
static=yes
writeprotect=no
autofallthrough=yes
;variabile globale
[globals]
CONF_PASSWORD=1234
ADMIN_PASSWORD=1234
;============================================================================
;FUNCTII SIP
[meetme_conf]
;functia de conferinta, se cere pinul dupa care lasa sau nu userul sa intre in conferinta.
exten => 100, 1, Answer
same => n, Ringing
same => n, Wait(2)
same => n,Flite("Please enter the pin")
same => n, Set(TIMEOUT(digit)=5)
same => n, Read(digito,,4)
same => n, GotoIf($["${digito}" == "${CONF_PASSWORD}"]?continue:stop)
same => n(continue), Goto(conf,1)
same => n(stop), Goto(wrongPinMessage,1)
;iTM-functionalitatea conferintei, i-anunta intrarea/iesirea utilizatorului, T-detectarea vorbitorului, M-music on hold
exten => conf, 1, MeetMe(100,iTM,CONF_PASSWORD)
same => n, Hangup
exten => wrongPinMessage,1,Flite("You have entered the wrong PIN, please call again")
same => n,Hangup
;Functia MeetMeCount (zice numarul de utilizatori din conferinta)
exten => 101, 1, Answer
same => n, Ringing
same => n, Wait(2)
same => n, Playback(conf-thereare)
same => n, MeetMeCount(100)
;Functia MeetMeAdmin (administrarea conferintei)
exten => 102, 1, Answer
same => n, Ringing
same => n, Wait(2)
same => n,Flite("Please enter the pin")
same => n, Set(TIMEOUT(digit)=5)
same => n, Read(digito,,4)
same => n, GotoIf($["${digito}" == "${ADMIN_PASSWORD}"]?continue:hangUpWrongPin)
same => n(hangUpWrongPin), Goto(wrongPinMessage,1)
same => n(continue), Flite("Press 1 to kick everyone")
same => n, Flite("Press 2 to lock the conference")
same => n, Flite("Press 3 to unlock the conference")
same => n, Read(digito,,1)
same => n, GotoIf($[$["${digito}" >"0"] & $["${digito}" <"4"]]?continueToCommand:stop)
same => n(continueToCommand), Goto(admin_cmds_${digito},1)
same => n(stop), Goto(wrongSelection,1)
exten => wrongSelection,1,Flite("You have entered the wrong selection")
same => n,Hangup
; FUNCTII CU MACRO PENTRU MeetMeAdmin
;1. Da afara pe toata lumea
exten => admin_cmds_1, 1, MeetMeAdmin(100,K)
same => n, Flite("Everyone has been kicked from conference")
;2. Blocheaza conferinta
exten => admin_cmds_2, 1, MeetMeAdmin(100,L)
same => n, Playback(conf-lockednow)
;3. Deblocheaza conferinta
exten => admin_cmds_3, 1, MeetMeAdmin(100,l)
same => n, Playback(conf-unlockednow)
;====================================================================================================
; Context SIP
[grup-facultate-sip]
; Include meetme_conf functii doar pentru SIP
include => meetme_conf
;Numerele SIP nu pot apela functiile IAX , deci daca o vor face, vor auzi mesaj de interzis
exten => _30[00-2], 1, Flite("You are not authorized to access this function")
;Numere de telefon, care au acces la meetme
exten => 1126, 1, Dial(SIP/1126,20)
exten => 2126, 1, Dial(SIP/2126,20)
; Daca se suna de pe SIP pe IAX se redirectioneaza la functiile IAX de CALL, pe contextul grup facultate IAX
exten => 3126, 1, Goto(grup-facultate-iax,3126,1)
exten => 4126, 1, Goto(grup-facultate-iax,4126,1)
;====================================================================================================
; ~~IAX CONTEXT~~
[grup-facultate-iax]
; Daca se suna la numerele functiilor SIP, nu avem acces, si auzim mesajul de interzicere
exten => _10[00-2], 1, Flite("You are not authorized to access this function")
; Daca se suna de pe iax pe sip se redirectioneaza la functiile SIP de CALL, pe contextul grup facultate sip
exten => 1126, 1, Goto(grup-facultate-sip,1126,1)
exten => 2126, 1, Goto(grup-facultate-sip,2126,1)
;Numere de telefon pentru iax 3126/4126
exten => 3126, 1, Dial(IAX2/3126,20)
exten => 4126, 1, Dial(IAX2/4126,20)
;Functiile care demonstreaza functionalitatea Timeout a asterisk-ului
;Se seteaza timeout absolut la 10 secunde si dupa ce expira timpul, apelul se incheie automat
exten => 300, 1, Answer ;
same => n, Ringing
same => n, Wait(1)
same => n, Set(TIMEOUT(absolute)=10)
same => n, Flite("The absolute timeout has been set up to 10 seconds and the call will hang up automaticaly")
; chiar daca e setata asteptarea de 60 de secunde, apelul se va incheia in 10 secunde de la setarea timeoutului, ceea ce demonstreaza funcitonarea lui.
same => n, Wait(60)
;daca nu se introduce caracterul urmator cu distanta de cel mult 5 secunde, face hang up
exten => 301, 1, Answer
same => n, Ringing
same => n, Wait(2)
same => n, Set(TIMEOUT(digit)=5)
same => n, Flite("The digit timeout has been set up to 5 seconds")
same => n, Flite("Please enter 4 digits")
same => n, Read(digito,,4)
same => n, GotoIf($[${LEN(${digito})} == 4]?didWell:notWell)
same => n(didWell), Goto(wellMessage,1)
same => n(notWell), Goto(slowMessage,1)
exten => wellMessage, 1, Flite("Good job!")
same => n, Hangup
exten => slowMessage,1,Flite("You were too slow")
same => n, Hangup
;seteaza response timeout la 5 secunde si intrepreteaza un mesaj, dar daca nu se tasteaza nimic, pune receptorul.
exten => 302, 1, Answer
same => n, Ringing
same => n, Wait(1)
same => n, GoTo(s,1)
exten => s, 1, Set(TIMEOUT(response)=5)
exten => s, 2, Flite("Press something to hear a message or wait 5 seconds to hang up");
exten => s, 3, Read(digito,,1)
exten => s, 4, GotoIf($[${digito}]?5:6)
exten => s, 5, Flite("You have pressed "${digito})
exten => s, 6, Hangup