Module: kamailio
Branch: master
Commit: 31598421de858786f9ed416db8f33c12c0efd383
URL:
https://github.com/kamailio/kamailio/commit/31598421de858786f9ed416db8f33c1…
Author: Adrian Tabacioiu <adi.tabacioiu(a)c-s.ro>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2022-01-18T20:19:16+01:00
presence_dialoginfo: use parameter default_expires instead of 3600 constant
- GH #2996
---
Modified: src/modules/presence_dialoginfo/add_events.c
Modified: src/modules/presence_dialoginfo/doc/presence_dialoginfo_admin.xml
Modified: src/modules/presence_dialoginfo/presence_dialoginfo.c
Modified: src/modules/presence_dialoginfo/presence_dialoginfo.h
---
Diff:
https://github.com/kamailio/kamailio/commit/31598421de858786f9ed416db8f33c1…
Patch:
https://github.com/kamailio/kamailio/commit/31598421de858786f9ed416db8f33c1…
---
diff --git a/src/modules/presence_dialoginfo/add_events.c
b/src/modules/presence_dialoginfo/add_events.c
index 03cd981837..bed11b2d48 100644
--- a/src/modules/presence_dialoginfo/add_events.c
+++ b/src/modules/presence_dialoginfo/add_events.c
@@ -43,7 +43,7 @@ int dlginfo_add_events(void)
event.content_type.s = "application/dialog-info+xml";
event.content_type.len = 27;
- event.default_expires= 3600;
+ event.default_expires= pres_dlginfo_default_expires;
event.type = PUBL_TYPE;
event.req_auth = 0;
event.evs_publ_handl = 0;
diff --git a/src/modules/presence_dialoginfo/doc/presence_dialoginfo_admin.xml
b/src/modules/presence_dialoginfo/doc/presence_dialoginfo_admin.xml
index cdb1729584..caca121f18 100644
--- a/src/modules/presence_dialoginfo/doc/presence_dialoginfo_admin.xml
+++ b/src/modules/presence_dialoginfo/doc/presence_dialoginfo_admin.xml
@@ -248,6 +248,26 @@ modparam("presence_dialoginfo",
"force_dummy_dialog", 1)
</example>
</section>
+<section id="presence_dialoginfo.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_dialoginfo", "default_expires", 3600)
+...
+</programlisting>
+ </example>
+</section>
+
</section>
<section>
diff --git a/src/modules/presence_dialoginfo/presence_dialoginfo.c
b/src/modules/presence_dialoginfo/presence_dialoginfo.c
index 9bf8199dda..edc96fb11e 100644
--- a/src/modules/presence_dialoginfo/presence_dialoginfo.c
+++ b/src/modules/presence_dialoginfo/presence_dialoginfo.c
@@ -49,6 +49,7 @@ add_event_t pres_add_event;
/* module parameters */
int force_single_dialog = 0;
int force_dummy_dialog = 0;
+unsigned int pres_dlginfo_default_expires = 3600;
/* module exported commands */
static cmd_export_t cmds[] =
@@ -60,6 +61,7 @@ static cmd_export_t cmds[] =
static param_export_t params[] = {
{ "force_single_dialog", INT_PARAM, &force_single_dialog },
{ "force_dummy_dialog", INT_PARAM, &force_dummy_dialog },
+ { "default_expires", INT_PARAM, &pres_dlginfo_default_expires },
{0, 0, 0}
};
diff --git a/src/modules/presence_dialoginfo/presence_dialoginfo.h
b/src/modules/presence_dialoginfo/presence_dialoginfo.h
index 750a8c3347..2e9c40553d 100644
--- a/src/modules/presence_dialoginfo/presence_dialoginfo.h
+++ b/src/modules/presence_dialoginfo/presence_dialoginfo.h
@@ -26,5 +26,6 @@
#define _PRES_DLGINFO_H_
extern add_event_t pres_add_event;
+extern unsigned int pres_dlginfo_default_expires;
#endif