Browse code

presence_conference: use parameter default_expires instead of 3600 constant

- GH #2996

Adrian Tabacioiu authored on 14/01/2022 13:27:41 • Daniel-Constantin Mierla committed on 18/01/2022 19:19:16
Showing 4 changed files
... ...
@@ -43,7 +43,7 @@ int conference_add_events(void)
43 43
     event.content_type.s = "application/conference-info+xml";
44 44
     event.content_type.len = 31;
45 45
 
46
-    event.default_expires= 3600;
46
+    event.default_expires = pres_conf_default_expires;
47 47
     event.type = PUBL_TYPE;
48 48
     event.req_auth = 0;
49 49
     event.evs_publ_handl = 0;
... ...
@@ -76,6 +76,26 @@ modparam("presence_conference", "use_partial_states", 0)
76 76
 	    </example>
77 77
 	</section>
78 78
 
79
+<section id="presence_conference.p.default_expires">
80
+               <title><varname>default_expires</varname> (int)</title>
81
+               <para>
82
+               The default expires value used when missing from SUBSCRIBE
83
+               message (in seconds).
84
+               </para>
85
+               <para>
86
+               <emphasis>Default value is <quote>3600</quote>.
87
+               </emphasis>
88
+               </para>
89
+               <example>
90
+               <title>Set <varname>default_expires</varname> parameter</title>
91
+               <programlisting format="linespecific">
92
+...
93
+modparam("presence_conference", "default_expires", 3600)
94
+...
95
+</programlisting>
96
+	</example>
97
+</section>
98
+
79 99
 	</section>
80 100
 	
81 101
 	<section>
... ...
@@ -49,6 +49,7 @@ add_event_t pres_add_event;
49 49
 
50 50
 /* module parameters */
51 51
 int use_partial_states = 0;
52
+unsigned int pres_conf_default_expires = 3600;
52 53
 
53 54
 /* module exported commands */
54 55
 static cmd_export_t cmds[] =
... ...
@@ -59,6 +60,7 @@ static cmd_export_t cmds[] =
59 60
 /* module exported paramaters */
60 61
 static param_export_t params[] = {
61 62
 	{ "use_partial_states", INT_PARAM, &use_partial_states },
63
+	{ "default_expires", INT_PARAM, &pres_conf_default_expires },
62 64
 	{0, 0, 0}
63 65
 };
64 66
 
... ...
@@ -26,5 +26,6 @@
26 26
 #define _PRES_CONFERENCE_H_
27 27
 
28 28
 extern add_event_t pres_add_event;
29
+extern unsigned int pres_conf_default_expires;
29 30
 
30 31
 #endif