aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/nat/bsc_nat_utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'openbsc/src/nat/bsc_nat_utils.c')
-rw-r--r--openbsc/src/nat/bsc_nat_utils.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/openbsc/src/nat/bsc_nat_utils.c b/openbsc/src/nat/bsc_nat_utils.c
index b43d67a8..7b75fa56 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 */