diff --git a/include/openbsc/gsm_04_08.h b/include/openbsc/gsm_04_08.h index 0ba623519..23a637aad 100644 --- a/include/openbsc/gsm_04_08.h +++ b/include/openbsc/gsm_04_08.h @@ -380,7 +380,10 @@ enum gsm48_reject_value { struct msgb; struct gsm_bts; +/* config options controlling the behaviour of the lower leves */ void gsm0408_allow_everyone(int allow); +void gsm0408_set_reject_cause(int cause); + int gsm0408_rcvmsg(struct msgb *msg); void gsm0408_generate_lai(struct gsm48_loc_area_id *lai48, u_int16_t mcc, u_int16_t mnc, u_int16_t lac); diff --git a/src/bsc_hack.c b/src/bsc_hack.c index fe3431ef2..39301e6a5 100644 --- a/src/bsc_hack.c +++ b/src/bsc_hack.c @@ -674,6 +674,7 @@ static void print_help() printf(" -c --country-code number (MCC) \n"); printf(" -l --database db-name The database to use\n"); printf(" -a --authorize-everyone Allow everyone into the network.\n"); + printf(" -r --reject-cause number The reject cause for LOCATION UPDATING REJECT.\n"); printf(" -h --help this text\n"); } @@ -689,10 +690,11 @@ static void handle_options(int argc, char** argv) {"country-code", 1, 0, 'c'}, {"database", 1, 0, 'l'}, {"authorize-everyone", 0, 0, 'a'}, + {"reject-cause", 1, 0, 'r'}, {0, 0, 0, 0} }; - c = getopt_long(argc, argv, "hc:n:d:sa", + c = getopt_long(argc, argv, "hc:n:d:sar:", long_options, &option_index); if (c == -1) break; @@ -720,6 +722,9 @@ static void handle_options(int argc, char** argv) case 'a': gsm0408_allow_everyone(1); break; + case 'r': + gsm0408_set_reject_cause(atoi(optarg)); + break; default: /* ignore */ break; diff --git a/src/gsm_04_08.c b/src/gsm_04_08.c index 80aeaa40b..65d2f647a 100644 --- a/src/gsm_04_08.c +++ b/src/gsm_04_08.c @@ -59,6 +59,12 @@ void gsm0408_allow_everyone(int everyone) authorize_everonye = everyone; } +static int reject_cause = 0; +void gsm0408_set_reject_cause(int cause) +{ + reject_cause = cause; +} + static int authorize_subscriber(struct gsm_subscriber *subscriber) { if (!subscriber) @@ -360,8 +366,7 @@ static void loc_upd_rej_cb(void *data) { struct gsm_lchan *lchan = data; - /* 0x16 is congestion */ - gsm0408_loc_upd_rej(lchan, 0x04); + gsm0408_loc_upd_rej(lchan, reject_cause); rsl_chan_release(lchan); }