Debian Codegraph @

src/modules/siprepo/README

raw
1 SIPREPO Module
2
3 Daniel-Constantin Mierla
4
5 <[email protected]>
6
7 Edited by
8
9 Daniel-Constantin Mierla
10
11 <[email protected]>
12
13 Copyright © 2022 asipto.com
14 __________________________________________________________________
15
16 Table of Contents
17
18 1. Admin Guide
19
20 1. Overview
21 2. Dependencies
22
23 2.1. Kamailio Modules
24 2.2. External Libraries or Applications
25
26 3. Parameters
27
28 3.1. hash_size (int)
29 3.2. expire (int)
30 3.3. timer_interval (int)
31 3.4. timer_procs (int)
32
33 4. Functions
34
35 4.1. sr_msg_push(msgid, rmode)
36 4.2. sr_msg_pull(callid, msgid, rname, rmode)
37 4.3. sr_msg_async_pull(callid, msgid, gname, rname, rmode)
38 4.4. sr_msg_rm(callid, msgid)
39 4.5. sr_msg_check()
40
41 List of Examples
42
43 1.1. hash_size usage
44 1.2. expire usage
45 1.3. timer_interval usage
46 1.4. timer_procs usage
47 1.5. sr_msg_push() usage
48 1.6. sr_msg_pull() usage
49 1.7. sr_msg_async_pull() usage
50 1.8. sr_msg_rm() usage
51 1.9. sr_msg_check() usage
52
53 Chapter 1. Admin Guide
54
55 Table of Contents
56
57 1. Overview
58 2. Dependencies
59
60 2.1. Kamailio Modules
61 2.2. External Libraries or Applications
62
63 3. Parameters
64
65 3.1. hash_size (int)
66 3.2. expire (int)
67 3.3. timer_interval (int)
68 3.4. timer_procs (int)
69
70 4. Functions
71
72 4.1. sr_msg_push(msgid, rmode)
73 4.2. sr_msg_pull(callid, msgid, rname, rmode)
74 4.3. sr_msg_async_pull(callid, msgid, gname, rname, rmode)
75 4.4. sr_msg_rm(callid, msgid)
76 4.5. sr_msg_check()
77
78 1. Overview
79
80 This module can store and fetch SIP message content in an in-memory
81 hash table.
82
83 2. Dependencies
84
85 2.1. Kamailio Modules
86 2.2. External Libraries or Applications
87
88 2.1. Kamailio Modules
89
90 The following modules must be loaded before this module:
91 * None.
92
93 2.2. External Libraries or Applications
94
95 The following libraries or applications must be installed before
96 running Kamailio with this module loaded:
97 * None
98
99 3. Parameters
100
101 3.1. hash_size (int)
102 3.2. expire (int)
103 3.3. timer_interval (int)
104 3.4. timer_procs (int)
105
106 3.1. hash_size (int)
107
108 Number of slots in the hash table. It should be power of 2.
109
110 Default value: 256.
111
112 Example 1.1. hash_size usage
113 ...
114 modparam("siprepo", "hash_size", 1024)
115 ...
116
117 3.2. expire (int)
118
119 Number of seconds until the stored message content expires.
120
121 Default value: 180.
122
123 Example 1.2. expire usage
124 ...
125 modparam("siprepo", "expire", 240)
126 ...
127
128 3.3. timer_interval (int)
129
130 Number of seconds to run the timer routine.
131
132 Default value: 10.
133
134 Example 1.3. timer_interval usage
135 ...
136 modparam("siprepo", "timer_interval", 5)
137 ...
138
139 3.4. timer_procs (int)
140
141 Number of timer processes.
142
143 Default value: 1.
144
145 Example 1.4. timer_procs usage
146 ...
147 modparam("siprepo", "timer_procs", 2)
148 ...
149
150 4. Functions
151
152 4.1. sr_msg_push(msgid, rmode)
153 4.2. sr_msg_pull(callid, msgid, rname, rmode)
154 4.3. sr_msg_async_pull(callid, msgid, gname, rname, rmode)
155 4.4. sr_msg_rm(callid, msgid)
156 4.5. sr_msg_check()
157
158 4.1. sr_msg_push(msgid, rmode)
159
160 Push the message content to hash table and associate it with `msgid`.
161 The Call-Id and msgid are needed to pull the message. The rmode is
162 reserved for repo mode, use 0.
163
164 This function can be used from ANY_ROUTE.
165
166 Example 1.5. sr_msg_push() usage
167 ...
168 request_route {
169 ...
170 $var(msgid) = $sruid;
171 if(sr_msg_push("$var(msgid)", "0")) {
172 ...
173 }
174 ...
175 }
176 ...
177
178 4.2. sr_msg_pull(callid, msgid, rname, rmode)
179
180 Pull the message content and execute the route block 'rname'. If rmode
181 is set to "1", the item of the message is removed from siprepo storage,
182 use "0" to keep it.
183
184 This function can be used from ANY_ROUTE.
185
186 Example 1.6. sr_msg_pull() usage
187 ...
188 request_route {
189 ...
190 if(sr_msg_pull("$var(callid)", "$var(msgid)", "REPOPULL", "1")) {
191 }
192 ...
193 }
194 ...
195
196 4.3. sr_msg_async_pull(callid, msgid, gname, rname, rmode)
197
198 Pull the message content and execute the route block 'rname' via async
199 group 'gname'. If rmode is set to "1", the item of the message is
200 removed from siprepo storage, use "0" to keep it.
201
202 This function can be used from ANY_ROUTE.
203
204 Example 1.7. sr_msg_async_pull() usage
205 ...
206 request_route {
207 ...
208 if(sr_msg_async_pull("$var(callid)", "$var(msgid)", "WG01", "REPOPULL", "1")
209 ) {
210 }
211 ...
212 }
213 ...
214
215 4.4. sr_msg_rm(callid, msgid)
216
217 Remove the item of the message from the siprepo storage.
218
219 This function can be used from ANY_ROUTE.
220
221 Example 1.8. sr_msg_rm() usage
222 ...
223 request_route {
224 ...
225 if(sr_msg_rm("$var(callid)", "$var(msgid)")) {
226 }
227 ...
228 }
229 ...
230
231 4.5. sr_msg_check()
232
233 Check if the message is stored.
234
235 This function can be used from ANY_ROUTE.
236
237 Example 1.9. sr_msg_check() usage
238 ...
239 request_route {
240 ...
241 if(sr_msg_check()) {
242 }
243 ...
244 }
245 ...