From 91fa850791c86d9645529fe4069c2f9b79e65f34 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Thu, 10 Feb 2011 11:46:51 +0100 Subject: nat: If the number starts with 00 turn it into a international number Switch the type to international and skip the '00' of the phone number. This should fix some issues with gateway MSCs. --- openbsc/src/nat/bsc_nat_utils.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'openbsc') diff --git a/openbsc/src/nat/bsc_nat_utils.c b/openbsc/src/nat/bsc_nat_utils.c index b43d67a83..7b75fa56d 100644 --- a/openbsc/src/nat/bsc_nat_utils.c +++ b/openbsc/src/nat/bsc_nat_utils.c @@ -848,7 +848,12 @@ struct msgb *bsc_nat_rewrite_setup(struct bsc_nat *nat, struct msgb *msg, struct memcpy(outptr, &hdr48->data[0], sec_len); /* create the new number */ - strncpy(called.number, new_number, sizeof(called.number)); + if (strncmp(new_number, "00", 2) == 0) { + called.type = 1; + strncpy(called.number, new_number + 2, sizeof(called.number)); + } else { + strncpy(called.number, new_number, sizeof(called.number)); + } gsm48_encode_called(out, &called); /* copy thre rest */ -- cgit v1.2.3