Code Duplication    Length = 8-9 lines in 2 locations

freeswitch/fs/lib/astpp.cdr.php 2 locations

@@ 102-110 (lines=9) @@
99
	}
100
101
	//Check if cusotmer have any package seconds left to use
102
	if ($actual_duration > 0)			
103
	{
104
			$package_array = package_calculation( $dataVariable['effective_destination_number'],$origination_rate[$accountid]['RATEGROUP'],$actual_duration,$dataVariable['call_direction'],$accountid,$db,$logger);
105
			if(!empty($package_array))
106
			{
107
				$dataVariable['calltype'] = "FREE";
108
				$dataVariable['package_id']= $package_array['package_id'];
109
			}
110
	}
111
	
112
	//Calculate debit of customer call 			
113
	$debit = calc_cost($dataVariable,$origination_rate[$accountid],$logger,$decimal_points);
@@ 217-224 (lines=8) @@
214
        }*/
215
216
		//Check if reseller have any package seconds left to use        
217
		if ($actual_duration > 0)		{
218
			$package_array = package_calculation( $dataVariable['effective_destination_number'],$origination_rate[$accountid]['RATEGROUP'],$actual_duration,$dataVariable['call_direction'],$accountid,$db,$logger);
219
			if(!empty($package_array))
220
			{
221
				$dataVariable['calltype'] = "FREE";
222
				$dataVariable['package_id']= $package_array['package_id'];
223
			}
224
		}	
225
226
		//Get parent id for cost calculation 
227
		$parentid = $carddata['reseller_id'];