Debian Codegraph @

src/modules/pua_json/README

raw
1 PUA_JSON Module
2
3 Emmanuel Schmidbauer
4
5 <[email protected]>
6
7 Edited by
8
9 Emmanuel Schmidbauer
10
11 <[email protected]>
12
13 Copyright © 2018 VoIPxSWITCH
14 __________________________________________________________________
15
16 Table of Contents
17
18 1. Admin Guide
19
20 1. Overview
21 2. How it works
22 3. Dependencies
23
24 3.1. Kamailio Modules
25 3.2. External Libraries or Applications
26
27 4. Functions
28
29 4.1. pua_json_publish(json_payload)
30
31 List of Examples
32
33 1.1. pua_json_publish usage
34
35 Chapter 1. Admin Guide
36
37 Table of Contents
38
39 1. Overview
40 2. How it works
41 3. Dependencies
42
43 3.1. Kamailio Modules
44 3.2. External Libraries or Applications
45
46 4. Functions
47
48 4.1. pua_json_publish(json_payload)
49
50 1. Overview
51
52 The PUA_JSON module adds support to publish updates to the presence
53 module through the pua_json_publish() function.
54
55 From a high-level perspective, the module may be used for:
56 * Providing a real-time presence updates.
57
58 2. How it works
59
60 The module parses json data objects and inserts them into the
61 presentity table for real-time presence updates.
62
63 3. Dependencies
64
65 3.1. Kamailio Modules
66 3.2. External Libraries or Applications
67
68 3.1. Kamailio Modules
69
70 The following modules must be loaded before this module:
71 * none.
72
73 3.2. External Libraries or Applications
74
75 The following libraries or applications must be installed
76 * libjson.
77
78 4. Functions
79
80 4.1. pua_json_publish(json_payload)
81
82 4.1. pua_json_publish(json_payload)
83
84 The function build presentity state from json_payload and updates
85 presentity table.
86
87 Usage: presence related.
88
89 This function can be used from ANY ROUTE.
90
91 Example 1.1. pua_json_publish usage
92 ...
93 event_route[xhttp:request] {
94 $var(call-id) = $(rb{json.parse,Call-ID});
95 if ($(rb{json.parse,Event-Package}) == "dialog") {
96 xlog("L_INFO", "$var(call-id)|log|received $(rb{json.parse,Event
97 -Package}) update for $(rb{json.parse,From})");
98 pua_json_publish($rb);
99 }
100 }
101 ...