diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2017-10-17 01:43:48 +0200 |
---|---|---|
committer | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2017-10-17 02:28:43 +0000 |
commit | 00b1d43435dff75a4189de1db66be18b3234b552 (patch) | |
tree | 896dc5b1aaa298819ca697e9ab76e714f555e57d /src/ctrl.c | |
parent | 7ae8d878cfb6b79218e859cde2521a3db03e3555 (diff) |
add hlr_subsrc_nam to put GSUP client notification in proper API
This code should not live in a CTRL interface function but be proper hlr_* API.
Change-Id: I4c9b8f9ad51d49517474e8b51afc3cc2e1c9299a
Diffstat (limited to 'src/ctrl.c')
-rw-r--r-- | src/ctrl.c | 18 |
1 files changed, 3 insertions, 15 deletions
@@ -35,31 +35,19 @@ static int handle_cmd_ps(struct hlr *ctx, struct ctrl_cmd *cmd, bool enable) { - struct lu_operation *luop = NULL; - struct osmo_gsup_conn *co; + struct hlr_subscriber subscr; - if (db_subscr_get_by_imsi(ctx->dbc, cmd->value, NULL) < 0) { + if (db_subscr_get_by_imsi(ctx->dbc, cmd->value, &subscr) < 0) { cmd->reply = "Subscriber Unknown in HLR"; return CTRL_CMD_ERROR; } - if (db_subscr_nam(ctx->dbc, cmd->value, enable, true) < 0) { + if (hlr_subscr_nam(ctx, &subscr, enable, true) < 0) { cmd->reply = "Error updating DB"; return CTRL_CMD_ERROR; } - /* FIXME: only send to single SGSN where latest update for IMSI came from */ - if (!enable) { - llist_for_each_entry(co, &ctx->gs->clients, list) { - luop = lu_op_alloc_conn(co); - lu_op_fill_subscr(luop, ctx->dbc, cmd->value); - lu_op_tx_del_subscr_data(luop); - lu_op_free(luop); - } - } - cmd->reply = "OK"; - return CTRL_CMD_REPLY; } |