aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorIvan Kluchnikov <kluchnikovi@gmail.com>2016-01-15 18:02:38 +0300
committerIvan Kluchnikov <kluchnikovi@gmail.com>2017-02-07 18:59:55 +0300
commitbbd3c7cd46aca03cbf493f5998ada85fc74aa323 (patch)
tree81217e287cc2b886577b8595d76f2385ae5c3789 /openbsc
parent0a2a92a4f534ea978e21a2feb4ee1f072ed75db4 (diff)
reg-proxy: Implement handling LU responses without msisdn
If we receive 200 ok response with imsi instead of msisdn in sip contact header, we should send LU response message to osmo-nitb without msisdn.
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/src/reg-proxy/sip.c8
-rw-r--r--openbsc/src/reg-proxy/sup.c11
2 files changed, 11 insertions, 8 deletions
diff --git a/openbsc/src/reg-proxy/sip.c b/openbsc/src/reg-proxy/sip.c
index 7f74831da..1e9f256d2 100644
--- a/openbsc/src/reg-proxy/sip.c
+++ b/openbsc/src/reg-proxy/sip.c
@@ -253,13 +253,13 @@ void sip_cb_rcv2xx(int type, osip_transaction_t *tr, osip_message_t *sip_msg)
osip_to_t* to;
struct sip_client *sip_client = osip_transaction_get_your_instance(tr);
struct reg_proxy *reg = sip_client->data;
- char imsi[17];
- char msisdn[15];
+ char imsi[16];
+ char msisdn[16];
osip_message_get_contact(sip_msg, 0, &contact);
- memcpy(msisdn, contact->url->username, 15);
+ memcpy(msisdn, contact->url->username, 16);
to = osip_message_get_to(sip_msg);
- memcpy(imsi, to->url->username, 17);
+ memcpy(imsi, to->url->username, 16);
printf("OSIP_NICT_STATUS_2XX_RECEIVED imsi = %s \n", imsi);
printf("OSIP_NICT_STATUS_2XX_RECEIVED msisdn = %d \n", msisdn);
diff --git a/openbsc/src/reg-proxy/sup.c b/openbsc/src/reg-proxy/sup.c
index 4c2f8cbd6..e6092b6a1 100644
--- a/openbsc/src/reg-proxy/sup.c
+++ b/openbsc/src/reg-proxy/sup.c
@@ -344,10 +344,13 @@ int handle_location_update_result(struct gsm_sup_server *sup_server,
memcpy(gsup_msg.imsi, imsi, 17);
printf("handle_location_update_result %d len = %d 2\n", gsup_msg.msisdn_enc, strlen(msisdn));
- gsm48_encode_bcd_number(msisdn_enc, 9, 0, msisdn);
- gsup_msg.msisdn_enc = msisdn_enc + 1;
- gsup_msg.msisdn_enc_len = msisdn_enc[0];
- printf("handle_location_update_result %d %d\n", gsup_msg.msisdn_enc_len, gsup_msg.msisdn_enc);
+ if (strcmp(imsi, msisdn) != 0) {
+ gsm48_encode_bcd_number(msisdn_enc, 9, 0, msisdn);
+ gsup_msg.msisdn_enc = msisdn_enc + 1;
+ gsup_msg.msisdn_enc_len = msisdn_enc[0];
+ printf("handle_location_update_result %d %d\n", gsup_msg.msisdn_enc_len, gsup_msg.msisdn_enc);
+ }
+
return tx_sup_message(sup_server, &gsup_msg);
}