I use JMF RTP Manager to send and receive audio streams... File1 captures audio device and gets a DataSource from it and it listens for Audio Stream coming from another system. After receiving audio stream from another system it mixes up the captured audio and received audio together. Then it transmits the resulting DataSource to another system and plays it using Player.
File2 captures audio device and gets a DataSource from it. Then it transmits the DataSource captured and it listens for Audio Stream. After receiving it just plays it.

Run file1 in one system and file2 in another system...

PROBLEM:
Now the problem i get is that the system in which i run File1 executes well... plays the mixed audio well.. But the another system in which i run file2 doesnot plays.. it displays upto "in receive stream evt.." but it never displays "receiver thread started.."
//FILE1
/**
*
* @author Sathishkumar
*
*/
import java.util.*;
import javax.media.*;
import javax.media.protocol.*;
import javax.media.bean.playerbean.MediaPlayer;
import javax.media.format.*;
import java.net.*;
import java.util.StringTokenizer;
import java.util.Vector;
import javax.media.rtp.*;
import javax.media.rtp.event.*;
/*this class is used to add, removes the peers to the mixer and receive voice from all the peers and mix it and send to the all the peers*/

public class Mixing implements SessionListener,ReceiveStreamListener
{
public static Processor audioProcessor,audioProcessor1;
public static String mixer_ip;
DataSource dataSource ;
DataSource processedAudioSource,processedAudioSource1;
DataSource audioInputSource,audioInputSource1;
public static RTPManager srcMgrs;
Object[] sources;
List dataSources;
public static SessionAddress srclocalAddr;
public Mixing()
{
try
{
dataSources= new ArrayList();
if(srcMgrs==null)
{
System.out.println("CHILD NODES");
srcMgrs = (RTPManager) RTPManager.newInstance();
srclocalAddr= new SessionAddress( InetAddress.getByName(InetAddress.getLocalHost().g etHostName()), 3000);
srcMgrs.initialize( srclocalAddr);
srcMgrs.addTarget("HOST NAME of another sstm",3000);
srcMgrs.addReceiveStreamListener(this);
srcMgrs.addSessionListener(this);
System.out.println("initiated listeners........");

}

process();

}
catch(Exception e)
{
System.out.println("Error in Mixing Add Child Nodes11");
System.out.println("Error"+e);
}

}


public synchronized void update(SessionEvent evt)
{
try
{
System.out.println("Come inside Session event");
}
catch(Exception e)
{
System.out.println("Error in Session");
System.out.println("Error"+e);
}
}

public void process()
{
try
{
Vector info = CaptureDeviceManager.getDeviceList(null);
if (info == null)
System.out.println("No Capture devices known to JMF");
else
{
CaptureDeviceInfo deviceInfo = (CaptureDeviceInfo)info.elementAt(0);
MediaLocator locator=deviceInfo.getLocator();
System.out.println("Got Locator:"+locator);
audioInputSource=Manager.createDataSource(locator) ;
System.out.println("started to capture........");
System.out.println("Mixing Configuration in Process");
Format []formats=new Format[1];
formats[0]=new AudioFormat(AudioFormat.GSM_RTP,8000,16,1);
audioProcessor =Manager.createRealizedProcessor(new ProcessorModel(audioInputSource,formats,new FileTypeDescriptor(FileTypeDescriptor.RAW)));
processedAudioSource = audioProcessor.getDataOutput();
dataSources.add(processedAudioSource);
audioProcessor.start();
System.out.println("Transfering to peers");

}
catch(Exception e)
{
System.out.println("Error in Mixing Process");
System.out.println("Error"+e);
}

}


public static void main(String [] ar)
{
Mixing m=new Mixing();
}


public synchronized void update( ReceiveStreamEvent evt)
{

System.out.println("in receive stream evt...");
try
{
if (evt instanceof RemotePayloadChangeEvent)
{
System.err.println(" - Received an RTP PayloadChangeEvent.");
System.exit(0);
}
else
{
if (evt instanceof NewReceiveStreamEvent)
{
System.out.println("inside Receive event of play");
RTPManager mgr = (RTPManager)evt.getSource();
Participant participant = evt.getParticipant();
ReceiveStream stream = evt.getReceiveStream();
audioInputSource1= stream.getDataSource();

dataSources.add(audioInputSource1);
sources= dataSources.toArray(new DataSource[0]);
dataSource = Manager.createMergingDataSource((DataSource[])sources);

sendStream =srcMgrs.createSendStream(dataSource,0);
sendStream.start();

Player audioPlayer = Manager.createRealizedPlayer(dataSource);
System.out.println("receiver thread started");
audioPlayer.start();
}
}
}
catch(Exception e)
{
System.out.println("Error in Play Receive Event");
System.out.println("Error"+e);
}
}
}



//FILE2
/**
*
* @author Sathishkumar
*
*/
import javax.media.*;
import javax.media.protocol.*;
import javax.media.bean.playerbean.MediaPlayer;
import javax.media.format.*;
import java.net.*;
import java.util.StringTokenizer;
import java.util.Vector;
import javax.media.rtp.*;
import javax.media.rtp.event.*;

public class Mixing_c implements SessionListener,ReceiveStreamListener
{
public static Processor audioProcessor;
String mixer_ip;
DataSource processedAudioSource;
DataSource audioInputSource,audioInputSource1;
public static RTPManager srcMgrs;
public static SessionAddress srclocalAddr;
public Mixing_c()
{
try
{
if(srcMgrs==null)
{
System.out.println("CHILD NODES in mixing_c ");
srcMgrs = (RTPManager) RTPManager.newInstance();
srclocalAddr= new SessionAddress( InetAddress.getByName(InetAddress.getLocalHost().g etHostName()), 3000);
srcMgrs.initialize( srclocalAddr);

srcMgrs.addTarget("HOst name of sstm",3000);
srcMgrs.addReceiveStreamListener(this);
srcMgrs.addSessionListener(this);
System.out.println("initiated listeners in mixing_c........");
}
process();

}
catch(Exception e)
{
System.out.println("Error in Mixing Add Child Nodes11");
System.out.println("Error"+e);
}

}


public synchronized void update(SessionEvent evt)
{
try
{
System.out.println("Come inside Session event");
}
catch(Exception e)
{
System.out.println("Error in Session");
System.out.println("Error"+e);
}
}

public void process()
{
try
{
Vector info = CaptureDeviceManager.getDeviceList(null);
if (info == null)
System.out.println("No Capture devices known to JMF");
else
{
CaptureDeviceInfo deviceInfo = (CaptureDeviceInfo)info.elementAt(0);
MediaLocator locator=deviceInfo.getLocator();
System.out.println("Got Locator:"+locator);
audioInputSource=Manager.createDataSource(locator) ;
}

System.out.println("started to capture........");

System.out.println("Mixing Configuration in Process");

Format []formats=new Format[1];
formats[0]=new AudioFormat(AudioFormat.GSM_RTP,8000,16,1);

audioProcessor =Manager.createRealizedProcessor(new ProcessorModel(audioInputSource,formats,new FileTypeDescriptor(FileTypeDescriptor.RAW)));

processedAudioSource = audioProcessor.getDataOutput();

sendStream =srcMgrs.createSendStream(processedAudioSource,0);

sendStream.start();

audioProcessor.start();
System.out.println("Transfering to peers");

}
catch(Exception e)
{
System.out.println("Error in Mixing Process");
System.out.println("Error"+e);
}

}


public static void main(String [] ar)
{
Mixing_c m=new Mixing_c();
}


public synchronized void update( ReceiveStreamEvent evt)
{

System.out.println("in receive stream evt...");
try
{
if (evt instanceof RemotePayloadChangeEvent)
{
System.err.println(" - Received an RTP PayloadChangeEvent.");
System.exit(0);
}
else
{
if (evt instanceof NewReceiveStreamEvent)
{
System.out.println("inside Receive event of play");
RTPManager mgr = (RTPManager)evt.getSource();
Participant participant = evt.getParticipant();
ReceiveStream stream = evt.getReceiveStream();
audioInputSource1= stream.getDataSource();

Player audioPlayer = Manager.createRealizedPlayer(audioInputSource1);
System.out.println("receiver thread started");
audioPlayer.start();
}
}
}
catch(Exception e)
{
System.out.println("Error in Play Receive Event");
System.out.println("Error"+e);
}
}
}