anchor.diff:  			throw(undefined_tariff)
   	end;
   rate3(Protocol, Service, Product, Buckets, _Address,
  -		Price, Flag, DebitAmounts, ReserveAmounts, State, ChargingKey) ->
  +		Price, Flag, DebitAmounts, ReserveAmounts, State, ChargingKey, _ServiceNetwork) ->
   	charge(Protocol, Product, Service, Buckets, Price,
   			Flag, DebitAmounts, ReserveAmounts, State, ChargingKey).
   %% @hidden
   rate4(Protocol, Service, Product, Buckets,
   		#price{type = tariff} = Price, Flag, DebitAmounts, ReserveAmounts,
  -		#state{roaming_tb_prefix = RoamingTable, service_network = ServiceNetwork,
  -		rated = Rated} = State, ChargingKey)
  +		#state{roaming_tb_prefix = RoamingTable, 
  +		rated = Rated} = State, ChargingKey, ServiceNetwork)
   		when is_list(RoamingTable), is_list(ServiceNetwork) ->
   	Table = list_to_existing_atom(RoamingTable),
   	case catch ocs_gtt:lookup_last(Table, ServiceNetwork) of
  
positive.code: 					((ServiceType == ?DIAMETERSMS) and ((Spec == "10") orelse (Spec == "11"))))) ->
  			rate2(Protocol, Service, Product, Buckets, Timestamp, Address,
  					Direction, Offer, Flag, DebitAmounts, ReserveAmounts,
  					State#state{rated = #rated{product = OfferName}}, ChargingKey);
  		_ ->
  			throw(invalid_service_type)
  	end.
  rate2(Protocol, Service, Product, Buckets, Timestamp, Address, Direction,
  		#offer{specification = ProdSpec, price = Prices} = _Offer,
  		Flag, DebitAmounts, ReserveAmounts, State, ChargingKey)
  		when ProdSpec == "10"; ProdSpec == "11" ->
  	F = fun(#price{type = usage, units = messages}) ->
  				true;
  
negative.code: %% @hidden
  rate1(Protocol, Service, Product, Buckets, Timestamp, Address, Direction,
  		#offer{specification = undefined, bundle = Bundle}, Flag,
  		DebitAmounts, ReserveAmounts, ServiceType, State, ChargingKey, ServiceNetwork) ->
  	try
  		F = fun(#bundled_po{name = OfferId}, Acc) ->
  				case mnesia:read(offer, OfferId, read) of
  