db v5: prep for D-GSM: add vlr_via_proxy and sgsn_via_proxy
D-GSM will store in the HLR DB whether a locally connected MSC has attached the
subscriber (last_lu_seen[_ps]), or whether the attach happened via a GSUP proxy
from a different site.
Add columns for this separately in this patch.
Change-Id: I98c7b3870559ede84adf56e4bf111f53c7487745
diff --git a/src/db_hlr.c b/src/db_hlr.c
index ec8f896..9073926 100644
--- a/src/db_hlr.c
+++ b/src/db_hlr.c
@@ -505,6 +505,8 @@
subscr->imsi, "CS");
parse_last_lu_seen(&subscr->last_lu_seen_ps, (const char *)sqlite3_column_text(stmt, 15),
subscr->imsi, "PS");
+ copy_sqlite3_text_to_ipa_name(&subscr->vlr_via_proxy, stmt, 16);
+ copy_sqlite3_text_to_ipa_name(&subscr->sgsn_via_proxy, stmt, 17);
out:
db_remove_reset(stmt);
@@ -750,6 +752,14 @@
if (!db_bind_text(stmt, "$number", (char*)vlr_name->val))
return -EIO;
+ if (via_proxy && via_proxy->len) {
+ if (!db_bind_text(stmt, "$proxy", (char*)via_proxy->val))
+ return -EIO;
+ } else {
+ if (!db_bind_null(stmt, "$proxy"))
+ return -EIO;
+ }
+
/* execute the statement */
rc = sqlite3_step(stmt);
if (rc != SQLITE_DONE) {