def bill(self, to, from_): syslog.syslog("VBTS " + to + " " + from_) try: tariff = vbts_credit.sms_cost(self.tariff_type) username = vbts_util.messenger.SR_dialdata_get("dial", ("exten", to)) if (username and username != ""): vbts_credit.deduct(tariff, username, "Incoming SMS from %s to %s at %s" % (from_, to, self.tariff_type)) except Exception as e: syslog.syslog("VBTS " + traceback.format_exc(e))
def bill(self, to, from_): syslog.syslog("VBTS " + to + " " + from_) try: tariff = vbts_credit.sms_cost(self.tariff_type) username = vbts_util.messenger.SR_dialdata_get( "dial", ("exten", to)) if (username and username != ""): vbts_credit.deduct( tariff, username, "Incoming SMS from %s to %s at %s" % (from_, to, self.tariff_type)) except Exception as e: syslog.syslog("VBTS " + traceback.format_exc(e))
def process_smscdr(self, from_, service_type, dest): cost_in_credits = vbts_credit.sms_cost(service_type) vbts_credit.deduct(int(cost_in_credits), from_, "SMS sent to %s at %s" % (dest, service_type))