diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2013-05-13 21:08:36 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2013-05-13 21:17:37 +0200 |
commit | 0ff1c8c548f75988e2b910e4442fd82e73ab31df (patch) | |
tree | 881ad3e89adf8044b24ac029e6a9ce16d87e44aa /src | |
parent | fe1550fed4146fd016f0d2cffc07f6ae8ed6b7fe (diff) |
patching: Add a VTY option to hardcode the assignment complete message
For some equipment it is the easiest to patch the assignment
complete message transported to the MSC. Add a VTY config to
enable this patching, create a testcase that tests that the
original message is truncated. The setting of the VTY option
has been manually tested. The entire system has not been end
to end tested.
Conflicts:
src/vty_interface.c
Diffstat (limited to 'src')
-rw-r--r-- | src/bss_patch.c | 14 | ||||
-rw-r--r-- | src/vty_interface.c | 27 |
2 files changed, 36 insertions, 5 deletions
diff --git a/src/bss_patch.c b/src/bss_patch.c index cc897b6..e0a6362 100644 --- a/src/bss_patch.c +++ b/src/bss_patch.c @@ -1,7 +1,7 @@ /* Patch GSM 08.08 messages for the network and BS */ /* - * (C) 2010-2011 by Holger Hans Peter Freyther <zecke@selfish.org> - * (C) 2010-2011 by On-Waves + * (C) 2010-2013 by Holger Hans Peter Freyther <zecke@selfish.org> + * (C) 2010-2013 by On-Waves * All Rights Reserved * * This program is free software: you can redistribute it and/or modify @@ -21,6 +21,7 @@ #include <bss_patch.h> #include <cellmgr_debug.h> +#include <ss7_application.h> #include <string.h> @@ -71,7 +72,14 @@ static void patch_ass_cmpl(struct ss7_application *app, struct msgb *msg, int le struct tlv_parsed tp; uint8_t *data; - if (length == 1) { + if (length == 1 || app->fixed_ass_cmpl_reply) { + /* We need to truncate the message to only include the codec */ + if (length > 1 && app->fixed_ass_cmpl_reply) { + uint8_t *old = msg->tail; + msg->tail = &msg->l3h[1]; + msg->len = old - msg->tail; + } + LOGP(DMSC, LOGL_ERROR, "Hacking the Assignment Complete.\n"); msgb_v_put(msg, 0x21); msgb_v_put(msg, 0x09); diff --git a/src/vty_interface.c b/src/vty_interface.c index 001ba44..de0887d 100644 --- a/src/vty_interface.c +++ b/src/vty_interface.c @@ -1,7 +1,7 @@ /* VTY code for the osmo-stp */ /* - * (C) 2010-2012 by Holger Hans Peter Freyther <zecke@selfish.org> - * (C) 2010-2012 by On-Waves + * (C) 2010-2013 by Holger Hans Peter Freyther <zecke@selfish.org> + * (C) 2010-2013 by On-Waves * All Rights Reserved * * This program is free software: you can redistribute it and/or modify @@ -296,6 +296,9 @@ static void write_application(struct vty *vty, struct ss7_application *app) vty_out(vty, " description %s%s", name, VTY_NEWLINE); vty_out(vty, " type %s%s", app_type(app->type), VTY_NEWLINE); + if (app->fixed_ass_cmpl_reply) + vty_out(vty, " hardcode-assignment-complete%s", VTY_NEWLINE); + if (app->type == APP_STP) { vty_out(vty, " isup-pass-through %d%s", app->isup_pass, VTY_NEWLINE); if (app->trunk_name) @@ -1029,6 +1032,24 @@ DEFUN(cfg_app_no_trunk_name, cfg_app_no_trunk_name_cmd, return CMD_SUCCESS; } +DEFUN(cfg_app_hardcode_ass, cfg_app_hardcode_ass_cmd, + "hardcode-assignment-complete", + "Hardcode the assignment complete message to HR3\n") +{ + struct ss7_application *app = vty->index; + app->fixed_ass_cmpl_reply = 1; + return CMD_SUCCESS; +} + +DEFUN(cfg_app_no_hardcode_ass, cfg_app_no_hardcode_ass_cmd, + "no hardcode-assignment-complete", + "Hardcode the assignment complete message to HR3\n") +{ + struct ss7_application *app = vty->index; + app->fixed_ass_cmpl_reply = 0; + return CMD_SUCCESS; +} + static void install_defaults(int node) { install_default(node); @@ -1104,6 +1125,8 @@ void cell_vty_init(void) install_element(APP_NODE, &cfg_app_no_domain_name_cmd); install_element(APP_NODE, &cfg_app_trunk_name_cmd); install_element(APP_NODE, &cfg_app_no_trunk_name_cmd); + install_element(APP_NODE, &cfg_app_hardcode_ass_cmd); + install_element(APP_NODE, &cfg_app_no_hardcode_ass_cmd); cell_vty_init_cmds(); } |