diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2014-07-09 15:22:21 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2014-07-09 15:22:21 +0200 |
commit | d29b8a4745cdf5ffed52c072a21fe5609fb23c28 (patch) | |
tree | 264ee9fc15c2d131906f6b751b665fe32bb9a8e1 /openbsc/src/osmo-bsc | |
parent | c6e9049f9c93342256e4f2e1f911d321c098bbe1 (diff) |
bsc: Implement a way to relay a message to the remote MSC
This is analogue to the notification that is relayed locally and
now we have a way to relay a message back to the network.
Diffstat (limited to 'openbsc/src/osmo-bsc')
-rw-r--r-- | openbsc/src/osmo-bsc/osmo_bsc_ctrl.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c b/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c index bc442893a..883205781 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c @@ -593,6 +593,44 @@ static int verify_net_notification(struct ctrl_cmd *cmd, const char *value, void return 0; } +CTRL_CMD_DEFINE(net_inform_msc, "inform-msc-v1"); +static int get_net_inform_msc(struct ctrl_cmd *cmd, void *data) +{ + cmd->reply = "There is nothing to read"; + return CTRL_CMD_ERROR; +} + +static int set_net_inform_msc(struct ctrl_cmd *cmd, void *data) +{ + struct gsm_network *net; + struct osmo_msc_data *msc; + + net = cmd->node; + llist_for_each_entry(msc, &net->bsc_data->mscs, entry) { + struct ctrl_cmd *trap; + + trap = ctrl_cmd_create(tall_bsc_ctx, CTRL_TYPE_TRAP); + if (!trap) { + LOGP(DCTRL, LOGL_ERROR, "Trap creation failed\n"); + continue; + } + + trap->id = "0"; + trap->variable = "inform-msc-v1"; + trap->reply = talloc_strdup(trap, cmd->value); + ctrl_cmd_send(&msc->msc_con->write_queue, trap); + talloc_free(trap); + } + + + return CTRL_CMD_HANDLED; +} + +static int verify_net_inform_msc(struct ctrl_cmd *cmd, const char *value, void *data) +{ + return 0; +} + static int msc_signal_handler(unsigned int subsys, unsigned int signal, void *handler_data, void *signal_data) { @@ -648,6 +686,9 @@ int bsc_ctrl_cmds_install(struct gsm_network *net) rc = ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_net_notification); if (rc) goto end; + rc = ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_net_inform_msc); + if (rc) + goto end; rc = osmo_signal_register_handler(SS_L_INPUT, &bts_connection_status_trap_cb, net); end: |