Debian Codegraph @

src/modules/sipt/README

raw
1 sipt Module
2
3 Torrey Searle
4
5 Voxbone SA
6 <[email protected]>
7
8 Copyright © 2013 Voxbone SA
9 __________________________________________________________________
10
11 Table of Contents
12
13 1. Admin Guide
14
15 1. Overview
16 2. Dependencies
17 3. Functions
18
19 3.1. sipt_destination(destination, hops, nai[,
20 terminator=1])
21
22 3.2. sipt_set_bci_1(charge_indicator, called_status,
23 called_category, e2e_indicator)
24
25 3.3. sipt_set_calling(origin, nai, presentation, screening)
26 3.4. sipt_forwarding(origin, nai)
27 3.5. sipt_has_isup_body()
28
29 4. Exported pseudo-variables
30
31 4.1. $sipt(calling_party_number.presentation) /
32 $sipt_presentation
33
34 4.2. $sipt(calling_party_number.screening) / $sipt_screening
35 4.3. $sipt(hop_counter) / $sipt_hop_counter
36 4.4. $sipt(calling_party_category) / $sipt(cpc) / $sipt_cpc
37 4.5. $sipt(calling_party_number.nature_of_address) /
38 $sipt.(calling_party_number.nai) /
39 $sipt_calling_party_nai
40
41 4.6. $sipt(calling_party_number)
42 4.7. $sipt(called_party_number.nature_of_address) /
43 $sipt(called_party_number.nai) /
44 $sipt_called_party_nai
45
46 4.8. $sipt(called_party_number)
47 4.9. $sipt(event_info)
48 4.10. $sipt(backward_call_indicator.charge_indicator)
49 4.11. $sipt(redirection_info) / $sipt_redirection_info
50 4.12. $sipt(redirection_number) / $sipt_redirection_number
51 4.13. $sipt(redirection_number.nai) /
52 $sipt_redirection_number_nai
53
54 4.14. $sipt(redirection_information.reason)
55 4.15. $sipt(redirection_information.original_reason)
56 4.16. $sipt(redirecting_number.nai)
57 4.17. $sipt(redirecting_number)
58 4.18. $sipt(original_called_number.nai)
59 4.19. $sipt(original_called_number)
60 4.20. $sipt(generic_number.nai)
61 4.21. $sipt(generic_number)
62
63 List of Tables
64
65 1.1. Address Presentation Restricted Indicator Values
66 1.2. Screening Indicator Values
67 1.3. Calling Nature of Address Values
68 1.4. Called Nature of Address Values
69 1.5. Event Info Values
70 1.6. Charge Indicator Values
71 1.7. Redirecting reason Values
72 1.8. Redirecting number NAI Values
73
74 List of Examples
75
76 1.1. sipt_destination(destination, hops, nai) usage
77 1.2. sipt_destination(destination, hops, nai) usage
78 1.3. sipt_set_calling(origin, nai, presentation, screening) usage
79 1.4. sipt_set_calling(origin, nai) usage
80 1.5. sipt_has_isup_body() usage
81 1.6. sipt_presentation pseudo-variable usage
82 1.7. sipt_screening pseudo-variable usage
83 1.8. sipt_hop_counter pseudo-variable usage
84 1.9. sipt_cpc pseudo-variable usage
85 1.10. sipt_calling_party_nai pseudo-variable usage
86 1.11. sipt_called_party_nai pseudo-variable usage
87 1.12. sipt_redirection_number usage
88
89 Chapter 1. Admin Guide
90
91 Table of Contents
92
93 1. Overview
94 2. Dependencies
95 3. Functions
96
97 3.1. sipt_destination(destination, hops, nai[, terminator=1])
98 3.2. sipt_set_bci_1(charge_indicator, called_status,
99 called_category, e2e_indicator)
100
101 3.3. sipt_set_calling(origin, nai, presentation, screening)
102 3.4. sipt_forwarding(origin, nai)
103 3.5. sipt_has_isup_body()
104
105 4. Exported pseudo-variables
106
107 4.1. $sipt(calling_party_number.presentation) / $sipt_presentation
108 4.2. $sipt(calling_party_number.screening) / $sipt_screening
109 4.3. $sipt(hop_counter) / $sipt_hop_counter
110 4.4. $sipt(calling_party_category) / $sipt(cpc) / $sipt_cpc
111 4.5. $sipt(calling_party_number.nature_of_address) /
112 $sipt.(calling_party_number.nai) / $sipt_calling_party_nai
113
114 4.6. $sipt(calling_party_number)
115 4.7. $sipt(called_party_number.nature_of_address) /
116 $sipt(called_party_number.nai) / $sipt_called_party_nai
117
118 4.8. $sipt(called_party_number)
119 4.9. $sipt(event_info)
120 4.10. $sipt(backward_call_indicator.charge_indicator)
121 4.11. $sipt(redirection_info) / $sipt_redirection_info
122 4.12. $sipt(redirection_number) / $sipt_redirection_number
123 4.13. $sipt(redirection_number.nai) / $sipt_redirection_number_nai
124 4.14. $sipt(redirection_information.reason)
125 4.15. $sipt(redirection_information.original_reason)
126 4.16. $sipt(redirecting_number.nai)
127 4.17. $sipt(redirecting_number)
128 4.18. $sipt(original_called_number.nai)
129 4.19. $sipt(original_called_number)
130 4.20. $sipt(generic_number.nai)
131 4.21. $sipt(generic_number)
132
133 1. Overview
134
135 Module for updating ISUP encapsulated in SIP (SIP-T/SIP-I)
136
137 The sipt module can be used to update various ss7 headers contained
138 inside a message.
139
140 2. Dependencies
141
142 The module depends on the following modules (in other words the listed
143 modules must be loaded before this module):
144 * none
145
146 3. Functions
147
148 3.1. sipt_destination(destination, hops, nai[, terminator=1])
149 3.2. sipt_set_bci_1(charge_indicator, called_status, called_category,
150 e2e_indicator)
151
152 3.3. sipt_set_calling(origin, nai, presentation, screening)
153 3.4. sipt_forwarding(origin, nai)
154 3.5. sipt_has_isup_body()
155
156 3.1. sipt_destination(destination, hops, nai[, terminator=1])
157
158 updates the IAM in the body if it exists, setting the called party
159 number to “destination” with the nature address specified in “nai” and
160 decrementing the hop counter value if present. If the hop counter
161 header is missing it will be added with the value of “hops”. If
162 “terminator” is set to 1, then F will be appended to digit string to
163 indicate the number is complete (default).
164
165 Example 1.1. sipt_destination(destination, hops, nai) usage
166 ...
167 # update the destination number to our current request uri,
168 # setting nature of address to international
169 $rU = "19495551234";
170 sipt_destination($rU, 31, 4);
171 ...
172
173 3.2. sipt_set_bci_1(charge_indicator, called_status, called_category,
174 e2e_indicator)
175
176 updates the first byte of the backward call indicator in the ACM or COT
177 in the body if setting the Charge Indicator to “charge_indicator”, the
178 Called party's status indicator in “called_status”, the Called party's
179 category indicator in “called_category” and the End to End Method
180 Indicator with the value of the value of “e2e_indicator”.
181
182 Example 1.2. sipt_destination(destination, hops, nai) usage
183 ...
184 # set bci for charging, subscriber free, ordinary, no e2e available
185 sipt_set_bci_1("2", "1", "1", "0");
186 ...
187
188 3.3. sipt_set_calling(origin, nai, presentation, screening)
189
190 updates the IAM in the body if it exists, setting (or adding) the
191 calling party number to “origin” with the nature address specified in
192 “nai” and setting the presentation and screening values to
193 “presentation” and “screening”.
194
195 Example 1.3. sipt_set_calling(origin, nai, presentation, screening)
196 usage
197 ...
198 # update the calling party to the value in the from header
199 sipt_set_calling($fU, 4, 0, 3);
200 ...
201
202 3.4. sipt_forwarding(origin, nai)
203
204 updates the IAM in the body if it exists, setting (or adding) the
205 forwarding number to “origin” with the nature address specified in
206 “nai”.
207
208 Example 1.4. sipt_set_calling(origin, nai) usage
209 ...
210 # update the forwarding number to the value in the from header
211 sipt_forwarding($avp(s:forwarding_number), 3);
212 ...
213
214 3.5. sipt_has_isup_body()
215
216 The function returns true if the SIP message has an ISUP body attached.
217
218 Example 1.5. sipt_has_isup_body() usage
219 ...
220 if(sipt_has_isup_body())
221 {
222 # do interesting stuff here
223 }
224 ...
225
226 4. Exported pseudo-variables
227
228 4.1. $sipt(calling_party_number.presentation) / $sipt_presentation
229 4.2. $sipt(calling_party_number.screening) / $sipt_screening
230 4.3. $sipt(hop_counter) / $sipt_hop_counter
231 4.4. $sipt(calling_party_category) / $sipt(cpc) / $sipt_cpc
232 4.5. $sipt(calling_party_number.nature_of_address) /
233 $sipt.(calling_party_number.nai) / $sipt_calling_party_nai
234
235 4.6. $sipt(calling_party_number)
236 4.7. $sipt(called_party_number.nature_of_address) /
237 $sipt(called_party_number.nai) / $sipt_called_party_nai
238
239 4.8. $sipt(called_party_number)
240 4.9. $sipt(event_info)
241 4.10. $sipt(backward_call_indicator.charge_indicator)
242 4.11. $sipt(redirection_info) / $sipt_redirection_info
243 4.12. $sipt(redirection_number) / $sipt_redirection_number
244 4.13. $sipt(redirection_number.nai) / $sipt_redirection_number_nai
245 4.14. $sipt(redirection_information.reason)
246 4.15. $sipt(redirection_information.original_reason)
247 4.16. $sipt(redirecting_number.nai)
248 4.17. $sipt(redirecting_number)
249 4.18. $sipt(original_called_number.nai)
250 4.19. $sipt(original_called_number)
251 4.20. $sipt(generic_number.nai)
252 4.21. $sipt(generic_number)
253
254 4.1. $sipt(calling_party_number.presentation) / $sipt_presentation
255
256 Returns the value of the Address presentation restricted indicator
257 contained in the Calling Party Number header of the IAM message if it
258 exists. Returns -1 if there isn't a Calling Party Number header.
259
260 Table 1.1. Address Presentation Restricted Indicator Values
261 0 presentation allowed
262 1 presentation restricted
263 2 address not avail (national use)
264 3 spare
265
266 Example 1.6. sipt_presentation pseudo-variable usage
267 ...
268 # add privacy header if restriction is requested
269 if($sipt(calling_party_number.presentation) == 1)
270 {
271 append_hf("Privacy: id\r\n");
272 $fn = "Anonymous";
273 }
274
275 ...
276
277 4.2. $sipt(calling_party_number.screening) / $sipt_screening
278
279 Returns the value of the Screening Indicator contained in the Calling
280 Party Number header of the IAM message if it exists. Returns -1 if
281 there isn't a Calling Party Number header.
282
283 Table 1.2. Screening Indicator Values
284 0 Reserved (user provided, not verified)
285 1 User Provided, Verified and Passed
286 2 Reserved (user provided, verified and failed)
287 3 Network provided
288
289 Example 1.7. sipt_screening pseudo-variable usage
290 ...
291
292 # remove P-Asserted-Identity header if the screening isn't verified
293 # or network provided
294 $avp(s:screening) = $sipt(calling_party_number.screening);
295 if($avp(s:screening) != 1 && $avp(s:screening) != 3)
296 {
297 remove_hf("P-Asserted-Id");
298 }
299
300 ...
301
302 4.3. $sipt(hop_counter) / $sipt_hop_counter
303
304 Returns the value of the Hop Counter for the IAM message if it exists.
305 Returns -1 if there isn't a hop counter.
306
307 Example 1.8. sipt_hop_counter pseudo-variable usage
308 ...
309 # get the hop counter and update the Max-Forwards header if it exists
310 $avp(s:hop) = $sipt(hop_counter);
311 if($avp(s:hop) > 0)
312 {
313 remove_hf("Max-Forwards");
314 append_hf("Max-Forwards: $avp(s:hop)\r\n");
315 }
316
317 ...
318
319 4.4. $sipt(calling_party_category) / $sipt(cpc) / $sipt_cpc
320
321 Returns the value of the Calling Party Category for the IAM message.
322 Returns -1 if there is a parsing error.
323
324 Example 1.9. sipt_cpc pseudo-variable usage
325 ...
326 # get the Cpc code and set put it in a custom sip header
327 append_hf("X-CPC: $sipt(cpc)\r\n");
328
329 ...
330
331 4.5. $sipt(calling_party_number.nature_of_address) /
332 $sipt.(calling_party_number.nai) / $sipt_calling_party_nai
333
334 Returns the value of the Nature of Address Indicator of the Calling
335 Party for the IAM message. Returns -1 if there is a parsing error or if
336 the Calling Party Number is not present.
337
338 Table 1.3. Calling Nature of Address Values
339 0 Spare
340 1 Subscriber Number (national use)
341 2 Unknown (national use)
342 3 National (significant) number (national use)
343 4 International use
344
345 Example 1.10. sipt_calling_party_nai pseudo-variable usage
346 ...
347 # get the Calling Nai and add country code if national
348 if($sipt(calling_party_number.nai) == 3)
349 {
350 $fU = "32" + "$fU";
351 }
352
353 ...
354
355 4.6. $sipt(calling_party_number)
356
357 Returns the value (Address signal) of the Calling Party for the IAM
358 message. Returns -1 if there is a parsing error or if the Calling Party
359 Number is not present.
360
361 4.7. $sipt(called_party_number.nature_of_address) /
362 $sipt(called_party_number.nai) / $sipt_called_party_nai
363
364 Returns the value of the Nature of Address Indicator of the Called
365 Party for the IAM message. Returns -1 if there is a parsing error.
366
367 Table 1.4. Called Nature of Address Values
368 0 Spare
369 1 Subscriber Number (national use)
370 2 Unknown (national use)
371 3 National (significant) number
372 4 International use
373 5 Network-specific number (national use)
374
375 Example 1.11. sipt_called_party_nai pseudo-variable usage
376 ...
377 # get the Called Nai and add country code if national
378 if($sipt(called_party_number.nai) == 3)
379 {
380 $rU = "32" + "$rU";
381 }
382
383 ...
384
385 4.8. $sipt(called_party_number)
386
387 Returns the value (Address signal) of the Called Party for the IAM
388 message. Returns -1 if there is a parsing error or if the Called Party
389 Number is not present.
390
391 4.9. $sipt(event_info)
392
393 Returns the value of the Event Info header of the CPG message. Returns
394 -1 if there is a parsing error.
395
396 Table 1.5. Event Info Values
397 0 Spare
398 1 ALERTING
399 2 PROGRESS
400 3 In-band information or an appropriate pattern is now available
401 4 Call forward on busy
402 5 Call forward on no reply
403 6 Call forward unconditional
404
405 4.10. $sipt(backward_call_indicator.charge_indicator)
406
407 Returns the value of the charge indication of the backward call
408 indicator header in the ACM or COT message. Returns -1 if there is a
409 parsing error.
410
411 Table 1.6. Charge Indicator Values
412 0 no indication
413 1 no charge
414 2 charge
415 3 spare
416
417 4.11. $sipt(redirection_info) / $sipt_redirection_info
418
419 Returns call diversion information header from ISUP Returns
420 "Redirecting reason" or -1 if no call diversion information found.
421
422 Table 1.7. Redirecting reason Values
423 0 Unknown
424 1 User busy
425 2 PROGRESS
426 3 no reply
427 4 deflection during alerting
428 5 deflection immediate response
429 6 mobile subscriber not reachable
430
431 4.12. $sipt(redirection_number) / $sipt_redirection_number
432
433 Returns number to which redirection will triggered Returns -1 if there
434 is a parsing error.
435
436 Example 1.12. sipt_redirection_number usage
437 ...
438 # get the redirection number
439 $avp(s:redir_num) = $sipt(redirection_number);
440
441 ...
442
443 4.13. $sipt(redirection_number.nai) / $sipt_redirection_number_nai
444
445 Returns NAI for redirection number from ISUP Returns NAI for
446 redirection number or -1 if no info found.
447
448 Table 1.8. Redirecting number NAI Values
449 0 Spare
450 1 Subscriber Number (national use)
451 2 Unknown (national use)
452 3 National (significant) number (national use)
453 4 International use
454
455 4.14. $sipt(redirection_information.reason)
456
457 Returns redirection reason from Redirection information from ISUP or -1
458 if no Redirection information found.
459
460 4.15. $sipt(redirection_information.original_reason)
461
462 Returns original redirection reason from Redirection information from
463 ISUP or -1 if no Redirection information found.
464
465 4.16. $sipt(redirecting_number.nai)
466
467 Returns NAI for redirecting number from ISUP or -1 if no redirecting
468 number found.
469
470 4.17. $sipt(redirecting_number)
471
472 Returns redirecting number from ISUP or -1 if no redirecting number
473 found.
474
475 4.18. $sipt(original_called_number.nai)
476
477 Returns NAI for original called number from ISUP or -1 if no original
478 called number found.
479
480 4.19. $sipt(original_called_number)
481
482 Returns original called number from ISUP or -1 if no original called
483 number found.
484
485 4.20. $sipt(generic_number.nai)
486
487 Returns NAI for generic number from ISUP or -1 if no generic number
488 found.
489
490 4.21. $sipt(generic_number)
491
492 Returns generic number from ISUP or -1 if no generic number found.