Browse code

- updated documentation - added an extra parameter to extract_sdialog_info function

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@2740 689a6050-402a-0410-94f2-e92a70836424

Anca Vamanu authored on 12/09/2007 08:46:49
Showing 4 changed files
... ...
@@ -28,11 +28,10 @@ Anca-Maria Vamanu
28 28
               1.3.4. watchers_table(str)
29 29
               1.3.5. clean_period (int)
30 30
               1.3.6. to_tag_pref (str)
31
-              1.3.7. lock_set_size (int)
32
-              1.3.8. expires_offset (int)
33
-              1.3.9. max_expires (int)
34
-              1.3.10. server_address (str)
35
-              1.3.11. fallback2db (int)
31
+              1.3.7. expires_offset (int)
32
+              1.3.8. max_expires (int)
33
+              1.3.9. server_address (str)
34
+              1.3.10. fallback2db (int)
36 35
 
37 36
         1.4. Exported Functions
38 37
 
... ...
@@ -69,13 +68,12 @@ Anca-Maria Vamanu
69 69
    1-4. Set watchers_table parameter
70 70
    1-5. Set clean_period parameter
71 71
    1-6. Set to_tag_pref parameter
72
-   1-7. Set lock_set_size parameter
73
-   1-8. Set expires_offset parameter
74
-   1-9. Set max_expires parameter
75
-   1-10. Set server_address parameter
76
-   1-11. Set fallback2db parameter
77
-   1-12. handle_publish usage
78
-   1-13. handle_subscribe usage
72
+   1-7. Set expires_offset parameter
73
+   1-8. Set max_expires parameter
74
+   1-9. Set server_address parameter
75
+   1-10. Set fallback2db parameter
76
+   1-11. handle_publish usage
77
+   1-12. handle_subscribe usage
79 78
    2-1. presence_api_t structure
80 79
      __________________________________________________________
81 80
 
... ...
@@ -125,7 +123,7 @@ Chapter 1. User's Guide
125 125
 
126 126
 1.2.2. External Libraries or Applications
127 127
 
128
-   None.
128
+     * libxml.
129 129
      __________________________________________________________
130 130
 
131 131
 1.3. Exported Parameters
... ...
@@ -210,20 +208,7 @@ modparam("presence", "to_tag_pref", 'a')
210 210
 ...
211 211
      __________________________________________________________
212 212
 
213
-1.3.7. lock_set_size (int)
214
-
215
-   The size of the lock used for synchronizing updating
216
-   information from database.
217
-
218
-   Default value is "8".
219
-
220
-   Example 1-7. Set lock_set_size parameter
221
-...
222
-modparam("presence", "lock_set_size", 8)
223
-...
224
-     __________________________________________________________
225
-
226
-1.3.8. expires_offset (int)
213
+1.3.7. expires_offset (int)
227 214
 
228 215
    The value that should be subtracted from the expires value when
229 216
    sending a 200OK for a publish. It is used for forcing the
... ...
@@ -231,38 +216,38 @@ modparam("presence", "lock_set_size", 8)
231 231
 
232 232
    Default value is "0".
233 233
 
234
-   Example 1-8. Set expires_offset parameter
234
+   Example 1-7. Set expires_offset parameter
235 235
 ...
236 236
 modparam("presence", "expires_offset", 10)
237 237
 ...
238 238
      __________________________________________________________
239 239
 
240
-1.3.9. max_expires (int)
240
+1.3.8. max_expires (int)
241 241
 
242 242
    The the maximum admissible expires value for PUBLISH/SUBSCRIBE
243 243
    message.
244 244
 
245 245
    Default value is "3600".
246 246
 
247
-   Example 1-9. Set max_expires parameter
247
+   Example 1-8. Set max_expires parameter
248 248
 ...
249 249
 modparam("presence", "max_expires", 3600)
250 250
 ...
251 251
      __________________________________________________________
252 252
 
253
-1.3.10. server_address (str)
253
+1.3.9. server_address (str)
254 254
 
255 255
    The presence server address which will become the value of
256 256
    Contact header filed for 200OK replies to Subscribe and Publish
257 257
    and in Notify messages.
258 258
 
259
-   Example 1-10. Set server_address parameter
259
+   Example 1-9. Set server_address parameter
260 260
 ...
261 261
 modparam("presence", "server_address", "sip:10.10.10.10:5060")
262 262
 ...
263 263
      __________________________________________________________
264 264
 
265
-1.3.11. fallback2db (int)
265
+1.3.10. fallback2db (int)
266 266
 
267 267
    Setting this parameter enables a fallback to db mode of
268 268
    operation. In this mode, in case a searched record is not found
... ...
@@ -270,7 +255,7 @@ modparam("presence", "server_address", "sip:10.10.10.10:5060")
270 270
    architecture in which processing and memory load might be
271 271
    divided on more machines using the same database.
