From 238df986b9c705392898f74271c3258c16ffe927 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Sun, 3 Dec 2017 22:01:50 +0000 Subject: 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 --- src/host/layer23/src/mobile/script_lua.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/host/layer23/src/mobile/script_lua.c b/src/host/layer23/src/mobile/script_lua.c index e63d205a..1b80c485 100644 --- a/src/host/layer23/src/mobile/script_lua.c +++ b/src/host/layer23/src/mobile/script_lua.c @@ -389,6 +389,12 @@ static int lua_ms_sms_send_simple(lua_State *L) 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 @@ static const struct luaL_Reg ms_funcs[] = { { "start", lua_ms_no_shutdown }, { "stop", lua_ms_shutdown }, { "sms_send_simple", lua_ms_sms_send_simple }, + { "number", lua_ms_name }, { NULL, NULL }, }; -- cgit v1.2.3