action="store_true", help="Display full message text") parser.add_option("-d", "--debug", dest="debug", action="store_true", help="Show Debug Output (otherwise fairly quiet)") (options, args) = parser.parse_args() OsmoSmsQ.sq_hlr_path = cn.sq_hlr_path OsmoSmsQ.log = cn.sms_log sms_log = cn.sms_log numbering = cn.Numbering() subs = cn.Subscriber() sms = cn.SMS() if options.debug: sms_log.setLevel('DEBUG') def smpp_sumbit(src, dest, utext, bts, report=False): global _sent def _smpp_rx_submit_resp(pdu): global _sent sms_log.info("Sent (%s)", pdu.message_id) if pdu.command == "submit_sm_resp": _sent = pdu.status try:
bts = num.get_local_hlr_btsinfo(extension) except config.NumberingException as ne: print str(ne) return print "That is from %s last seen %s" % (bts['home_bts'], bts['current_bts']) def smpp_bind(): client = smpplib.client.Client("127.0.0.1", 2775, 90) client.set_message_received_handler(rx_alert_notification) client.connect() client.bind_transceiver(system_id="NOTIFY", password="******") client.listen() if __name__ == "__main__": re = config.re sys = config.sys riak_client = config.riak_client myprefix = config.config['internal_prefix'] myip = config.config['local_ip'] log = config.roaming_log sub = config.Subscriber() num = config.Numbering() sms = config.SMS() log.info('Starting up alert notification listener for %s on %s' % (myprefix, myip)) smpp_bind()