mirror of
https://github.com/RangeNetworks/openbts.git
synced 2025-11-10 00:25:37 +00:00
Fixes #693 in public. Basically, refactoring to force all SR messages through the SR class. Also fixed a memory leak in the SR itself.
git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@3163 19bc5d8c-e614-43d4-8b26-e1612bc8e597
This commit is contained in:
@@ -207,20 +207,20 @@ void Control::LocationUpdatingController(const L3LocationUpdatingRequest* lur, L
|
||||
}
|
||||
|
||||
//query subscriber registry for old imei, update if neccessary
|
||||
char* old_imei;
|
||||
string name = string("IMSI") + IMSI;
|
||||
sqlite3_single_lookup(gSubscriberRegistry.db(), "sip_buddies", "name", name.c_str(),
|
||||
"hardware", old_imei);
|
||||
char* old_imei = gSubscriberRegistry.sqlQuery("hardware", "sip_buddies", "name", name.c_str());
|
||||
|
||||
//if we have a new imei and either there's no old one, or it is different...
|
||||
if (new_imei && (!old_imei || strncmp(old_imei,new_imei, 15) != 0)){
|
||||
ostringstream os2;
|
||||
os2 << "update sip_buddies set RRLPSupported = \"1\", hardware = \"" << new_imei << "\" where name = \"IMSI" << IMSI << "\"";
|
||||
LOG(INFO) << "Updating IMSI" << IMSI << " to IMEI:" << new_imei;
|
||||
if (!sqlite3_command(gSubscriberRegistry.db(), os2.str().c_str())) {
|
||||
LOG(INFO) << "sqlite3_command problem";
|
||||
if (!gSubscriberRegistry.sqlUpdate(os2.str().c_str())) {
|
||||
LOG(INFO) << "SR update problem";
|
||||
}
|
||||
}
|
||||
if (old_imei)
|
||||
free(old_imei);
|
||||
delete msg;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user