diff options
author | Andreas Eversberg <jolly@eversberg.eu> | 2024-01-14 19:16:41 +0100 |
---|---|---|
committer | Andreas Eversberg <jolly@eversberg.eu> | 2024-02-18 16:23:30 +0100 |
commit | c844fcc1f67b6e2941a54c003059e0ee065ba077 (patch) | |
tree | d5e11602137a65331ef00bfd541884a19a29cd6b /src/fuvst | |
parent | 7e5663a709eee8fdafa422d03aed802561957131 (diff) |
If a mobile inscribes, show station ID on the console
If the console's station ID is not set, it will be automatically set
when a call is made from the mobile phone or when it performs
inscription to the network. (Only works for cellular networks with
inscription support.)
Diffstat (limited to 'src/fuvst')
-rwxr-xr-x | src/fuvst/fuvst.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/fuvst/fuvst.c b/src/fuvst/fuvst.c index 0871116..bf6c60f 100755 --- a/src/fuvst/fuvst.c +++ b/src/fuvst/fuvst.c @@ -40,6 +40,7 @@ #include "../libmobile/call.h" #include "../libmobile/cause.h" #include "../libmobile/get_time.h" +#include "../libmobile/console.h" #include <osmocom/core/timer.h> #include <osmocom/core/utils.h> #include <osmocom/cc/message.h> @@ -432,15 +433,20 @@ typedef struct transaction { transaction_t *trans_list = NULL; -const char *transaction2rufnummer(transaction_t *trans) +static const char *nut2rufnummer(uint8_t futln_nat, uint8_t futln_fuvst, uint16_t futln_rest) { static char rufnummer[32]; /* make GCC happy (overflow check) */ - sprintf(rufnummer, "%d%d%05d", trans->futln_nat, trans->futln_fuvst, trans->futln_rest); + sprintf(rufnummer, "%d%d%05d", futln_nat, futln_fuvst, futln_rest); return rufnummer; } +static const char *transaction2rufnummer(transaction_t *trans) +{ + return nut2rufnummer(trans->futln_nat, trans->futln_fuvst, trans->futln_rest); +} + const char *state_name(enum call_state state) { static char invalid[16]; @@ -925,6 +931,7 @@ static void message_receive(fuvst_t *zzk, uint8_t ident, uint8_t opcode, uint8_t case OPCODE_EBAF: /* enter BS (inscription) */ decode_ebaf(data, len, &T, &U, &N, &s, &u, &b, &l); add_db(N, U, T, l); + console_inscription(nut2rufnummer(N, U, T)); len = encode_ebpqu(&opcode, &data); message_send(ident, opcode, data, len); break; |