@Before
  public void setUp()
      throws ResourceUnavailableException, IOException, TooManyConnectionsException {
    ConnectionState.OPEN.setTimeout(5);

    // use default clock
    clock = new DefaultClock();

    // create single thread scheduler
    scheduler = new Scheduler();
    scheduler.setClock(clock);
    scheduler.start();

    channelsManager = new ChannelsManager(new UdpManager(scheduler));
    channelsManager.setScheduler(scheduler);

    resourcesPool = new ResourcesPool(scheduler, channelsManager, dspFactory);

    // assign scheduler to the endpoint
    endpoint = new MyTestEndpoint("test");
    endpoint.setScheduler(scheduler);
    endpoint.setResourcesPool(resourcesPool);
    endpoint.start();

    connection = (BaseConnection) endpoint.createConnection(ConnectionType.LOCAL, false);
  }
Ejemplo n.º 2
0
  public void setup() throws IOException {
    // use default clock
    clock = new WallClock();

    dspFactory.addCodec("org.mobicents.media.server.impl.dsp.audio.g711.alaw.Encoder");
    dspFactory.addCodec("org.mobicents.media.server.impl.dsp.audio.g711.alaw.Decoder");

    // create single thread scheduler
    mediaScheduler = new PriorityQueueScheduler();
    mediaScheduler.setClock(clock);
    mediaScheduler.start();

    udpManager = new UdpManager(scheduler);
    udpManager.setBindAddress("127.0.0.1");
    scheduler.start();
    udpManager.start();

    channelsManager = new ChannelsManager(udpManager);
    channelsManager.setScheduler(mediaScheduler);
  }
Ejemplo n.º 3
0
  @Before
  public void setUp()
      throws ResourceUnavailableException, IOException, TooManyConnectionsException {
    // use default clock
    clock = new WallClock();

    // create single thread scheduler
    scheduler = new PriorityQueueScheduler();
    scheduler.setClock(clock);
    scheduler.start();

    channelsManager = new ChannelsManager(new UdpManager(new ServiceScheduler()));
    channelsManager.setScheduler(scheduler);

    resourcesPool = new ResourcesPool(scheduler, channelsManager, dspFactory);
    // assign scheduler to the endpoint
    endpoint = new MyTestEndpoint("test");
    endpoint.setScheduler(scheduler);
    endpoint.setResourcesPool(resourcesPool);
    endpoint.start();

    connection = (BaseConnection) endpoint.createConnection(ConnectionType.LOCAL, false);
    connection.addListener(this);
  }