Module: kamailio
Branch: 5.0
Commit: 648cc1894e87ea6e3d254c83592fc385810740c0
URL:
https://github.com/kamailio/kamailio/commit/648cc1894e87ea6e3d254c83592fc38…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2018-02-11T09:46:30+01:00
presence: set user agent db field to empty string if no value is found
(cherry picked from commit 4654f8b4f341a6c9f8cf4daafc7d618871c95e1b)
(cherry picked from commit c1ec6b02139475abe7da276cd36de4ebb9709ea2)
---
Modified: src/modules/presence/subscribe.c
---
Diff:
https://github.com/kamailio/kamailio/commit/648cc1894e87ea6e3d254c83592fc38…
Patch:
https://github.com/kamailio/kamailio/commit/648cc1894e87ea6e3d254c83592fc38…
---
diff --git a/src/modules/presence/subscribe.c b/src/modules/presence/subscribe.c
index 18bb2b1a70..8b53500c18 100644
--- a/src/modules/presence/subscribe.c
+++ b/src/modules/presence/subscribe.c
@@ -191,6 +191,7 @@ int insert_subs_db(subs_t* s, int type)
contact_col, local_contact_col, version_col,socket_info_col,reason_col,
watcher_user_col, watcher_domain_col, updated_col, updated_winfo_col,
user_agent_col, flags_col;
+ str sval_empty = str_init("");
if(pa_dbf.use_table(pa_db, &active_watchers_table)< 0)
{
@@ -353,7 +354,8 @@ int insert_subs_db(subs_t* s, int type)
query_vals[updated_col].val.int_val = s->updated;
query_vals[updated_winfo_col].val.int_val = s->updated_winfo;
query_vals[flags_col].val.int_val = s->flags;
- query_vals[user_agent_col].val.str_val= s->user_agent;
+ query_vals[user_agent_col].val.str_val=
+ (s->user_agent.s && s->user_agent.len>0)?s->user_agent:sval_empty;
if (pa_dbf.use_table(pa_db, &active_watchers_table) < 0)
{