From 20de3ae17cbb61f831ca8f06a4cf7436441cfdc6 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Tue, 5 May 2015 22:52:40 +0200 Subject: sgsn: Extract the MSISDN from the subscr data structure In case there is a subscr attached to the MM context and there is an encoded MSISDN we will attempt to decode it and in case of an international number prepend a '+'. Assume that the array size of gsm_mmcc_called->number is as big as ctx->msisdn for the strncpy. --- openbsc/tests/sgsn/sgsn_test.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'openbsc/tests') diff --git a/openbsc/tests/sgsn/sgsn_test.c b/openbsc/tests/sgsn/sgsn_test.c index d9b162dc2..879dfe36e 100644 --- a/openbsc/tests/sgsn/sgsn_test.c +++ b/openbsc/tests/sgsn/sgsn_test.c @@ -953,6 +953,8 @@ retry_attach_req: /* check that the MM context has not been removed due to a * failed authorization */ OSMO_ASSERT(ctx == sgsn_mm_ctx_by_tlli(foreign_tlli, &raid)); + if (ctx->subscr && ctx->subscr->sgsn_data->msisdn_len > 0) + OSMO_ASSERT(strcmp(ctx->msisdn, "+49166213323") == 0); } if (retry && sgsn_tx_counter == 0) @@ -1151,6 +1153,8 @@ int my_subscr_request_update_gsup_auth(struct sgsn_mm_ctx *mmctx) { 0x10, 0x01, 0x01, 0x11, 0x02, 0xf1, 0x21, /* IPv4 */ 0x12, 0x09, 0x04, 't', 'e', 's', 't', 0x03, 'a', 'p', 'n', + 0x08, 0x07, /* MSISDN 49166213323 encoded */ + 0x91, 0x94, 0x61, 0x26, 0x31, 0x23, 0xF3, }; OSMO_ASSERT(!mmctx || mmctx->subscr); -- cgit v1.2.3