# Path: model/models.py
# def bind_session(connection_string, echo=False):
# class Measure(Base):
# class Settings(Base):
# 
# Path: model/hlr.py
# def bind_session(connection_string, echo=False):
# def user_data_decode(user_data, data_coding_scheme, ud_hdr_ind):
# def create_sms(src_addr, dest_addr, text, charset=None):
# class Subscriber(Base):
# class Sms(Base):


import os
import time
import Queue
import urllib
import socket
import datetime
import threading
import telnetlib
import transaction
import ConfigParser
import logging_utils
from SimpleXMLRPCServer import SimpleXMLRPCServer
from SimpleXMLRPCServer import SimpleXMLRPCRequestHandler
from sqlalchemy import func
from model.models import (
    bind_session,
    DBSession,
    Measure,
    Settings,
)
from model.hlr import (
    bind_session as bind_hlr_session,
    HLRDBSession,
    Subscriber,
    Sms,
    create_sms
)


        self.pf_phone_number = pf_subscriber_extension
        self.pf_subscriber_imsi = pf_subscriber_imsi
        self.measure_update_period = 3

        bind_session(self.pf_db_conn_str)
        bind_hlr_session(self.hlr_db_conn_str)

        self.vty_use_send_sms_rlock = threading.RLock()

    def serve_forever(self):
        self.try_run_xmlrpc_server()
        self.try_run_vty_client()

        self.proc_measure_thread = threading.Thread(target=self.process_measure_worker)
        self.proc_measure_thread.daemon = True
        self.proc_measure_thread.start()

        self.proc_unknow_adress_sms_thread = threading.Thread(target=self.process_unknown_adress_sms_worker)
        self.proc_unknow_adress_sms_thread.daemon = True
        self.proc_unknow_adress_sms_thread.start()

        while not self.time_to_shutdown_event.is_set():
            if self.vty_client_connection is None:
                self.try_run_vty_client()

            time.sleep(0.1)

    def start_new_session(self):
        with transaction.manager:

# Path: model/models.py
# def bind_session(connection_string, echo=False):
# class Measure(Base):
# class Settings(Base):
# 
# Path: model/hlr.py
# def bind_session(connection_string, echo=False):
# def user_data_decode(user_data, data_coding_scheme, ud_hdr_ind):
# def create_sms(src_addr, dest_addr, text, charset=None):
# class Subscriber(Base):
# class Sms(Base):


# Path: com_interface/comms_interface_server.py
import os
import time
import Queue
import urllib
import socket
import datetime
import threading
import telnetlib
import transaction
import ConfigParser
import logging_utils
from SimpleXMLRPCServer import SimpleXMLRPCServer
from SimpleXMLRPCServer import SimpleXMLRPCRequestHandler
from sqlalchemy import func
from model.models import (
    bind_session,
    DBSession,
    Measure,
    Settings,
)
from model.hlr import (
    bind_session as bind_hlr_session,
    HLRDBSession,
    Subscriber,
    Sms,
    create_sms
)


        self.pf_phone_number = pf_subscriber_extension
        self.pf_subscriber_imsi = pf_subscriber_imsi
        self.measure_update_period = 3

        bind_session(self.pf_db_conn_str)
        bind_hlr_session(self.hlr_db_conn_str)

        self.vty_use_send_sms_rlock = threading.RLock()

    def serve_forever(self):
        self.try_run_xmlrpc_server()
        self.try_run_vty_client()

        self.proc_measure_thread = threading.Thread(target=self.process_measure_worker)
        self.proc_measure_thread.daemon = True
        self.proc_measure_thread.start()

        self.proc_unknow_adress_sms_thread = threading.Thread(target=self.process_unknown_adress_sms_worker)
        self.proc_unknow_adress_sms_thread.daemon = True
        self.proc_unknow_adress_sms_thread.start()

        while not self.time_to_shutdown_event.is_set():
            if self.vty_client_connection is None:
                self.try_run_vty_client()

            time.sleep(0.1)

    def start_new_session(self):
        with transaction.manager:

            DBSession.query(Measure).delete()
