コード例 #1
0
    def start(self,user_obj,instance):
	"""
	    called when this rule starts for user_obj
	    
	    user_obj (User.User instance): object of user that this rule change for
	    instance (integer): instance number of user 
	"""
	ChargeRule.start(self,user_obj,instance)
	user_obj.charge_info.rule_start_inout[instance-1]=user_obj.getTypeObj().getInOutBytes(instance)

	if self.bandwidth_limit>0:
	    simple_bw_limit.applyLimitOnUser(user_obj,instance,self.bandwidth_limit)
	self.__applyBwLimit(user_obj,instance,"apply")
コード例 #2
0
    def start(self, user_obj, instance):
        """
            called when this rule starts for user_obj
            
            user_obj (User.User instance): object of user that this rule change for
            instance (integer): instance number of user 
        """
        ChargeRule.start(self, user_obj, instance)
        user_obj.charge_info.rule_start_inout[
            instance - 1] = user_obj.getTypeObj().getInOutBytes(instance)

        if self.bandwidth_limit > 0:
            simple_bw_limit.applyLimitOnUser(user_obj, instance,
                                             self.bandwidth_limit)
        self.__applyBwLimit(user_obj, instance, "apply")
コード例 #3
0
ファイル: voip_charge_rule.py プロジェクト: moxwose/freeIBS
    def start(self,user_obj,instance):
	"""
	    called when this rule starts for user_obj
	    
	    user_obj (User.User instance): object of user that this rule change for
	    instance (integer): instance number of user 
	"""
	ChargeRule.start(self,user_obj,instance)
	prefix_obj=self.getPrefixObj(user_obj,instance,False)
	user_obj.charge_info.prefix_id[instance-1]=prefix_obj.getPrefixID()
	if user_obj.charge_info.remaining_free_seconds[instance-1]==-1:#we're the first rule of this instance
	    user_obj.charge_info.remaining_free_seconds[instance-1]=prefix_obj.getFreeSeconds()
	    instance_info=user_obj.getInstanceInfo(instance)
	    instance_info["min_duration"]=prefix_obj.getMinDuration()
	    instance_info["attrs"]["prefix_name"]=prefix_obj.getPrefixName()
コード例 #4
0
ファイル: voip_charge_rule.py プロジェクト: sankopay/IBSng
 def start(self, user_obj, instance):
     """
         called when this rule starts for user_obj
         
         user_obj (User.User instance): object of user that this rule change for
         instance (integer): instance number of user 
     """
     ChargeRule.start(self, user_obj, instance)
     prefix_obj = self.getPrefixObj(user_obj, instance, False)
     user_obj.charge_info.prefix_id[instance - 1] = prefix_obj.getPrefixID()
     if user_obj.charge_info.remaining_free_seconds[
             instance - 1] == -1:  #we're the first rule of this instance
         user_obj.charge_info.remaining_free_seconds[
             instance - 1] = prefix_obj.getFreeSeconds()
         instance_info = user_obj.getInstanceInfo(instance)
         instance_info["min_duration"] = prefix_obj.getMinDuration()
         instance_info["attrs"]["prefix_name"] = prefix_obj.getPrefixName()