272 272
 
273
-   Example 1-11. Set fallback2db parameter
273
+   Example 1-10. Set fallback2db parameter
274 274
 ...
275 275
 modparam("presence", "fallback2db", 1)
276 276
 ...
... ...
@@ -294,7 +279,7 @@ modparam("presence", "fallback2db", 1)
294 294
 
295 295
    This function can be used from REQUEST_ROUTE.
296 296
 
297
-   Example 1-12. handle_publish usage
297
+   Example 1-11. handle_publish usage
298 298
 ...
299 299
         if(is_method("PUBLISH"))
300 300
         {
... ...
@@ -316,7 +301,7 @@ modparam("presence", "fallback2db", 1)
316 316
 
317 317
    This function can be used from REQUEST_ROUTE.
318 318
 
319
-   Example 1-13. handle_subscribe usage
319
+   Example 1-12. handle_subscribe usage
320 320
 ...
321 321
 if(method=="SUBSCRIBE")
322 322
     handle_subscribe();
... ...
@@ -71,10 +71,15 @@
71 71
 
72 72
 	<section>
73 73
 		<title>External Libraries or Applications</title>
74
-		<para>
75
-			None.
76
-		</para>
77
-	</section>
74
+		<itemizedlist>
75
+			<listitem>
76
+			<para>
77
+				<emphasis>libxml</emphasis>.
78
+			</para>
79
+			</listitem>
80
+		</itemizedlist>
81
+
82
+		</section>
78 83
 	</section>
79 84
 	
80 85
 	<section>
... ...
@@ -199,26 +204,6 @@ modparam("presence", "to_tag_pref", 'a')
199 199
 	</section>
200 200
 
201 201
 	<section>
202
-		<title><varname>lock_set_size</varname> (int)</title>
203
-		<para>
204
-		The size of the lock used for synchronizing updating information 
205
-		from database.
206
-		</para>
207
-		<para>
208
-		<emphasis>Default value is <quote>8</quote>.
209
-		</emphasis>
210
-		</para>
211
-		<example>
212
-		<title>Set <varname>lock_set_size</varname> parameter</title>
213
-		<programlisting format="linespecific">
214
-...
215
-modparam("presence", "lock_set_size", 8)
216
-...
217
-		</programlisting>
218
-		</example>
219
-	</section>
220
-
221
-	<section>
222 202
 		<title><varname>expires_offset</varname> (int)</title>
223 203
 		<para>
224 204
 		The value that should be subtracted from the expires value when
... ...
@@ -558,7 +558,7 @@ int handle_subscribe(struct sip_msg* msg, char* str1, char* str2)
558 558
 		ev_param= ev_param->next;
559 559
 	}		
560 560
 	
561
-	if(extract_sdialog_info(&subs, msg, &to_tag_gen)< 0)
561
+	if(extract_sdialog_info(&subs, msg, max_expires, &to_tag_gen)< 0)
562 562
 	{
563 563
 		LM_ERR("while extracting dialog information\n");
564 564
 		goto error;
... ...
@@ -724,7 +724,7 @@ error:
724 724
 }
725 725
 
726 726
 
727
-int extract_sdialog_info(subs_t* subs,struct sip_msg* msg, int* to_tag_gen)
727
+int extract_sdialog_info(subs_t* subs,struct sip_msg* msg, int mexp, int* to_tag_gen)
728 728
 {
729 729
 	static char buf[50];
730 730
 	str rec_route= {0, 0};
... ...
@@ -753,8 +753,8 @@ int extract_sdialog_info(subs_t* subs,struct sip_msg* msg, int* to_tag_gen)
753 753
 		LM_DBG("'expires' not found; default=%d\n",subs->event->default_expires);
754 754
 		lexpire = subs->event->default_expires;
755 755
 	}
756
-	if(lexpire > max_expires)
757
-		lexpire = max_expires;
756
+	if(lexpire > mexp)
757
+		lexpire = mexp;
758 758
 
759 759
 	subs->expires = lexpire;
760 760
 
... ...
@@ -97,8 +97,9 @@ void update_db_subs(char* db_table, shtable_t hash_table,int htable_size,
97 97
 typedef void (*update_db_subs_t)(char* ,shtable_t ,int ,int ,
98 98
 		handle_expired_func_t);
99 99
 
100
-int extract_sdialog_info(subs_t* subs,struct sip_msg* msg, int* to_tag_gen);
101
-typedef int (*extract_sdialog_info_t)(subs_t* subs, struct sip_msg* msg,
100
+int extract_sdialog_info(subs_t* subs,struct sip_msg* msg, int max_expire,
102 101
 		int* to_tag_gen);
102
+typedef int (*extract_sdialog_info_t)(subs_t* subs, struct sip_msg* msg,
103
+		int max_expire, int* to_tag_gen);
103 104
 
104 105
 #endif