// Path: src/com/tt/reaper/rtcp/DataPacket.java
// public class DataPacket extends Message {
// 	private String sourceMacAddress;
// 	private String sourceIPAddress;
// 	private int sourcePort;
// 	private String destinationMacAddress;
// 	private String destinationIPAddress;
// 	private int destinationPort;
// 	private ArrayList<RtcpPacket> list = new ArrayList<RtcpPacket>();
// 	
// 	public DataPacket(byte[] content) {
// 		super(Message.DATA_PACKET);
// 		if (content == null)
// 			return;
//         String header = new String(content);
//         String[] fields = header.split(";");
//         if (fields.length < 6) {
//         	logger.error("Failed to parse content");
//         	return;
//         }
//     	sourceMacAddress = fields[0];
//     	sourceIPAddress = fields[1];
//     	sourcePort = Integer.parseInt(fields[2]);
//     	destinationMacAddress = fields[3];
//     	destinationIPAddress = fields[4];
//     	destinationPort = Integer.parseInt(fields[5]);
//         
//     	String encodedData = fields[6];
//         byte[] rtcpPacket = new byte[encodedData.length()/2];
//         int index = 0;
//         for (int j=0; j<rtcpPacket.length; j++)
//         	rtcpPacket[j] = (byte) Integer.parseInt("" + encodedData.charAt(index++) + encodedData.charAt(index++), 16);
// 
//         int offset = 0;
//         while (offset < rtcpPacket.length) {
//         	RtcpPacket packet = null;
//         	switch (RtcpPacket.probePacketType(rtcpPacket, offset)) {
//         	case RtcpPacket.TYPE_SENDER_REPORT:
//         		packet = new RtcpSenderReport(rtcpPacket, offset);
//         		break;
//         	case RtcpPacket.TYPE_RECEIVER_REPORT:
//         		packet = new RtcpReceiverReport(rtcpPacket, offset);
//         		break;
//         	case RtcpPacket.TYPE_SOURCE_DESCRIPTION:
//         		packet = new RtcpSourceDescription(rtcpPacket, offset);
//         		break;
//         	case RtcpPacket.TYPE_GOODBYE:
//         	case RtcpPacket.TYPE_APPLICATION_DEFINED:
//         		packet = new RtcpPacket(rtcpPacket, offset);
//         		break;
//         	case RtcpPacket.TYPE_EXTENDED_REPORT:
//         		packet = new RtcpExtendedReport(rtcpPacket, offset);
//         		break;
//         	default:
//         		logger.error("Unexpected packet type: " + RtcpPacket.probePacketType(rtcpPacket, offset));
//         		++offset;
//         	}
//         	if (packet == null)
//         		break;
//         	list.add(packet);
//         	offset += packet.getLength();
//         }
// 	}
// 
// 	public Iterator<RtcpPacket> getIterator() {
// 		return list.iterator();
// 	}
// 
// 	public String getSource() {
// 		return sourceIPAddress + ":" + sourcePort;
// 	}
// 	
// 	public String getDestination() {
// 		return destinationIPAddress + ":" + destinationPort;
// 	}
// 	
// 	public String toString() {
// 		return "DataPacket(" + getSource() + "," + getDestination() + ")";
// 	}
// 
// 	public String getSourceMac() {
// 		return sourceMacAddress;
// 	}
// 
// 	public String getDestinationMac() {
// 		return destinationMacAddress;
// 	}
// }
// 
// Path: src/com/tt/reaper/vq/LocalMetrics.java
// public class LocalMetrics extends Metrics {
// 	private static final String NAME = "LocalMetrics";
// 	
// 	LocalMetrics()
// 	{
// 		super(NAME);
// 	}
// 
// 	public LocalMetrics(CallContext context, AudioData data) {
// 		super(NAME, context, data);
// 	}
// }


