Module: kamailio Branch: master Commit: 2158819818afabd501af1a41803989d4bd00656e URL: https://github.com/kamailio/kamailio/commit/2158819818afabd501af1a41803989d4...
Author: Adrian Tabacioiu adi.tabacioiu@c-s.ro Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2022-01-18T20:19:16+01:00
presence_conference: use parameter default_expires instead of 3600 constant
- GH #2996
---
Modified: src/modules/presence_conference/add_events.c Modified: src/modules/presence_conference/doc/presence_conference_admin.xml Modified: src/modules/presence_conference/presence_conference.c Modified: src/modules/presence_conference/presence_conference.h
---
Diff: https://github.com/kamailio/kamailio/commit/2158819818afabd501af1a41803989d4... Patch: https://github.com/kamailio/kamailio/commit/2158819818afabd501af1a41803989d4...
---
diff --git a/src/modules/presence_conference/add_events.c b/src/modules/presence_conference/add_events.c index 576746efed..7683f5a8bc 100644 --- a/src/modules/presence_conference/add_events.c +++ b/src/modules/presence_conference/add_events.c @@ -43,7 +43,7 @@ int conference_add_events(void) event.content_type.s = "application/conference-info+xml"; event.content_type.len = 31;
- event.default_expires= 3600; + event.default_expires = pres_conf_default_expires; event.type = PUBL_TYPE; event.req_auth = 0; event.evs_publ_handl = 0; diff --git a/src/modules/presence_conference/doc/presence_conference_admin.xml b/src/modules/presence_conference/doc/presence_conference_admin.xml index 6b1f46012e..158d241c24 100644 --- a/src/modules/presence_conference/doc/presence_conference_admin.xml +++ b/src/modules/presence_conference/doc/presence_conference_admin.xml @@ -76,6 +76,26 @@ modparam("presence_conference", "use_partial_states", 0) </example> </section>
+<section id="presence_conference.p.default_expires"> + <title><varname>default_expires</varname> (int)</title> + <para> + The default expires value used when missing from SUBSCRIBE + message (in seconds). + </para> + <para> + <emphasis>Default value is <quote>3600</quote>. + </emphasis> + </para> + <example> + <title>Set <varname>default_expires</varname> parameter</title> + <programlisting format="linespecific"> +... +modparam("presence_conference", "default_expires", 3600) +... +</programlisting> + </example> +</section> + </section> <section> diff --git a/src/modules/presence_conference/presence_conference.c b/src/modules/presence_conference/presence_conference.c index cb117c3c6a..890533e11f 100644 --- a/src/modules/presence_conference/presence_conference.c +++ b/src/modules/presence_conference/presence_conference.c @@ -49,6 +49,7 @@ add_event_t pres_add_event;
/* module parameters */ int use_partial_states = 0; +unsigned int pres_conf_default_expires = 3600;
/* module exported commands */ static cmd_export_t cmds[] = @@ -59,6 +60,7 @@ static cmd_export_t cmds[] = /* module exported paramaters */ static param_export_t params[] = { { "use_partial_states", INT_PARAM, &use_partial_states }, + { "default_expires", INT_PARAM, &pres_conf_default_expires }, {0, 0, 0} };
diff --git a/src/modules/presence_conference/presence_conference.h b/src/modules/presence_conference/presence_conference.h index f8e0efe9de..8bf05885af 100644 --- a/src/modules/presence_conference/presence_conference.h +++ b/src/modules/presence_conference/presence_conference.h @@ -26,5 +26,6 @@ #define _PRES_CONFERENCE_H_
extern add_event_t pres_add_event; +extern unsigned int pres_conf_default_expires;
#endif