This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
Holger Freyther gerrit-no-reply at lists.osmocom.orgHolger Freyther has submitted this change and it was merged.
Change subject: mobile: Return the name of the configured "MS"
......................................................................
mobile: Return the name of the configured "MS"
In lua osmo.ms():name() will print the name/number of the MS. This
can be used by scripting code to use in events and then be analyzed.
Change-Id: I881d3e87daa19f4e6f4f5bd30fe95906129e60ef
---
M src/host/layer23/src/mobile/script_lua.c
1 file changed, 7 insertions(+), 0 deletions(-)
Approvals:
Harald Welte: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/src/host/layer23/src/mobile/script_lua.c b/src/host/layer23/src/mobile/script_lua.c
index e63d205..1b80c48 100644
--- a/src/host/layer23/src/mobile/script_lua.c
+++ b/src/host/layer23/src/mobile/script_lua.c
@@ -389,6 +389,12 @@
return 1;
}
+static int lua_ms_name(lua_State *L)
+{
+ lua_pushstring(L, get_primitive(L)->ms->name);
+ return 1;
+}
+
static const struct luaL_Reg ms_funcs[] = {
{ "imsi", lua_ms_imsi },
{ "imei", lua_ms_imei },
@@ -398,6 +404,7 @@
{ "start", lua_ms_no_shutdown },
{ "stop", lua_ms_shutdown },
{ "sms_send_simple", lua_ms_sms_send_simple },
+ { "number", lua_ms_name },
{ NULL, NULL },
};
--
To view, visit https://gerrit.osmocom.org/5156
To unsubscribe, visit https://gerrit.osmocom.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I881d3e87daa19f4e6f4f5bd30fe95906129e60ef
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Holger Freyther <holger at freyther.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Holger Freyther <holger at freyther.de>
Gerrit-Reviewer: Jenkins Builder