anchor.diff:  			'CC-Request-Type' = ?'3GPP_CC-REQUEST-TYPE_INITIAL_REQUEST',
   			'CC-Request-Number' = 0} = Answer1.
   
  +diameter_voice_out() ->
  +	[{userdata, [{doc, "DIAMETER SCUR for outgoing voice call"}]}].
  +
  +diameter_voice_out(_Config) ->
  +	Units = 6,
  +	P1 = price(usage, seconds, Units, rand:uniform(1000000)),
  +	Incoming = #char_value{value = "answer"},
  +	CallDirection1 = #char_value_use{name = "callDirection",
  +			specification = "5", values = [Incoming]},
  +	P2 = P1#price{char_value_use = [CallDirection1]},
  +	P3 = price(usage, seconds, Units, rand:uniform(1000000)),
  +	Outgoing = #char_value{value = "originate"},
  +	CallDirection2 = #char_value_use{name = "callDirection",
  +			specification = "5", values = [Outgoing]},
  +	P4 = P3#price{char_value_use = [CallDirection2]},
  +	OfferId = add_offer([P2, P4], 9),
  +	ProdRef = add_product(OfferId),
  +	MSISDN = list_to_binary(ocs:generate_identity()),
  +	{ok, #service{}} = ocs:add_service(MSISDN, undefined, ProdRef, []),
  +	Balance1 = rand:uniform(1000000000),
  +	B1 = bucket(seconds, Balance1),
  +	B1ref = add_bucket(ProdRef, B1),
  +	Ref = erlang:ref_to_list(make_ref()),
  +	SId = diameter:session_id(Ref),
  +	SubscriptionId = #'3gpp_ro_Subscription-Id'{
  +			'Subscription-Id-Type' = ?'3GPP_RO_SUBSCRIPTION-ID-TYPE_END_USER_E164',
  +			'Subscription-Id-Data' = MSISDN},
  +	RSU = #'3gpp_ro_Requested-Service-Unit' {},
  +	MSCC1 = #'3gpp_ro_Multiple-Services-Credit-Control'{
  +			'Requested-Service-Unit' = [RSU]},
  +	CallingPartyAddress = "tel:+" ++ ocs:generate_identity(),
  +	CalledPartyAddress = "tel:+" ++ ocs:generate_identity(),
  +	ServiceInformation = #'3gpp_ro_Service-Information'{'IMS-Information' =
  +			[#'3gpp_ro_IMS-Information'{
  +					'Node-Functionality' = ?'3GPP_RO_NODE-FUNCTIONALITY_AS',
  +					'Role-Of-Node' = [?'3GPP_RO_ROLE-OF-NODE_ORIGINATING_ROLE'],
  +					'Calling-Party-Address' = [CallingPartyAddress],
  +					'Called-Party-Address' = [CalledPartyAddress]}]},
  +	CCR1 = #'3gpp_ro_CCR'{'Session-Id' = SId,
  +			'Auth-Application-Id' = ?RO_APPLICATION_ID,
  +			'Service-Context-Id' = "32260@3gpp.org",
  +			'User-Name' = [MSISDN],
  +			'CC-Request-Type' = ?'3GPP_RO_CC-REQUEST-TYPE_INITIAL_REQUEST',
  +			'CC-Request-Number' = 0,
  +			'Event-Timestamp' = [calendar:universal_time()],
  +			'Subscription-Id' = [SubscriptionId],
  +			'Multiple-Services-Credit-Control' = [MSCC1],
  +			'Service-Information' = [ServiceInformation]},
  +	{ok, Answer1} = diameter:call(?MODULE, cc_app_test, CCR1, []),
  +	#'3gpp_ro_CCA'{'Result-Code' = ?'DIAMETER_BASE_RESULT-CODE_SUCCESS',
  +			'Auth-Application-Id' = ?RO_APPLICATION_ID,
  +			'CC-Request-Type' = ?'3GPP_CC-REQUEST-TYPE_INITIAL_REQUEST',
  +			'CC-Request-Number' = RequestNum,
  +			'Multiple-Services-Credit-Control' = [MSCC2]} = Answer1,
  +	#'3gpp_ro_Multiple-Services-Credit-Control'{
  +			'Granted-Service-Unit' = [GSU]} = MSCC2,
  +	#'3gpp_ro_Granted-Service-Unit'{'CC-Time' = [GrantedUnits]} = GSU,
  +	NewRequestNum = RequestNum + 1,
  +	UsedUnits = rand:uniform(GrantedUnits),
  +	USU = #'3gpp_ro_Used-Service-Unit'{'CC-Time' = [UsedUnits]},
  +	MSCC3 = #'3gpp_ro_Multiple-Services-Credit-Control'{
  +			'Used-Service-Unit' = [USU]},
  +	CCR2 = CCR1#'3gpp_ro_CCR'{'Session-Id' = SId,
  +			'CC-Request-Type' = ?'3GPP_CC-REQUEST-TYPE_TERMINATION_REQUEST',
  +			'CC-Request-Number' = NewRequestNum,
  +			'Multiple-Services-Credit-Control' = [MSCC3],
  +			'Event-Timestamp' = [calendar:universal_time()]},
  +	{ok, Answer2} = diameter:call(?MODULE, cc_app_test, CCR2, []),
  +	#'3gpp_ro_CCA'{'Result-Code' = ?'DIAMETER_BASE_RESULT-CODE_SUCCESS',
  +			'Auth-Application-Id' = ?RO_APPLICATION_ID,
  +			'CC-Request-Type' = ?'3GPP_RO_CC-REQUEST-TYPE_TERMINATION_REQUEST',
  +			'CC-Request-Number' = NewRequestNum} = Answer2,
  +	ChargedUnits = case UsedUnits rem 6 of
  +		0 ->
  +			UsedUnits;
  +		N ->
  +			UsedUnits + (6 - N)
  +	end,
  +	Balance2 = Balance1 - ChargedUnits,
  +	{ok, #bucket{remain_amount = Balance2}} = ocs:find_bucket(B1ref).
  +
  +diameter_voice_in() ->
  +	[{userdata, [{doc, "DIAMETER SCUR for answered voice call"}]}].
  +
  +diameter_voice_in(_Config) ->
  +	Units = 6,
  +	P1 = price(usage, seconds, Units, rand:uniform(1000000)),
  +	Incoming = #char_value{value = "answer"},
  +	CallDirection1 = #char_value_use{name = "callDirection",
  +			specification = "5", values = [Incoming]},
  +	P2 = P1#price{char_value_use = [CallDirection1]},
  +	P3 = price(usage, seconds, Units, rand:uniform(1000000)),
  +	Outgoing = #char_value{value = "originate"},
  +	CallDirection2 = #char_value_use{name = "callDirection",
  +			specification = "5", values = [Outgoing]},
  +	P4 = P3#price{char_value_use = [CallDirection2]},
  +	OfferId = add_offer([P2, P4], 9),
  +	ProdRef = add_product(OfferId),
  +	MSISDN = list_to_binary(ocs:generate_identity()),
  +	{ok, #service{}} = ocs:add_service(MSISDN, undefined, ProdRef, []),
  +	Balance1 = rand:uniform(1000000000),
  +	B1 = bucket(seconds, Balance1),
  +	B1ref = add_bucket(ProdRef, B1),
  +	Ref = erlang:ref_to_list(make_ref()),
  +	SId = diameter:session_id(Ref),
  +	SubscriptionId = #'3gpp_ro_Subscription-Id'{
  +			'Subscription-Id-Type' = ?'3GPP_RO_SUBSCRIPTION-ID-TYPE_END_USER_E164',
  +			'Subscription-Id-Data' = MSISDN},
  +	RSU = #'3gpp_ro_Requested-Service-Unit' {},
  +	MSCC1 = #'3gpp_ro_Multiple-Services-Credit-Control'{
  +			'Requested-Service-Unit' = [RSU]},
  +	CallingPartyAddress = "tel:+" ++ ocs:generate_identity(),
  +	CalledPartyAddress = "tel:+" ++ ocs:generate_identity(),
  +	ServiceInformation = #'3gpp_ro_Service-Information'{'IMS-Information' =
  +			[#'3gpp_ro_IMS-Information'{
  +					'Node-Functionality' = ?'3GPP_RO_NODE-FUNCTIONALITY_AS',
  +					'Role-Of-Node' = [?'3GPP_RO_ROLE-OF-NODE_TERMINATING_ROLE'],
  +					'Calling-Party-Address' = [CallingPartyAddress],
  +					'Called-Party-Address' = [CalledPartyAddress]}]},
  +	CCR1 = #'3gpp_ro_CCR'{'Session-Id' = SId,
  +			'Auth-Application-Id' = ?RO_APPLICATION_ID,
  +			'Service-Context-Id' = "32260@3gpp.org",
  +			'User-Name' = [MSISDN],
  +			'CC-Request-Type' = ?'3GPP_RO_CC-REQUEST-TYPE_INITIAL_REQUEST',
  +			'CC-Request-Number' = 0,
  +			'Event-Timestamp' = [calendar:universal_time()],
  +			'Subscription-Id' = [SubscriptionId],
  +			'Multiple-Services-Credit-Control' = [MSCC1],
  +			'Service-Information' = [ServiceInformation]},
  +	{ok, Answer1} = diameter:call(?MODULE, cc_app_test, CCR1, []),
  +	#'3gpp_ro_CCA'{'Result-Code' = ?'DIAMETER_BASE_RESULT-CODE_SUCCESS',
  +			'Auth-Application-Id' = ?RO_APPLICATION_ID,
  +			'CC-Request-Type' = ?'3GPP_CC-REQUEST-TYPE_INITIAL_REQUEST',
  +			'CC-Request-Number' = RequestNum,
  +			'Multiple-Services-Credit-Control' = [MSCC2]} = Answer1,
  +	#'3gpp_ro_Multiple-Services-Credit-Control'{
  +			'Granted-Service-Unit' = [GSU]} = MSCC2,
  +	#'3gpp_ro_Granted-Service-Unit'{'CC-Time' = [GrantedUnits]} = GSU,
  +	NewRequestNum = RequestNum + 1,
  +	UsedUnits = rand:uniform(GrantedUnits),
  +	USU = #'3gpp_ro_Used-Service-Unit'{'CC-Time' = [UsedUnits]},
  +	MSCC3 = #'3gpp_ro_Multiple-Services-Credit-Control'{
  +			'Used-Service-Unit' = [USU]},
  +	CCR2 = CCR1#'3gpp_ro_CCR'{'Session-Id' = SId,
  +			'CC-Request-Type' = ?'3GPP_CC-REQUEST-TYPE_TERMINATION_REQUEST',
  +			'CC-Request-Number' = NewRequestNum,
  +			'Multiple-Services-Credit-Control' = [MSCC3],
  +			'Event-Timestamp' = [calendar:universal_time()]},
  +	{ok, Answer2} = diameter:call(?MODULE, cc_app_test, CCR2, []),
  +	#'3gpp_ro_CCA'{'Result-Code' = ?'DIAMETER_BASE_RESULT-CODE_SUCCESS',
  +			'Auth-Application-Id' = ?RO_APPLICATION_ID,
  +			'CC-Request-Type' = ?'3GPP_RO_CC-REQUEST-TYPE_TERMINATION_REQUEST',
  +			'CC-Request-Number' = NewRequestNum} = Answer2,
  +	ChargedUnits = case UsedUnits rem 6 of
  +		0 ->
  +			UsedUnits;
  +		N ->
  +			UsedUnits + (6 - N)
  +	end,
  +	Balance2 = Balance1 - ChargedUnits,
  +	{ok, #bucket{remain_amount = Balance2}} = ocs:find_bucket(B1ref).
  +
   %%---------------------------------------------------------------------
   %%  Internal functions
   %%---------------------------------------------------------------------
  
positive.code: 	radius_multisession_disallowed, radius_multisession,
  	diameter_scur, diameter_scur_cud,
  	diameter_scur_no_credit, diameter_scur_depletion,
  	diameter_ecur, diameter_ecur_no_credit].
  
  %%---------------------------------------------------------------------
  %%  Test cases
  
negative.code: 		TestCase == diameter_scur_no_credit;
  		TestCase == diameter_scur_depletion;
  		TestCase == diameter_ecur;
  		TestCase == diameter_ecur_no_credit;
  		TestCase == diameter_voice_out;
  		TestCase == diameter_voice_in ->
  	Address = ?config(diameter_acct_address, Config),
  	ok = ocs:delete_client(Address).
  
  