Holger Hans Peter Freyther | bdae6f9 | 2009-08-10 10:17:50 +0200 | [diff] [blame] | 1 | /* OpenBSC interface to quagga VTY */ |
| 2 | /* (C) 2009 by Harald Welte <laforge@gnumonks.org> |
Holger Hans Peter Freyther | 02bd8f4 | 2009-10-27 12:47:06 +0100 | [diff] [blame] | 3 | * (C) 2009 by Holger Hans Peter Freyther |
Holger Hans Peter Freyther | bdae6f9 | 2009-08-10 10:17:50 +0200 | [diff] [blame] | 4 | * All Rights Reserved |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; either version 2 of the License, or |
| 9 | * (at your option) any later version. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License along |
| 17 | * with this program; if not, write to the Free Software Foundation, Inc., |
| 18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
| 19 | * |
| 20 | */ |
| 21 | |
| 22 | #include <stdlib.h> |
| 23 | #include <unistd.h> |
| 24 | #include <sys/types.h> |
| 25 | |
Harald Welte | bd9591f | 2010-05-19 19:45:32 +0200 | [diff] [blame] | 26 | #include <osmocom/vty/command.h> |
| 27 | #include <osmocom/vty/buffer.h> |
| 28 | #include <osmocom/vty/vty.h> |
Holger Hans Peter Freyther | bdae6f9 | 2009-08-10 10:17:50 +0200 | [diff] [blame] | 29 | |
| 30 | #include <arpa/inet.h> |
| 31 | |
Harald Welte | f4625b1 | 2010-02-20 16:24:02 +0100 | [diff] [blame] | 32 | #include <osmocore/linuxlist.h> |
Holger Hans Peter Freyther | bdae6f9 | 2009-08-10 10:17:50 +0200 | [diff] [blame] | 33 | #include <openbsc/gsm_data.h> |
| 34 | #include <openbsc/gsm_subscriber.h> |
Harald Welte | 0101b81 | 2009-11-17 06:00:23 +0100 | [diff] [blame] | 35 | #include <openbsc/silent_call.h> |
Holger Hans Peter Freyther | bdae6f9 | 2009-08-10 10:17:50 +0200 | [diff] [blame] | 36 | #include <openbsc/gsm_04_11.h> |
| 37 | #include <openbsc/e1_input.h> |
| 38 | #include <openbsc/abis_nm.h> |
Harald Welte | f4625b1 | 2010-02-20 16:24:02 +0100 | [diff] [blame] | 39 | #include <osmocore/gsm_utils.h> |
Holger Hans Peter Freyther | bdae6f9 | 2009-08-10 10:17:50 +0200 | [diff] [blame] | 40 | #include <openbsc/db.h> |
Harald Welte | f4625b1 | 2010-02-20 16:24:02 +0100 | [diff] [blame] | 41 | #include <osmocore/talloc.h> |
Harald Welte | b8678a7 | 2009-11-14 10:08:40 +0100 | [diff] [blame] | 42 | #include <openbsc/signal.h> |
Holger Hans Peter Freyther | 1dd0a1b | 2010-01-06 06:00:40 +0100 | [diff] [blame] | 43 | #include <openbsc/debug.h> |
Holger Hans Peter Freyther | e789b21 | 2010-04-15 11:28:14 +0200 | [diff] [blame] | 44 | #include <openbsc/vty.h> |
Holger Hans Peter Freyther | b506d72 | 2010-07-26 20:01:07 +0800 | [diff] [blame] | 45 | #include <openbsc/gsm_04_80.h> |
| 46 | #include <openbsc/chan_alloc.h> |
Holger Hans Peter Freyther | bdae6f9 | 2009-08-10 10:17:50 +0200 | [diff] [blame] | 47 | |
Harald Welte | 4015287 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 48 | extern struct gsm_network *gsmnet_from_vty(struct vty *v); |
Holger Hans Peter Freyther | bdae6f9 | 2009-08-10 10:17:50 +0200 | [diff] [blame] | 49 | |
Sylvain Munaut | dcf8c4c | 2009-12-27 19:30:46 +0100 | [diff] [blame] | 50 | static int hexparse(const char *str, u_int8_t *b, int max_len) |
| 51 | |
| 52 | { |
| 53 | int i, l, v; |
| 54 | |
| 55 | l = strlen(str); |
| 56 | if ((l&1) || ((l>>1) > max_len)) |
| 57 | return -1; |
| 58 | |
| 59 | memset(b, 0x00, max_len); |
| 60 | |
| 61 | for (i=0; i<l; i++) { |
| 62 | char c = str[i]; |
| 63 | if (c >= '0' && c <= '9') |
| 64 | v = c - '0'; |
| 65 | else if (c >= 'a' && c <= 'f') |
| 66 | v = 10 + (c - 'a'); |
| 67 | else if (c >= 'A' && c <= 'F') |
Harald Welte | c7ebb77 | 2010-06-30 09:00:46 +0200 | [diff] [blame] | 68 | v = 10 + (c - 'A'); |
Sylvain Munaut | dcf8c4c | 2009-12-27 19:30:46 +0100 | [diff] [blame] | 69 | else |
| 70 | return -1; |
| 71 | b[i>>1] |= v << (i&1 ? 0 : 4); |
| 72 | } |
| 73 | |
| 74 | return i>>1; |
| 75 | } |
| 76 | |
Holger Hans Peter Freyther | 1dd0a1b | 2010-01-06 06:00:40 +0100 | [diff] [blame] | 77 | static void subscr_dump_full_vty(struct vty *vty, struct gsm_subscriber *subscr) |
| 78 | { |
| 79 | int rc; |
| 80 | struct gsm_auth_info ainfo; |
| 81 | struct gsm_auth_tuple atuple; |
| 82 | |
| 83 | vty_out(vty, " ID: %llu, Authorized: %d%s", subscr->id, |
| 84 | subscr->authorized, VTY_NEWLINE); |
| 85 | if (subscr->name) |
| 86 | vty_out(vty, " Name: '%s'%s", subscr->name, VTY_NEWLINE); |
| 87 | if (subscr->extension) |
| 88 | vty_out(vty, " Extension: %s%s", subscr->extension, |
| 89 | VTY_NEWLINE); |
| 90 | if (subscr->imsi) |
| 91 | vty_out(vty, " IMSI: %s%s", subscr->imsi, VTY_NEWLINE); |
| 92 | if (subscr->tmsi != GSM_RESERVED_TMSI) |
| 93 | vty_out(vty, " TMSI: %08X%s", subscr->tmsi, |
| 94 | VTY_NEWLINE); |
| 95 | |
Sylvain Munaut | 48858d2 | 2010-06-09 11:32:51 +0200 | [diff] [blame] | 96 | rc = db_get_authinfo_for_subscr(&ainfo, subscr); |
Holger Hans Peter Freyther | 1dd0a1b | 2010-01-06 06:00:40 +0100 | [diff] [blame] | 97 | if (!rc) { |
| 98 | vty_out(vty, " A3A8 algorithm id: %d%s", |
| 99 | ainfo.auth_algo, VTY_NEWLINE); |
| 100 | vty_out(vty, " A3A8 Ki: %s%s", |
| 101 | hexdump(ainfo.a3a8_ki, ainfo.a3a8_ki_len), |
| 102 | VTY_NEWLINE); |
| 103 | } |
| 104 | |
Sylvain Munaut | 48858d2 | 2010-06-09 11:32:51 +0200 | [diff] [blame] | 105 | rc = db_get_lastauthtuple_for_subscr(&atuple, subscr); |
Holger Hans Peter Freyther | 1dd0a1b | 2010-01-06 06:00:40 +0100 | [diff] [blame] | 106 | if (!rc) { |
| 107 | vty_out(vty, " A3A8 last tuple (used %d times):%s", |
| 108 | atuple.use_count, VTY_NEWLINE); |
| 109 | vty_out(vty, " seq # : %d%s", |
| 110 | atuple.key_seq, VTY_NEWLINE); |
| 111 | vty_out(vty, " RAND : %s%s", |
| 112 | hexdump(atuple.rand, sizeof(atuple.rand)), |
| 113 | VTY_NEWLINE); |
| 114 | vty_out(vty, " SRES : %s%s", |
| 115 | hexdump(atuple.sres, sizeof(atuple.sres)), |
| 116 | VTY_NEWLINE); |
| 117 | vty_out(vty, " Kc : %s%s", |
| 118 | hexdump(atuple.kc, sizeof(atuple.kc)), |
| 119 | VTY_NEWLINE); |
| 120 | } |
| 121 | |
| 122 | vty_out(vty, " Use count: %u%s", subscr->use_count, VTY_NEWLINE); |
| 123 | } |
| 124 | |
| 125 | |
Holger Hans Peter Freyther | bdae6f9 | 2009-08-10 10:17:50 +0200 | [diff] [blame] | 126 | /* Subscriber */ |
Holger Hans Peter Freyther | bdae6f9 | 2009-08-10 10:17:50 +0200 | [diff] [blame] | 127 | DEFUN(show_subscr_cache, |
| 128 | show_subscr_cache_cmd, |
| 129 | "show subscriber cache", |
| 130 | SHOW_STR "Display contents of subscriber cache\n") |
| 131 | { |
| 132 | struct gsm_subscriber *subscr; |
| 133 | |
| 134 | llist_for_each_entry(subscr, &active_subscribers, entry) { |
| 135 | vty_out(vty, " Subscriber:%s", VTY_NEWLINE); |
Holger Hans Peter Freyther | 1dd0a1b | 2010-01-06 06:00:40 +0100 | [diff] [blame] | 136 | subscr_dump_full_vty(vty, subscr); |
Holger Hans Peter Freyther | bdae6f9 | 2009-08-10 10:17:50 +0200 | [diff] [blame] | 137 | } |
| 138 | |
| 139 | return CMD_SUCCESS; |
| 140 | } |
| 141 | |
| 142 | DEFUN(sms_send_pend, |
| 143 | sms_send_pend_cmd, |
Sylvain Munaut | c2e0a44 | 2009-12-22 13:22:29 +0100 | [diff] [blame] | 144 | "sms send pending", |
| 145 | "Send all pending SMS") |
Holger Hans Peter Freyther | bdae6f9 | 2009-08-10 10:17:50 +0200 | [diff] [blame] | 146 | { |
Harald Welte | 4015287 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 147 | struct gsm_network *gsmnet = gsmnet_from_vty(vty); |
Holger Hans Peter Freyther | bdae6f9 | 2009-08-10 10:17:50 +0200 | [diff] [blame] | 148 | struct gsm_sms *sms; |
Sylvain Munaut | c2e0a44 | 2009-12-22 13:22:29 +0100 | [diff] [blame] | 149 | int id = 0; |
Holger Hans Peter Freyther | bdae6f9 | 2009-08-10 10:17:50 +0200 | [diff] [blame] | 150 | |
| 151 | while (1) { |
Sylvain Munaut | c2e0a44 | 2009-12-22 13:22:29 +0100 | [diff] [blame] | 152 | sms = db_sms_get_unsent_by_subscr(gsmnet, id); |
Holger Hans Peter Freyther | bdae6f9 | 2009-08-10 10:17:50 +0200 | [diff] [blame] | 153 | if (!sms) |
Sylvain Munaut | c2e0a44 | 2009-12-22 13:22:29 +0100 | [diff] [blame] | 154 | break; |
Holger Hans Peter Freyther | bdae6f9 | 2009-08-10 10:17:50 +0200 | [diff] [blame] | 155 | |
| 156 | gsm411_send_sms_subscr(sms->receiver, sms); |
Sylvain Munaut | c2e0a44 | 2009-12-22 13:22:29 +0100 | [diff] [blame] | 157 | |
| 158 | id = sms->receiver->id + 1; |
Holger Hans Peter Freyther | bdae6f9 | 2009-08-10 10:17:50 +0200 | [diff] [blame] | 159 | } |
| 160 | |
| 161 | return CMD_SUCCESS; |
| 162 | } |
| 163 | |
| 164 | struct gsm_sms *sms_from_text(struct gsm_subscriber *receiver, const char *text) |
| 165 | { |
| 166 | struct gsm_sms *sms = sms_alloc(); |
| 167 | |
| 168 | if (!sms) |
| 169 | return NULL; |
| 170 | |
Holger Hans Peter Freyther | bdae6f9 | 2009-08-10 10:17:50 +0200 | [diff] [blame] | 171 | sms->receiver = subscr_get(receiver); |
| 172 | strncpy(sms->text, text, sizeof(sms->text)-1); |
| 173 | |
| 174 | /* FIXME: don't use ID 1 static */ |
Harald Welte | 4015287 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 175 | sms->sender = subscr_get_by_id(receiver->net, 1); |
Holger Hans Peter Freyther | bdae6f9 | 2009-08-10 10:17:50 +0200 | [diff] [blame] | 176 | sms->reply_path_req = 0; |
| 177 | sms->status_rep_req = 0; |
| 178 | sms->ud_hdr_ind = 0; |
| 179 | sms->protocol_id = 0; /* implicit */ |
| 180 | sms->data_coding_scheme = 0; /* default 7bit */ |
| 181 | strncpy(sms->dest_addr, receiver->extension, sizeof(sms->dest_addr)-1); |
| 182 | /* Generate user_data */ |
| 183 | sms->user_data_len = gsm_7bit_encode(sms->user_data, sms->text); |
| 184 | |
| 185 | return sms; |
| 186 | } |
| 187 | |
Harald Welte | 3699e20 | 2010-05-16 19:28:32 +0200 | [diff] [blame] | 188 | static int _send_sms_str(struct gsm_subscriber *receiver, char *str, |
| 189 | u_int8_t tp_pid) |
Holger Hans Peter Freyther | bdae6f9 | 2009-08-10 10:17:50 +0200 | [diff] [blame] | 190 | { |
| 191 | struct gsm_sms *sms; |
| 192 | |
Harald Welte | 3699e20 | 2010-05-16 19:28:32 +0200 | [diff] [blame] | 193 | sms = sms_from_text(receiver, str); |
Harald Welte | 9ee8ee9 | 2009-11-05 15:51:17 +0900 | [diff] [blame] | 194 | sms->protocol_id = tp_pid; |
Nico Golde | 2e6bc80 | 2010-06-29 20:13:06 +0200 | [diff] [blame] | 195 | |
| 196 | if(!receiver->lac){ |
| 197 | /* subscriber currently not attached, store in database */ |
| 198 | if (db_sms_store(sms) != 0) { |
| 199 | LOGP(DSMS, LOGL_ERROR, "Failed to store SMS in Database\n"); |
| 200 | return CMD_WARNING; |
| 201 | } |
| 202 | } else { |
| 203 | gsm411_send_sms_subscr(receiver, sms); |
| 204 | } |
Holger Hans Peter Freyther | bdae6f9 | 2009-08-10 10:17:50 +0200 | [diff] [blame] | 205 | |
| 206 | return CMD_SUCCESS; |
| 207 | } |
| 208 | |
Harald Welte | 4015287 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 209 | static struct gsm_subscriber *get_subscr_by_argv(struct gsm_network *gsmnet, |
| 210 | const char *type, |
Harald Welte | 194ef7b | 2009-11-14 08:00:53 +0100 | [diff] [blame] | 211 | const char *id) |
Holger Hans Peter Freyther | bdae6f9 | 2009-08-10 10:17:50 +0200 | [diff] [blame] | 212 | { |
Harald Welte | 194ef7b | 2009-11-14 08:00:53 +0100 | [diff] [blame] | 213 | if (!strcmp(type, "extension")) |
| 214 | return subscr_get_by_extension(gsmnet, id); |
| 215 | else if (!strcmp(type, "imsi")) |
| 216 | return subscr_get_by_imsi(gsmnet, id); |
| 217 | else if (!strcmp(type, "tmsi")) |
| 218 | return subscr_get_by_tmsi(gsmnet, atoi(id)); |
| 219 | else if (!strcmp(type, "id")) |
| 220 | return subscr_get_by_id(gsmnet, atoi(id)); |
| 221 | |
| 222 | return NULL; |
| 223 | } |
| 224 | #define SUBSCR_TYPES "(extension|imsi|tmsi|id)" |
Harald Welte | 18ce31c | 2010-05-14 20:05:17 +0200 | [diff] [blame] | 225 | #define SUBSCR_HELP "Operations on a Subscriber\n" \ |
| 226 | "Identify subscriber by his extension (phone number)\n" \ |
| 227 | "Identify subscriber by his IMSI\n" \ |
| 228 | "Identify subscriber by his TMSI\n" \ |
| 229 | "Identify subscriber by his database ID\n" \ |
| 230 | "Identifier for the subscriber\n" |
Harald Welte | 194ef7b | 2009-11-14 08:00:53 +0100 | [diff] [blame] | 231 | |
Harald Welte | a8ca70f | 2010-05-27 10:44:58 +0200 | [diff] [blame] | 232 | DEFUN(show_subscr, |
| 233 | show_subscr_cmd, |
| 234 | "show subscriber " SUBSCR_TYPES " ID", |
| 235 | SHOW_STR SUBSCR_HELP) |
| 236 | { |
| 237 | struct gsm_network *gsmnet = gsmnet_from_vty(vty); |
| 238 | struct gsm_subscriber *subscr = |
| 239 | get_subscr_by_argv(gsmnet, argv[0], argv[1]); |
| 240 | |
| 241 | if (!subscr) { |
| 242 | vty_out(vty, "%% No subscriber found for %s %s%s", |
| 243 | argv[0], argv[1], VTY_NEWLINE); |
| 244 | return CMD_WARNING; |
| 245 | } |
| 246 | |
| 247 | subscr_dump_full_vty(vty, subscr); |
| 248 | |
| 249 | subscr_put(subscr); |
| 250 | |
| 251 | return CMD_SUCCESS; |
| 252 | } |
| 253 | |
Harald Welte | 194ef7b | 2009-11-14 08:00:53 +0100 | [diff] [blame] | 254 | DEFUN(subscriber_send_sms, |
| 255 | subscriber_send_sms_cmd, |
Harald Welte | a8ca70f | 2010-05-27 10:44:58 +0200 | [diff] [blame] | 256 | "subscriber " SUBSCR_TYPES " ID sms send .LINE", |
Harald Welte | 18ce31c | 2010-05-14 20:05:17 +0200 | [diff] [blame] | 257 | SUBSCR_HELP "SMS Operations\n" "Send SMS\n" "Actual SMS Text") |
Harald Welte | 194ef7b | 2009-11-14 08:00:53 +0100 | [diff] [blame] | 258 | { |
Harald Welte | 4015287 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 259 | struct gsm_network *gsmnet = gsmnet_from_vty(vty); |
| 260 | struct gsm_subscriber *subscr = get_subscr_by_argv(gsmnet, argv[0], argv[1]); |
Harald Welte | 3699e20 | 2010-05-16 19:28:32 +0200 | [diff] [blame] | 261 | char *str; |
Holger Hans Peter Freyther | bdae6f9 | 2009-08-10 10:17:50 +0200 | [diff] [blame] | 262 | int rc; |
| 263 | |
Harald Welte | 81cf198 | 2009-11-14 10:11:45 +0100 | [diff] [blame] | 264 | if (!subscr) { |
| 265 | vty_out(vty, "%% No subscriber found for %s %s%s", |
| 266 | argv[0], argv[1], VTY_NEWLINE); |
Holger Hans Peter Freyther | bdae6f9 | 2009-08-10 10:17:50 +0200 | [diff] [blame] | 267 | return CMD_WARNING; |
Harald Welte | 81cf198 | 2009-11-14 10:11:45 +0100 | [diff] [blame] | 268 | } |
Harald Welte | 3699e20 | 2010-05-16 19:28:32 +0200 | [diff] [blame] | 269 | str = argv_concat(argv, argc, 2); |
| 270 | rc = _send_sms_str(subscr, str, 0); |
| 271 | talloc_free(str); |
Harald Welte | 9ee8ee9 | 2009-11-05 15:51:17 +0900 | [diff] [blame] | 272 | |
Harald Welte | bbe3172 | 2009-11-14 10:10:54 +0100 | [diff] [blame] | 273 | subscr_put(subscr); |
| 274 | |
Harald Welte | 9ee8ee9 | 2009-11-05 15:51:17 +0900 | [diff] [blame] | 275 | return rc; |
| 276 | } |
| 277 | |
Harald Welte | 194ef7b | 2009-11-14 08:00:53 +0100 | [diff] [blame] | 278 | DEFUN(subscriber_silent_sms, |
| 279 | subscriber_silent_sms_cmd, |
Harald Welte | a8ca70f | 2010-05-27 10:44:58 +0200 | [diff] [blame] | 280 | "subscriber " SUBSCR_TYPES " ID silent-sms send .LINE", |
Harald Welte | 18ce31c | 2010-05-14 20:05:17 +0200 | [diff] [blame] | 281 | SUBSCR_HELP |
| 282 | "Silent SMS Operation\n" "Send Silent SMS\n" "Actual SMS text\n") |
Harald Welte | 9ee8ee9 | 2009-11-05 15:51:17 +0900 | [diff] [blame] | 283 | { |
Harald Welte | 4015287 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 284 | struct gsm_network *gsmnet = gsmnet_from_vty(vty); |
| 285 | struct gsm_subscriber *subscr = get_subscr_by_argv(gsmnet, argv[0], argv[1]); |
Harald Welte | 3699e20 | 2010-05-16 19:28:32 +0200 | [diff] [blame] | 286 | char *str; |
Harald Welte | 9ee8ee9 | 2009-11-05 15:51:17 +0900 | [diff] [blame] | 287 | int rc; |
| 288 | |
Harald Welte | 81cf198 | 2009-11-14 10:11:45 +0100 | [diff] [blame] | 289 | if (!subscr) { |
| 290 | vty_out(vty, "%% No subscriber found for %s %s%s", |
| 291 | argv[0], argv[1], VTY_NEWLINE); |
Harald Welte | 9ee8ee9 | 2009-11-05 15:51:17 +0900 | [diff] [blame] | 292 | return CMD_WARNING; |
Harald Welte | 81cf198 | 2009-11-14 10:11:45 +0100 | [diff] [blame] | 293 | } |
Harald Welte | 9ee8ee9 | 2009-11-05 15:51:17 +0900 | [diff] [blame] | 294 | |
Harald Welte | 3699e20 | 2010-05-16 19:28:32 +0200 | [diff] [blame] | 295 | str = argv_concat(argv, argc, 2); |
| 296 | rc = _send_sms_str(subscr, str, 0); |
| 297 | talloc_free(str); |
Harald Welte | 9ee8ee9 | 2009-11-05 15:51:17 +0900 | [diff] [blame] | 298 | |
Harald Welte | bbe3172 | 2009-11-14 10:10:54 +0100 | [diff] [blame] | 299 | subscr_put(subscr); |
| 300 | |
Harald Welte | 9ee8ee9 | 2009-11-05 15:51:17 +0900 | [diff] [blame] | 301 | return rc; |
| 302 | } |
| 303 | |
Harald Welte | 18ce31c | 2010-05-14 20:05:17 +0200 | [diff] [blame] | 304 | #define CHAN_TYPES "(any|tch/f|tch/any|sdcch)" |
| 305 | #define CHAN_TYPE_HELP \ |
| 306 | "Any channel\n" \ |
| 307 | "TCH/F channel\n" \ |
| 308 | "Any TCH channel\n" \ |
| 309 | "SDCCH channel\n" |
| 310 | |
Sylvain Munaut | 1c378a7 | 2010-01-02 14:29:43 +0100 | [diff] [blame] | 311 | DEFUN(subscriber_silent_call_start, |
| 312 | subscriber_silent_call_start_cmd, |
Harald Welte | a8ca70f | 2010-05-27 10:44:58 +0200 | [diff] [blame] | 313 | "subscriber " SUBSCR_TYPES " ID silent-call start (any|tch/f|tch/any|sdcch)", |
Harald Welte | 18ce31c | 2010-05-14 20:05:17 +0200 | [diff] [blame] | 314 | SUBSCR_HELP "Silent call operation\n" "Start silent call\n" |
| 315 | CHAN_TYPE_HELP) |
Sylvain Munaut | 1c378a7 | 2010-01-02 14:29:43 +0100 | [diff] [blame] | 316 | { |
Harald Welte | 4015287 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 317 | struct gsm_network *gsmnet = gsmnet_from_vty(vty); |
| 318 | struct gsm_subscriber *subscr = get_subscr_by_argv(gsmnet, argv[0], argv[1]); |
Sylvain Munaut | 1c378a7 | 2010-01-02 14:29:43 +0100 | [diff] [blame] | 319 | int rc, type; |
| 320 | |
| 321 | if (!subscr) { |
| 322 | vty_out(vty, "%% No subscriber found for %s %s%s", |
| 323 | argv[0], argv[1], VTY_NEWLINE); |
| 324 | return CMD_WARNING; |
| 325 | } |
| 326 | |
| 327 | if (!strcmp(argv[2], "tch/f")) |
| 328 | type = RSL_CHANNEED_TCH_F; |
| 329 | else if (!strcmp(argv[2], "tch/any")) |
| 330 | type = RSL_CHANNEED_TCH_ForH; |
| 331 | else if (!strcmp(argv[2], "sdcch")) |
| 332 | type = RSL_CHANNEED_SDCCH; |
| 333 | else |
| 334 | type = RSL_CHANNEED_ANY; /* Defaults to ANY */ |
| 335 | |
| 336 | rc = gsm_silent_call_start(subscr, vty, type); |
| 337 | if (rc <= 0) { |
| 338 | vty_out(vty, "%% Subscriber not attached%s", |
| 339 | VTY_NEWLINE); |
| 340 | subscr_put(subscr); |
| 341 | return CMD_WARNING; |
| 342 | } |
| 343 | |
| 344 | subscr_put(subscr); |
| 345 | |
| 346 | return CMD_SUCCESS; |
| 347 | } |
| 348 | |
| 349 | DEFUN(subscriber_silent_call_stop, |
| 350 | subscriber_silent_call_stop_cmd, |
Harald Welte | a8ca70f | 2010-05-27 10:44:58 +0200 | [diff] [blame] | 351 | "subscriber " SUBSCR_TYPES " ID silent-call stop", |
Harald Welte | 18ce31c | 2010-05-14 20:05:17 +0200 | [diff] [blame] | 352 | SUBSCR_HELP "Silent call operation\n" "Stop silent call\n" |
| 353 | CHAN_TYPE_HELP) |
Harald Welte | b8678a7 | 2009-11-14 10:08:40 +0100 | [diff] [blame] | 354 | { |
Harald Welte | 4015287 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 355 | struct gsm_network *gsmnet = gsmnet_from_vty(vty); |
| 356 | struct gsm_subscriber *subscr = get_subscr_by_argv(gsmnet, argv[0], argv[1]); |
Harald Welte | b8678a7 | 2009-11-14 10:08:40 +0100 | [diff] [blame] | 357 | int rc; |
| 358 | |
| 359 | if (!subscr) { |
| 360 | vty_out(vty, "%% No subscriber found for %s %s%s", |
Harald Welte | 81cf198 | 2009-11-14 10:11:45 +0100 | [diff] [blame] | 361 | argv[0], argv[1], VTY_NEWLINE); |
Harald Welte | b8678a7 | 2009-11-14 10:08:40 +0100 | [diff] [blame] | 362 | return CMD_WARNING; |
| 363 | } |
| 364 | |
Sylvain Munaut | 1c378a7 | 2010-01-02 14:29:43 +0100 | [diff] [blame] | 365 | rc = gsm_silent_call_stop(subscr); |
| 366 | if (rc < 0) { |
| 367 | subscr_put(subscr); |
| 368 | return CMD_WARNING; |
Harald Welte | b8678a7 | 2009-11-14 10:08:40 +0100 | [diff] [blame] | 369 | } |
| 370 | |
| 371 | subscr_put(subscr); |
| 372 | |
| 373 | return CMD_SUCCESS; |
| 374 | } |
| 375 | |
Holger Hans Peter Freyther | b506d72 | 2010-07-26 20:01:07 +0800 | [diff] [blame] | 376 | DEFUN(subscriber_ussd_notify, |
| 377 | subscriber_ussd_notify_cmd, |
Holger Hans Peter Freyther | 7429476 | 2010-07-27 18:27:46 +0800 | [diff] [blame^] | 378 | "subscriber " SUBSCR_TYPES " ID ussd-notify (0|1|2) .TEXT", |
Holger Hans Peter Freyther | b506d72 | 2010-07-26 20:01:07 +0800 | [diff] [blame] | 379 | SUBSCR_HELP "USSD Notify\n" |
| 380 | "Subscriber ID\n" |
Holger Hans Peter Freyther | 7429476 | 2010-07-27 18:27:46 +0800 | [diff] [blame^] | 381 | "Alerting Level\n" |
Holger Hans Peter Freyther | b506d72 | 2010-07-26 20:01:07 +0800 | [diff] [blame] | 382 | "Text Message to send\n") |
| 383 | { |
| 384 | char *text; |
| 385 | struct gsm_subscriber_connection *conn; |
| 386 | struct gsm_network *gsmnet = gsmnet_from_vty(vty); |
| 387 | struct gsm_subscriber *subscr = get_subscr_by_argv(gsmnet, argv[0], argv[1]); |
| 388 | int rc; |
Holger Hans Peter Freyther | 7429476 | 2010-07-27 18:27:46 +0800 | [diff] [blame^] | 389 | int level; |
Holger Hans Peter Freyther | b506d72 | 2010-07-26 20:01:07 +0800 | [diff] [blame] | 390 | |
| 391 | if (!subscr) { |
| 392 | vty_out(vty, "%% No subscriber found for %s %s%s", |
| 393 | argv[0], argv[1], VTY_NEWLINE); |
| 394 | return CMD_WARNING; |
| 395 | } |
| 396 | |
Holger Hans Peter Freyther | 7429476 | 2010-07-27 18:27:46 +0800 | [diff] [blame^] | 397 | level = atoi(argv[2]); |
| 398 | text = argv_concat(argv, argc, 3); |
Holger Hans Peter Freyther | b506d72 | 2010-07-26 20:01:07 +0800 | [diff] [blame] | 399 | if (!text) { |
| 400 | subscr_put(subscr); |
| 401 | return CMD_WARNING; |
| 402 | } |
| 403 | |
| 404 | conn = connection_for_subscr(subscr); |
| 405 | if (!conn) { |
| 406 | vty_out(vty, "%% An active connection is required for %s %s%s", |
| 407 | argv[0], argv[1], VTY_NEWLINE); |
| 408 | subscr_put(subscr); |
| 409 | talloc_free(text); |
| 410 | return CMD_WARNING; |
| 411 | } |
| 412 | |
Holger Hans Peter Freyther | 7429476 | 2010-07-27 18:27:46 +0800 | [diff] [blame^] | 413 | gsm0480_send_ussdNotify(conn, level, text); |
Holger Hans Peter Freyther | 9059790 | 2010-07-27 03:31:50 +0800 | [diff] [blame] | 414 | gsm0480_send_releaseComplete(conn); |
Holger Hans Peter Freyther | b506d72 | 2010-07-26 20:01:07 +0800 | [diff] [blame] | 415 | |
| 416 | subscr_put(subscr); |
| 417 | talloc_free(text); |
| 418 | return CMD_SUCCESS; |
| 419 | } |
| 420 | |
Harald Welte | a8ca70f | 2010-05-27 10:44:58 +0200 | [diff] [blame] | 421 | DEFUN(ena_subscr_authorizde, |
| 422 | ena_subscr_authorized_cmd, |
| 423 | "subscriber " SUBSCR_TYPES " ID authorized (0|1)", |
| 424 | SUBSCR_HELP "(De-)Authorize subscriber in HLR\n" |
| 425 | "Subscriber should NOT be authorized\n" |
| 426 | "Subscriber should be authorized\n") |
Holger Hans Peter Freyther | bdae6f9 | 2009-08-10 10:17:50 +0200 | [diff] [blame] | 427 | { |
Harald Welte | a8ca70f | 2010-05-27 10:44:58 +0200 | [diff] [blame] | 428 | struct gsm_network *gsmnet = gsmnet_from_vty(vty); |
| 429 | struct gsm_subscriber *subscr = |
| 430 | get_subscr_by_argv(gsmnet, argv[0], argv[1]); |
| 431 | |
| 432 | if (!subscr) { |
| 433 | vty_out(vty, "%% No subscriber found for %s %s%s", |
| 434 | argv[0], argv[1], VTY_NEWLINE); |
| 435 | return CMD_WARNING; |
| 436 | } |
| 437 | |
| 438 | subscr->authorized = atoi(argv[2]); |
| 439 | db_sync_subscriber(subscr); |
| 440 | |
| 441 | subscr_put(subscr); |
| 442 | |
| 443 | return CMD_SUCCESS; |
| 444 | } |
| 445 | |
| 446 | DEFUN(ena_subscr_name, |
| 447 | ena_subscr_name_cmd, |
Harald Welte | 3368e36 | 2010-06-24 08:06:38 +0200 | [diff] [blame] | 448 | "subscriber " SUBSCR_TYPES " ID name .NAME", |
Harald Welte | a8ca70f | 2010-05-27 10:44:58 +0200 | [diff] [blame] | 449 | SUBSCR_HELP "Set the name of the subscriber\n" |
| 450 | "Name of the Subscriber\n") |
| 451 | { |
| 452 | struct gsm_network *gsmnet = gsmnet_from_vty(vty); |
| 453 | struct gsm_subscriber *subscr = |
| 454 | get_subscr_by_argv(gsmnet, argv[0], argv[1]); |
Harald Welte | 3368e36 | 2010-06-24 08:06:38 +0200 | [diff] [blame] | 455 | char *name; |
Harald Welte | a8ca70f | 2010-05-27 10:44:58 +0200 | [diff] [blame] | 456 | |
| 457 | if (!subscr) { |
| 458 | vty_out(vty, "%% No subscriber found for %s %s%s", |
| 459 | argv[0], argv[1], VTY_NEWLINE); |
| 460 | return CMD_WARNING; |
| 461 | } |
Holger Hans Peter Freyther | bdae6f9 | 2009-08-10 10:17:50 +0200 | [diff] [blame] | 462 | |
Harald Welte | 3368e36 | 2010-06-24 08:06:38 +0200 | [diff] [blame] | 463 | name = argv_concat(argv, argc, 2); |
Holger Hans Peter Freyther | a36df37 | 2010-07-26 19:43:54 +0800 | [diff] [blame] | 464 | if (!name) { |
| 465 | subscr_put(subscr); |
Harald Welte | 3368e36 | 2010-06-24 08:06:38 +0200 | [diff] [blame] | 466 | return CMD_WARNING; |
Holger Hans Peter Freyther | a36df37 | 2010-07-26 19:43:54 +0800 | [diff] [blame] | 467 | } |
Harald Welte | 3368e36 | 2010-06-24 08:06:38 +0200 | [diff] [blame] | 468 | |
Holger Hans Peter Freyther | bdae6f9 | 2009-08-10 10:17:50 +0200 | [diff] [blame] | 469 | strncpy(subscr->name, name, sizeof(subscr->name)); |
Harald Welte | 3368e36 | 2010-06-24 08:06:38 +0200 | [diff] [blame] | 470 | talloc_free(name); |
Holger Hans Peter Freyther | bdae6f9 | 2009-08-10 10:17:50 +0200 | [diff] [blame] | 471 | db_sync_subscriber(subscr); |
| 472 | |
Harald Welte | a8ca70f | 2010-05-27 10:44:58 +0200 | [diff] [blame] | 473 | subscr_put(subscr); |
| 474 | |
Holger Hans Peter Freyther | bdae6f9 | 2009-08-10 10:17:50 +0200 | [diff] [blame] | 475 | return CMD_SUCCESS; |
| 476 | } |
| 477 | |
Harald Welte | a8ca70f | 2010-05-27 10:44:58 +0200 | [diff] [blame] | 478 | DEFUN(ena_subscr_extension, |
| 479 | ena_subscr_extension_cmd, |
| 480 | "subscriber " SUBSCR_TYPES " ID extension EXTENSION", |
| 481 | SUBSCR_HELP "Set the extension (phone number) of the subscriber\n" |
| 482 | "Extension (phone number)\n") |
Holger Hans Peter Freyther | bdae6f9 | 2009-08-10 10:17:50 +0200 | [diff] [blame] | 483 | { |
Harald Welte | a8ca70f | 2010-05-27 10:44:58 +0200 | [diff] [blame] | 484 | struct gsm_network *gsmnet = gsmnet_from_vty(vty); |
| 485 | struct gsm_subscriber *subscr = |
| 486 | get_subscr_by_argv(gsmnet, argv[0], argv[1]); |
| 487 | const char *name = argv[2]; |
Holger Hans Peter Freyther | bdae6f9 | 2009-08-10 10:17:50 +0200 | [diff] [blame] | 488 | |
Harald Welte | a8ca70f | 2010-05-27 10:44:58 +0200 | [diff] [blame] | 489 | if (!subscr) { |
| 490 | vty_out(vty, "%% No subscriber found for %s %s%s", |
| 491 | argv[0], argv[1], VTY_NEWLINE); |
| 492 | return CMD_WARNING; |
| 493 | } |
Holger Hans Peter Freyther | bdae6f9 | 2009-08-10 10:17:50 +0200 | [diff] [blame] | 494 | |
Harald Welte | a8ca70f | 2010-05-27 10:44:58 +0200 | [diff] [blame] | 495 | strncpy(subscr->extension, name, sizeof(subscr->name)); |
Holger Hans Peter Freyther | bdae6f9 | 2009-08-10 10:17:50 +0200 | [diff] [blame] | 496 | db_sync_subscriber(subscr); |
| 497 | |
Harald Welte | a8ca70f | 2010-05-27 10:44:58 +0200 | [diff] [blame] | 498 | subscr_put(subscr); |
Holger Hans Peter Freyther | bdae6f9 | 2009-08-10 10:17:50 +0200 | [diff] [blame] | 499 | |
| 500 | return CMD_SUCCESS; |
| 501 | } |
| 502 | |
Sylvain Munaut | 4887644 | 2010-06-11 00:19:42 +0200 | [diff] [blame] | 503 | #define A3A8_ALG_TYPES "(none|xor|comp128v1)" |
Harald Welte | 18ce31c | 2010-05-14 20:05:17 +0200 | [diff] [blame] | 504 | #define A3A8_ALG_HELP \ |
| 505 | "Use No A3A8 algorithm\n" \ |
Sylvain Munaut | 4887644 | 2010-06-11 00:19:42 +0200 | [diff] [blame] | 506 | "Use XOR algorithm\n" \ |
Harald Welte | 18ce31c | 2010-05-14 20:05:17 +0200 | [diff] [blame] | 507 | "Use COMP128v1 algorithm\n" |
Sylvain Munaut | dcf8c4c | 2009-12-27 19:30:46 +0100 | [diff] [blame] | 508 | |
Harald Welte | a8ca70f | 2010-05-27 10:44:58 +0200 | [diff] [blame] | 509 | DEFUN(ena_subscr_a3a8, |
| 510 | ena_subscr_a3a8_cmd, |
| 511 | "subscriber " SUBSCR_TYPES " ID a3a8 " A3A8_ALG_TYPES " [KI]", |
Harald Welte | c4bf319 | 2010-05-27 10:48:11 +0200 | [diff] [blame] | 512 | SUBSCR_HELP "Set a3a8 parameters for the subscriber\n" |
| 513 | A3A8_ALG_HELP "Encryption Key Ki\n") |
Sylvain Munaut | dcf8c4c | 2009-12-27 19:30:46 +0100 | [diff] [blame] | 514 | { |
Harald Welte | a8ca70f | 2010-05-27 10:44:58 +0200 | [diff] [blame] | 515 | struct gsm_network *gsmnet = gsmnet_from_vty(vty); |
| 516 | struct gsm_subscriber *subscr = |
| 517 | get_subscr_by_argv(gsmnet, argv[0], argv[1]); |
| 518 | const char *alg_str = argv[2]; |
Sylvain Munaut | 4887644 | 2010-06-11 00:19:42 +0200 | [diff] [blame] | 519 | const char *ki_str = argc == 4 ? argv[3] : NULL; |
Sylvain Munaut | dcf8c4c | 2009-12-27 19:30:46 +0100 | [diff] [blame] | 520 | struct gsm_auth_info ainfo; |
Sylvain Munaut | 4887644 | 2010-06-11 00:19:42 +0200 | [diff] [blame] | 521 | int rc, minlen, maxlen; |
Sylvain Munaut | dcf8c4c | 2009-12-27 19:30:46 +0100 | [diff] [blame] | 522 | |
Harald Welte | a8ca70f | 2010-05-27 10:44:58 +0200 | [diff] [blame] | 523 | if (!subscr) { |
| 524 | vty_out(vty, "%% No subscriber found for %s %s%s", |
| 525 | argv[0], argv[1], VTY_NEWLINE); |
| 526 | return CMD_WARNING; |
| 527 | } |
| 528 | |
Sylvain Munaut | dcf8c4c | 2009-12-27 19:30:46 +0100 | [diff] [blame] | 529 | if (!strcasecmp(alg_str, "none")) { |
Sylvain Munaut | 4887644 | 2010-06-11 00:19:42 +0200 | [diff] [blame] | 530 | ainfo.auth_algo = AUTH_ALGO_NONE; |
| 531 | minlen = maxlen = 0; |
| 532 | } else if (!strcasecmp(alg_str, "xor")) { |
| 533 | ainfo.auth_algo = AUTH_ALGO_XOR; |
| 534 | minlen = A38_XOR_MIN_KEY_LEN; |
| 535 | maxlen = A38_XOR_MAX_KEY_LEN; |
Sylvain Munaut | dcf8c4c | 2009-12-27 19:30:46 +0100 | [diff] [blame] | 536 | } else if (!strcasecmp(alg_str, "comp128v1")) { |
Sylvain Munaut | dcf8c4c | 2009-12-27 19:30:46 +0100 | [diff] [blame] | 537 | ainfo.auth_algo = AUTH_ALGO_COMP128v1; |
Sylvain Munaut | 4887644 | 2010-06-11 00:19:42 +0200 | [diff] [blame] | 538 | minlen = maxlen = A38_COMP128_KEY_LEN; |
Sylvain Munaut | dcf8c4c | 2009-12-27 19:30:46 +0100 | [diff] [blame] | 539 | } else { |
| 540 | /* Unknown method */ |
| 541 | return CMD_WARNING; |
| 542 | } |
| 543 | |
Sylvain Munaut | 4887644 | 2010-06-11 00:19:42 +0200 | [diff] [blame] | 544 | if (ki_str) { |
| 545 | rc = hexparse(ki_str, ainfo.a3a8_ki, sizeof(ainfo.a3a8_ki)); |
| 546 | if ((rc > maxlen) || (rc < minlen)) |
| 547 | return CMD_WARNING; |
| 548 | ainfo.a3a8_ki_len = rc; |
| 549 | } else { |
| 550 | ainfo.a3a8_ki_len = 0; |
| 551 | if (minlen) |
| 552 | return CMD_WARNING; |
| 553 | } |
| 554 | |
| 555 | rc = db_sync_authinfo_for_subscr( |
| 556 | ainfo.auth_algo == AUTH_ALGO_NONE ? NULL : &ainfo, |
| 557 | subscr); |
| 558 | |
Sylvain Munaut | 0d7d991 | 2010-06-10 22:00:48 +0200 | [diff] [blame] | 559 | /* the last tuple probably invalid with the new auth settings */ |
| 560 | db_sync_lastauthtuple_for_subscr(NULL, subscr); |
| 561 | |
Sylvain Munaut | dcf8c4c | 2009-12-27 19:30:46 +0100 | [diff] [blame] | 562 | return rc ? CMD_WARNING : CMD_SUCCESS; |
| 563 | } |
| 564 | |
Harald Welte | b8678a7 | 2009-11-14 10:08:40 +0100 | [diff] [blame] | 565 | static int scall_cbfn(unsigned int subsys, unsigned int signal, |
| 566 | void *handler_data, void *signal_data) |
| 567 | { |
| 568 | struct scall_signal_data *sigdata = signal_data; |
| 569 | struct vty *vty = sigdata->data; |
| 570 | |
| 571 | switch (signal) { |
| 572 | case S_SCALL_SUCCESS: |
| 573 | vty_out(vty, "%% silent call on ARFCN %u timeslot %u%s", |
Holger Hans Peter Freyther | d3aaf66 | 2010-06-17 15:05:57 +0800 | [diff] [blame] | 574 | sigdata->conn->lchan->ts->trx->arfcn, sigdata->conn->lchan->ts->nr, |
Harald Welte | b8678a7 | 2009-11-14 10:08:40 +0100 | [diff] [blame] | 575 | VTY_NEWLINE); |
| 576 | break; |
| 577 | case S_SCALL_EXPIRED: |
| 578 | vty_out(vty, "%% silent call expired paging%s", VTY_NEWLINE); |
| 579 | break; |
| 580 | } |
| 581 | return 0; |
| 582 | } |
| 583 | |
Holger Hans Peter Freyther | e789b21 | 2010-04-15 11:28:14 +0200 | [diff] [blame] | 584 | DEFUN(show_stats, |
| 585 | show_stats_cmd, |
| 586 | "show statistics", |
| 587 | SHOW_STR "Display network statistics\n") |
| 588 | { |
Harald Welte | 4015287 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 589 | struct gsm_network *net = gsmnet_from_vty(vty); |
Holger Hans Peter Freyther | e789b21 | 2010-04-15 11:28:14 +0200 | [diff] [blame] | 590 | |
| 591 | openbsc_vty_print_statistics(vty, net); |
| 592 | vty_out(vty, "Location Update : %lu attach, %lu normal, %lu periodic%s", |
| 593 | counter_get(net->stats.loc_upd_type.attach), |
| 594 | counter_get(net->stats.loc_upd_type.normal), |
| 595 | counter_get(net->stats.loc_upd_type.periodic), VTY_NEWLINE); |
| 596 | vty_out(vty, "IMSI Detach Indications : %lu%s", |
| 597 | counter_get(net->stats.loc_upd_type.detach), VTY_NEWLINE); |
| 598 | vty_out(vty, "Location Update Response: %lu accept, %lu reject%s", |
| 599 | counter_get(net->stats.loc_upd_resp.accept), |
| 600 | counter_get(net->stats.loc_upd_resp.reject), VTY_NEWLINE); |
| 601 | vty_out(vty, "Handover : %lu attempted, %lu no_channel, %lu timeout, " |
| 602 | "%lu completed, %lu failed%s", |
| 603 | counter_get(net->stats.handover.attempted), |
| 604 | counter_get(net->stats.handover.no_channel), |
| 605 | counter_get(net->stats.handover.timeout), |
| 606 | counter_get(net->stats.handover.completed), |
| 607 | counter_get(net->stats.handover.failed), VTY_NEWLINE); |
| 608 | vty_out(vty, "SMS MO : %lu submitted, %lu no receiver%s", |
| 609 | counter_get(net->stats.sms.submitted), |
| 610 | counter_get(net->stats.sms.no_receiver), VTY_NEWLINE); |
| 611 | vty_out(vty, "SMS MT : %lu delivered, %lu no memory, %lu other error%s", |
| 612 | counter_get(net->stats.sms.delivered), |
| 613 | counter_get(net->stats.sms.rp_err_mem), |
| 614 | counter_get(net->stats.sms.rp_err_other), VTY_NEWLINE); |
| 615 | return CMD_SUCCESS; |
| 616 | } |
| 617 | |
| 618 | |
Harald Welte | 4015287 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 619 | int bsc_vty_init_extra(void) |
Holger Hans Peter Freyther | bdae6f9 | 2009-08-10 10:17:50 +0200 | [diff] [blame] | 620 | { |
Harald Welte | b8678a7 | 2009-11-14 10:08:40 +0100 | [diff] [blame] | 621 | register_signal_handler(SS_SCALL, scall_cbfn, NULL); |
| 622 | |
Harald Welte | 7bc28f6 | 2010-05-12 16:10:35 +0000 | [diff] [blame] | 623 | install_element_ve(&show_subscr_cmd); |
| 624 | install_element_ve(&show_subscr_cache_cmd); |
Holger Hans Peter Freyther | bdae6f9 | 2009-08-10 10:17:50 +0200 | [diff] [blame] | 625 | |
Harald Welte | 7bc28f6 | 2010-05-12 16:10:35 +0000 | [diff] [blame] | 626 | install_element_ve(&sms_send_pend_cmd); |
Harald Welte | 194ef7b | 2009-11-14 08:00:53 +0100 | [diff] [blame] | 627 | |
Harald Welte | 7bc28f6 | 2010-05-12 16:10:35 +0000 | [diff] [blame] | 628 | install_element_ve(&subscriber_send_sms_cmd); |
| 629 | install_element_ve(&subscriber_silent_sms_cmd); |
| 630 | install_element_ve(&subscriber_silent_call_start_cmd); |
| 631 | install_element_ve(&subscriber_silent_call_stop_cmd); |
Holger Hans Peter Freyther | b506d72 | 2010-07-26 20:01:07 +0800 | [diff] [blame] | 632 | install_element_ve(&subscriber_ussd_notify_cmd); |
Harald Welte | 7bc28f6 | 2010-05-12 16:10:35 +0000 | [diff] [blame] | 633 | install_element_ve(&show_stats_cmd); |
Holger Hans Peter Freyther | bdae6f9 | 2009-08-10 10:17:50 +0200 | [diff] [blame] | 634 | |
Harald Welte | a8ca70f | 2010-05-27 10:44:58 +0200 | [diff] [blame] | 635 | install_element(ENABLE_NODE, &ena_subscr_name_cmd); |
| 636 | install_element(ENABLE_NODE, &ena_subscr_extension_cmd); |
| 637 | install_element(ENABLE_NODE, &ena_subscr_authorized_cmd); |
| 638 | install_element(ENABLE_NODE, &ena_subscr_a3a8_cmd); |
Holger Hans Peter Freyther | bdae6f9 | 2009-08-10 10:17:50 +0200 | [diff] [blame] | 639 | |
| 640 | return 0; |
| 641 | } |