import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import org.apache.log4j.Logger;
import com.tt.reaper.message.Message;
import com.tt.reaper.rtcp.DataPacket;
import com.tt.reaper.vq.LocalMetrics;
	{
		Iterator<AudioData> it;
		it = audioFrom.iterator();
		while (it.hasNext()) {
			AudioData data = it.next();
			if (data.equals(source))
				return data;
		}
		it = audioTo.iterator();
		while (it.hasNext()) {
			AudioData data = it.next();
			if (data.equals(destination))
				return data;
		}
		return null;
	}
	
	public AudioData getToAudio(String source, String destination)
	{
		Iterator<AudioData> it;
		it = audioTo.iterator();
		while (it.hasNext()) {
			AudioData data = it.next();
			if (data.equals(source))
				return data;
		}
		it = audioFrom.iterator();
		while (it.hasNext()) {
			AudioData data = it.next();
			if (data.equals(destination))
// Path: src/com/tt/reaper/rtcp/DataPacket.java
// public class DataPacket extends Message {
// 	private String sourceMacAddress;
// 	private String sourceIPAddress;
// 	private int sourcePort;
// 	private String destinationMacAddress;
// 	private String destinationIPAddress;
// 	private int destinationPort;
// 	private ArrayList<RtcpPacket> list = new ArrayList<RtcpPacket>();
// 	
// 	public DataPacket(byte[] content) {
// 		super(Message.DATA_PACKET);
// 		if (content == null)
// 			return;
//         String header = new String(content);
//         String[] fields = header.split(";");
//         if (fields.length < 6) {
//         	logger.error("Failed to parse content");
//         	return;
//         }
//     	sourceMacAddress = fields[0];
//     	sourceIPAddress = fields[1];
//     	sourcePort = Integer.parseInt(fields[2]);
//     	destinationMacAddress = fields[3];
//     	destinationIPAddress = fields[4];
//     	destinationPort = Integer.parseInt(fields[5]);
//         
//     	String encodedData = fields[6];
//         byte[] rtcpPacket = new byte[encodedData.length()/2];
//         int index = 0;
//         for (int j=0; j<rtcpPacket.length; j++)
//         	rtcpPacket[j] = (byte) Integer.parseInt("" + encodedData.charAt(index++) + encodedData.charAt(index++), 16);
// 
//         int offset = 0;
//         while (offset < rtcpPacket.length) {
//         	RtcpPacket packet = null;
//         	switch (RtcpPacket.probePacketType(rtcpPacket, offset)) {
//         	case RtcpPacket.TYPE_SENDER_REPORT:
//         		packet = new RtcpSenderReport(rtcpPacket, offset);
//         		break;
//         	case RtcpPacket.TYPE_RECEIVER_REPORT:
//         		packet = new RtcpReceiverReport(rtcpPacket, offset);
//         		break;
//         	case RtcpPacket.TYPE_SOURCE_DESCRIPTION:
//         		packet = new RtcpSourceDescription(rtcpPacket, offset);
//         		break;
//         	case RtcpPacket.TYPE_GOODBYE:
//         	case RtcpPacket.TYPE_APPLICATION_DEFINED:
//         		packet = new RtcpPacket(rtcpPacket, offset);
//         		break;
//         	case RtcpPacket.TYPE_EXTENDED_REPORT:
//         		packet = new RtcpExtendedReport(rtcpPacket, offset);
//         		break;
//         	default:
//         		logger.error("Unexpected packet type: " + RtcpPacket.probePacketType(rtcpPacket, offset));
//         		++offset;
//         	}
//         	if (packet == null)
//         		break;
//         	list.add(packet);
//         	offset += packet.getLength();
//         }
// 	}
// 
// 	public Iterator<RtcpPacket> getIterator() {
// 		return list.iterator();
// 	}
// 
// 	public String getSource() {
// 		return sourceIPAddress + ":" + sourcePort;
// 	}
// 	
// 	public String getDestination() {
// 		return destinationIPAddress + ":" + destinationPort;
// 	}
// 	
// 	public String toString() {
// 		return "DataPacket(" + getSource() + "," + getDestination() + ")";
// 	}
// 
// 	public String getSourceMac() {
// 		return sourceMacAddress;
// 	}
// 
// 	public String getDestinationMac() {
// 		return destinationMacAddress;
// 	}
// }
// 
// Path: src/com/tt/reaper/vq/LocalMetrics.java
// public class LocalMetrics extends Metrics {
// 	private static final String NAME = "LocalMetrics";
// 	
// 	LocalMetrics()
// 	{
// 		super(NAME);
// 	}
// 
// 	public LocalMetrics(CallContext context, AudioData data) {
// 		super(NAME, context, data);
// 	}
// }


// Path: src/com/tt/reaper/call/CallContext.java
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import org.apache.log4j.Logger;
import com.tt.reaper.message.Message;
import com.tt.reaper.rtcp.DataPacket;
import com.tt.reaper.vq.LocalMetrics;

	{
		Iterator<AudioData> it;
		it = audioFrom.iterator();
		while (it.hasNext()) {
			AudioData data = it.next();
			if (data.equals(source))
				return data;
		}
		it = audioTo.iterator();
		while (it.hasNext()) {
			AudioData data = it.next();
			if (data.equals(destination))
				return data;
		}
		return null;
	}
	
	public AudioData getToAudio(String source, String destination)
	{
		Iterator<AudioData> it;
		it = audioTo.iterator();
		while (it.hasNext()) {
			AudioData data = it.next();
			if (data.equals(source))
				return data;
		}
		it = audioFrom.iterator();
		while (it.hasNext()) {
			AudioData data = it.next();
			if (data.equals(destination))
				return data;