From 9e12a2d14b968624d6c552a26d60a03c93b2af5d Mon Sep 17 00:00:00 2001 From: gardners Date: Tue, 9 Aug 2011 14:20:25 +0800 Subject: [PATCH] Fixed exporting of HLR records (but not usage message). Fixed seeding of hlr to include location as well as DID. --- hlrdata.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hlrdata.c b/hlrdata.c index f92dd826..ddf742e4 100644 --- a/hlrdata.c +++ b/hlrdata.c @@ -41,7 +41,7 @@ int seedHlr() by allowing the use of createHlr(). */ { - int i; + int i,ofs=0; char sid[65]; char did[65]; /* Make DID start with 2 through 9, as 1 is special in many number spaces. */ @@ -49,6 +49,7 @@ int seedHlr() /* Then add 10 more digits, which is what we do in the mobile phone software */ for(i=1;i<11;i++) did[i]='0'+random()%10; did[11]=0; if (createHlr(did,sid)) return WHY("Failed to seed HLR with home entry"); + if (hlrSetVariable(hlr,ofs,VAR_LOCATIONS,0,(unsigned char *)"4000",4)) return WHY("Could not set location while seeding HLR"); } return 0; } @@ -154,7 +155,8 @@ int findHlr(unsigned char *hlr,int *ofs,char *sid,char *did) h=hlrentrygetent(h); } } - + if ((!sid)&&(!did)) match=1; + /* For each match ... */ if (match) {