bug-fix: welcome message not being sent to customer whom return from roaming
This commit is contained in:
parent
e501046864
commit
6f15ea9bd5
|
@ -65,12 +65,12 @@ class SubscriberMonitor(threading.Thread):
|
||||||
time.sleep(60)
|
time.sleep(60)
|
||||||
def stop(self):
|
def stop(self):
|
||||||
self.active = False
|
self.active = False
|
||||||
|
self.active_subscribers = collections.defaultdict()
|
||||||
self.disconnect_from_db()
|
self.disconnect_from_db()
|
||||||
|
|
||||||
def restart(self):
|
def restart(self):
|
||||||
self.active_subscribers = collections.defaultdict()
|
self.stop()
|
||||||
self.active = True
|
self.active = True
|
||||||
self.disconnect_from_db()
|
|
||||||
self.connect_to_db()
|
self.connect_to_db()
|
||||||
|
|
||||||
def get_active_subs(self):
|
def get_active_subs(self):
|
||||||
|
@ -85,8 +85,7 @@ class SubscriberMonitor(threading.Thread):
|
||||||
def check_new_subs(self):
|
def check_new_subs(self):
|
||||||
# authorized=1 checks for authorized subscribers
|
# authorized=1 checks for authorized subscribers
|
||||||
# updated>datetime(...) checks for updates in the last minute
|
# updated>datetime(...) checks for updates in the last minute
|
||||||
# lac checks that the phone is active
|
# lac value greater than 0 indicate the phone is active
|
||||||
# TODO: currently ASSUMED that one LAC is used, if two are used this condition might not always work, check later...
|
|
||||||
#sqlIndex = [0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 ]
|
#sqlIndex = [0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 ]
|
||||||
#sqlValue = (id, created, updated, imsi, name, extension, authorized, tmsi, lac, expire_lu)
|
#sqlValue = (id, created, updated, imsi, name, extension, authorized, tmsi, lac, expire_lu)
|
||||||
|
|
||||||
|
@ -109,7 +108,7 @@ class SubscriberMonitor(threading.Thread):
|
||||||
diff = updated-expected
|
diff = updated-expected
|
||||||
if diff > timedelta(hours=1):
|
if diff > timedelta(hours=1):
|
||||||
# returning subscriber (roaming/out-of-range/?)
|
# returning subscriber (roaming/out-of-range/?)
|
||||||
self.bsc_conn.send_welcome_sms(subscriber[5])
|
self.bsc_conn.send_welcome_sms(self.provider, subscriber[5])
|
||||||
self.bsc_conn.close()
|
self.bsc_conn.close()
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
Reference in New Issue