From bbd3c7cd46aca03cbf493f5998ada85fc74aa323 Mon Sep 17 00:00:00 2001 From: Ivan Kluchnikov Date: Fri, 15 Jan 2016 18:02:38 +0300 Subject: 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. --- openbsc/src/reg-proxy/sip.c | 8 ++++---- openbsc/src/reg-proxy/sup.c | 11 +++++++---- 2 files changed, 11 insertions(+), 8 deletions(-) (limited to 'openbsc/src') 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); } -- cgit v1.2.3