CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/lib/rex/proto/iax2/constants.rb
Views: 11704
1
# -*- coding: binary -*-
2
module Rex
3
module Proto
4
module IAX2
5
module Constants
6
7
8
IAX2_DEFAULT_PORT = 4569
9
10
11
IAX_TYPE_VOICE = 2
12
IAX_TYPE_CONTROL = 4
13
IAX_TYPE_IAX = 6
14
IAX_TYPE_DTMF_BEGIN = 1
15
IAX_TYPE_DTMF_END = 12
16
17
IAX_CTRL_HANGUP = 1
18
IAX_CTRL_RINGING = 3
19
IAX_CTRL_ANSWER = 4
20
IAX_CTRL_BUSY = 5
21
IAX_CTRL_PROGRESS = 14
22
IAX_CTRL_PROCEED = 15
23
24
=begin
25
+-------------+---------------+-------------------------------------+
26
| VALUE | Name | Description |
27
+-------------+---------------+-------------------------------------+
28
| 0x01 | Hangup | The call has been hungup at the |
29
| | | remote end |
30
| | | |
31
| 0x02 | Reserved | Reserved for future use |
32
| | | |
33
| 0x03 | Ringing | Remote end is ringing (ring-back) |
34
| | | |
35
| 0x04 | Answer | Remote end has answered |
36
| | | |
37
| 0x05 | Busy | Remote end is busy |
38
| | | |
39
| 0x06 | Reserved | Reserved for future use |
40
| | | |
41
| 0x07 | Reserved | Reserved for future use |
42
| | | |
43
| 0x08 | Congestion | The call is congested |
44
| | | |
45
| 0x09 | Flash Hook | Flash hook |
46
| | | |
47
| 0x0a | Reserved | Reserved for future use |
48
| | | |
49
| 0x0b | Option | Device-specific options are being |
50
| | | transmitted |
51
| | | |
52
| 0x0c | Key Radio | Key Radio |
53
| | | |
54
| 0x0d | Unkey Radio | Unkey Radio |
55
| | | |
56
| 0x0e | Call Progress | Call is in progress |
57
| | | |
58
| 0x0f | Call | Call is proceeding |
59
| | Proceeding | |
60
| | | |
61
| 0x10 | Hold | Call is placed on hold |
62
| | | |
63
| 0x11 | Unhold | Call is taken off hold |
64
+-------------+---------------+-------------------------------------+
65
=end
66
67
68
IAX_SUBTYPE_NEW = 1
69
IAX_SUBTYPE_PING = 2
70
IAX_SUBTYPE_PONG = 3
71
IAX_SUBTYPE_ANSWER = 4
72
IAX_SUBTYPE_ACK = 4
73
IAX_SUBTYPE_HANGUP = 5
74
IAX_SUBTYPE_REJECT = 6
75
IAX_SUBTYPE_ACCEPT = 7
76
IAX_SUBTYPE_AUTHREQ = 8
77
IAX_SUBTYPE_AUTHREP = 9
78
IAX_SUBTYPE_INVAL = 10
79
IAX_SUBTYPE_LAGRQ = 11
80
IAX_SUBTYPE_LAGRP = 12
81
IAX_SUBTYPE_REGREQ = 13
82
IAX_SUBTYPE_REGAUTH = 14
83
IAX_SUBTYPE_REGACK = 15
84
IAX_SUBTYPE_REGREJ = 16
85
IAX_SUBTYPE_REGREL = 17
86
IAX_SUBTYPE_VNAK = 18
87
88
=begin
89
+------+-----------+-----------------------------------------+
90
| Hex | Name | Description |
91
+------+-----------+-----------------------------------------+
92
| 0x01 | NEW | Initiate a new call |
93
| | | |
94
| 0x02 | PING | Ping request |
95
| | | |
96
| 0x03 | PONG | Ping or poke reply |
97
| | | |
98
| 0x04 | ACK | Explicit acknowledgment |
99
| | | |
100
| 0x05 | HANGUP | Initiate call tear-down |
101
| | | |
102
| 0x06 | REJECT | Reject a call |
103
| | | |
104
| 0x07 | ACCEPT | Accept a call |
105
| | | |
106
| 0x08 | AUTHREQ | Authentication request |
107
| | | |
108
| 0x09 | AUTHREP | Authentication reply |
109
| | | |
110
| 0x0a | INVAL | Invalid message |
111
| | | |
112
| 0x0b | LAGRQ | Lag request |
113
| | | |
114
| 0x0c | LAGRP | Lag reply |
115
| | | |
116
| 0x0d | REGREQ | Registration request |
117
| | | |
118
| 0x0e | REGAUTH | Registration authentication |
119
| | | |
120
| 0x0f | REGACK | Registration acknowledgement |
121
| | | |
122
| 0x10 | REGREJ | Registration reject |
123
| | | |
124
| 0x11 | REGREL | Registration release |
125
| | | |
126
| 0x12 | VNAK | Video/Voice retransmit request |
127
| | | |
128
| 0x13 | DPREQ | Dialplan request |
129
| | | |
130
| 0x14 | DPREP | Dialplan reply |
131
| | | |
132
| 0x15 | DIAL | Dial |
133
| | | |
134
| 0x16 | TXREQ | Transfer request |
135
| | | |
136
| 0x17 | TXCNT | Transfer connect |
137
| | | |
138
| 0x18 | TXACC | Transfer accept |
139
| | | |
140
| 0x19 | TXREADY | Transfer ready |
141
| | | |
142
| 0x1a | TXREL | Transfer release |
143
| | | |
144
| 0x1b | TXREJ | Transfer reject |
145
| | | |
146
| 0x1c | QUELCH | Halt audio/video [media] transmission |
147
| | | |
148
| 0x1d | UNQUELCH | Resume audio/video [media] transmission |
149
| | | |
150
| 0x1e | POKE | Poke request |
151
| | | |
152
| 0x1f | Reserved | Reserved for future use |
153
| | | |
154
| 0x20 | MWI | Message waiting indication |
155
| | | |
156
| 0x21 | UNSUPPORT | Unsupported message |
157
| | | |
158
| 0x22 | TRANSFER | Remote transfer request |
159
| | | |
160
| 0x23 | Reserved | Reserved for future use |
161
| | | |
162
| 0x24 | Reserved | Reserved for future use |
163
| | | |
164
| 0x25 | Reserved | Reserved for future use |
165
+------+-----------+-----------------------------------------+
166
=end
167
168
IAX_IE_CALLED_NUMBER = 1
169
IAX_IE_CALLING_NUMBER = 2
170
IAX_IE_AUTH_METHODS = 3
171
IAX_IE_CALLING_NAME = 4
172
IAX_IE_USERNAME = 6
173
IAX_IE_DESIRED_CODEC = 9
174
IAX_IE_ORIGINAL_DID = 10
175
IAX_IE_ACTUAL_CODECS = 8
176
IAX_IE_PROTO_VERSION = 11
177
IAX_IE_REG_REFRESH = 19
178
IAX_IE_CHALLENGE_DATA = 15
179
IAX_IE_CHALLENGE_RESP = 16
180
IAX_IE_APPARENT_ADDR = 18
181
IAX_IE_REGREJ_CAUSE = 22
182
IAX_IE_HANGUP_CAUSE = 42
183
184
=begin
185
+------+----------------+-------------------------------------------+
186
| HEX | NAME | DESCRIPTION |
187
+------+----------------+-------------------------------------------+
188
| HEX | NAME | DESCRIPTION |
189
| 0x01 | CALLED NUMBER | Number/extension being called |
190
| 0x02 | CALLING NUMBER | Calling number |
191
| 0x03 | CALLING ANI | Calling number ANI for billing |
192
| 0x04 | CALLING NAME | Name of caller |
193
| 0x05 | CALLED CONTEXT | Context for number |
194
| 0x06 | USERNAME | Username (peer or user) for |
195
| | | authentication |
196
| 0x07 | PASSWORD | Password for authentication |
197
| 0x08 | CAPABILITY | Actual CODEC capability |
198
| 0x09 | FORMAT | Desired CODEC format |
199
| 0x0a | LANGUAGE | Desired language |
200
| 0x0b | VERSION | Protocol version |
201
| 0x0c | ADSICPE | CPE ADSI capability |
202
| 0x0d | DNID | Originally dialed DNID |
203
| 0x0e | AUTHMETHODS | Authentication method(s) |
204
| 0x0f | CHALLENGE | Challenge data for MD5/RSA |
205
| 0x10 | MD5 RESULT | MD5 challenge result |
206
| 0x11 | RSA RESULT | RSA challenge result |
207
| 0x12 | APPARENT ADDR | Apparent address of peer |
208
| 0x13 | REFRESH | When to refresh registration |
209
| 0x14 | DPSTATUS | Dialplan status |
210
| 0x15 | CALLNO | Call number of peer |
211
| 0x16 | CAUSE | Cause |
212
| 0x17 | IAX UNKNOWN | Unknown IAX command |
213
| 0x18 | MSGCOUNT | How many messages waiting |
214
| 0x19 | AUTOANSWER | Request auto-answering |
215
| 0x1a | MUSICONHOLD | Request musiconhold with QUELCH |
216
| 0x1b | TRANSFERID | Transfer Request Identifier |
217
| 0x1c | RDNIS | Referring DNIS |
218
| 0x1d | Reserved | Reserved for future use |
219
| 0x1e | Reserved | Reserved for future use |
220
| 0x1f | DATETIME | Date/Time |
221
| 0x20 | Reserved | Reserved for future use |
222
| 0x21 | Reserved | Reserved for future use |
223
| 0x22 | Reserved | Reserved for future use |
224
| 0x23 | Reserved | Reserved for future use |
225
| 0x24 | Reserved | Reserved for future use |
226
| 0x25 | Reserved | Reserved for future use |
227
| 0x26 | CALLINGPRES | Calling presentation |
228
| 0x27 | CALLINGTON | Calling type of number |
229
| 0x28 | CALLINGTNS | Calling transit network select |
230
| 0x29 | SAMPLINGRATE | Supported sampling rates |
231
| 0x2a | CAUSECODE | Hangup cause |
232
| 0x2b | ENCRYPTION | Encryption format |
233
| 0x2c | ENCKEY | Reserved for future Use |
234
| 0x2d | CODEC PREFS | CODEC Negotiation |
235
| 0x2e | RR JITTER | Received jitter, as in RFC 3550 |
236
| 0x2f | RR LOSS | Received loss, as in RFC 3550 |
237
| 0x30 | RR PKTS | Received frames |
238
| 0x31 | RR DELAY | Max playout delay for received frames in |
239
| | | ms |
240
| 0x32 | RR DROPPED | Dropped frames (presumably by jitter |
241
| | | buffer) |
242
| 0x33 | RR OOO | Frames received Out of Order |
243
| 0x34 | OSPTOKEN | OSP Token Block |
244
+------+----------------+-------------------------------------------+
245
=end
246
247
248
# Codecs
249
IAX_CODEC_G711_MULAW = 0x00000004
250
IAX_CODEC_G711_ALAW = 0x00000008
251
IAX_CODEC_LINEAR_PCM = 0x00000040
252
253
# Supported
254
IAX_SUPPORTED_CODECS = IAX_CODEC_G711_MULAW | IAX_CODEC_G711_ALAW | IAX_CODEC_LINEAR_PCM
255
256
# Default timings
257
IAX_DEFAULT_REG_REFRESH = 60
258
IAX_DEFAULT_TIMEOUT = 10
259
260
261
end
262
end
263
end
264
end
265
266