diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-09-26 05:23:33 +0800 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-09-26 18:49:02 +0800 |
commit | c98d67d592c82603b436fb7a641f8dad8e7ad3d7 (patch) | |
tree | c155afc4cf74f5de22398ab82b389fd4da268e3a | |
parent | 43dbcfe2cf57c60f2a3081695718a6da1e48800b (diff) |
bsc: Mark LUs with a different LAC as needing special care
We want to send a welcome USSD to new subscribers, mark subscribers
with a different LAC than this cell as special and hope someone will
follow up with them.
-rw-r--r-- | openbsc/include/openbsc/gsm_data.h | 2 | ||||
-rw-r--r-- | openbsc/src/bsc_msc_ip.c | 34 |
2 files changed, 36 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index c52229a81..ec946aa3c 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -125,6 +125,8 @@ struct bss_sccp_connection_data { struct sccp_connection *sccp; int ciphering_handled : 1; + int new_subscriber; + /* Timers... */ /* for assginment command */ diff --git a/openbsc/src/bsc_msc_ip.c b/openbsc/src/bsc_msc_ip.c index e7f2bae5b..ace9eb775 100644 --- a/openbsc/src/bsc_msc_ip.c +++ b/openbsc/src/bsc_msc_ip.c @@ -544,6 +544,38 @@ static int handle_modify_ack(struct msgb *msg) return 1; } +/* + * Check if the subscriber is coming from our LAC + */ +static void handle_lu(struct msgb *msg) +{ + struct gsm48_hdr *gh; + struct gsm48_loc_upd_req *lu; + struct gsm48_loc_area_id lai; + struct gsm_network *net; + + if (msgb_l3len(msg) < sizeof(*gh) + sizeof(*lu)) { + LOGP(DMSC, LOGL_ERROR, "LU too small to look at: %u\n", msgb_l3len(msg)); + return; + } + + if (!msg->lchan->msc_data) + return; + + net = msg->trx->bts->network; + + gh = msgb_l3(msg); + lu = (struct gsm48_loc_upd_req *) gh->data; + + gsm48_generate_lai(&lai, net->country_code, net->network_code, + msg->trx->bts->location_area_code); + + if (memcmp(&lai, &lu->lai, sizeof(lai)) != 0) { + LOGP(DMSC, LOGL_DEBUG, "Marking con for welcome USSD.\n"); + msg->lchan->msc_data->new_subscriber = 1; + } +} + /* Receive a GSM 04.08 Radio Resource (RR) message */ static int gsm0408_rcv_rr(struct msgb *msg) { @@ -589,6 +621,8 @@ static int gsm0408_rcv_mm(struct msgb *msg) case GSM48_MT_MM_CM_SERV_REQ: case GSM48_MT_MM_IMSI_DETACH_IND: rc = send_dtap_or_open_connection(msg); + if ((gh->msg_type & 0xbf) == GSM48_MT_MM_LOC_UPD_REQUEST) + handle_lu(msg); break; default: break; |