Revision: 3bd7d0f900f8
Author:   Oifa Yulian <sipme yulian@sipmeyulian-PC.(none)>
Date:     Sun Jul  1 07:11:22 2012
Log:      DS0 Endpoint Implementation - issue 28
Added EndpointConfiguration MGCP Support - issue 40
Resolved audio files problem ( not closed handlers ) - issue 39
Disabled jitter buffer on local interface ( when used several servers in path ) - issue 44
Added support for prompt array in jsr 309 - issue 43

http://code.google.com/p/mediaserver/source/detail?r=3bd7d0f900f8

Added:
/controls/mgcp/src/main/java/org/mobicents/media/server/mgcp/tx/cmd/EndpointConfigurationCmd.java
Modified:
 /bootstrap/pom.xml
 /bootstrap/src/main/config/server-beans.xml
 /chassis/pom.xml
 /chassis/src/main/java/org/mobicents/media/server/BaseEndpointImpl.java
 /chassis/src/main/java/org/mobicents/media/server/Server.java
/chassis/src/main/java/org/mobicents/media/server/VirtualEndpointInstaller.java /chassis/src/main/java/org/mobicents/media/server/VirtualSS7EndpointInstaller.java
 /chassis/src/main/java/org/mobicents/media/server/connection/Channel.java
/chassis/src/main/java/org/mobicents/media/server/connection/RtpConnectionImpl.java
 /codecs/g711/pom.xml
 /codecs/g729/pom.xml
 /codecs/gsm/pom.xml
 /codecs/ilbc/pom.xml
 /codecs/l16/pom.xml
 /codecs/pom.xml
 /component/pom.xml
 /controls/mgcp/pom.xml
/controls/mgcp/src/main/java/org/mobicents/media/server/mgcp/controller/MgcpEndpoint.java /controls/mgcp/src/main/java/org/mobicents/media/server/mgcp/message/Parameter.java /controls/mgcp/src/main/java/org/mobicents/media/server/mgcp/params/LocalConnectionOptions.java /controls/mgcp/src/main/java/org/mobicents/media/server/mgcp/tx/cmd/ActionSelector.java /controls/mgcp/src/test/java/org/mobicents/media/server/mgcp/controller/ConfiguratorTest.java /controls/mgcp/src/test/java/org/mobicents/media/server/mgcp/controller/MyTestEndpoint.java
 /controls/pom.xml
 /endpoints/announcement/pom.xml
 /endpoints/bridge/pom.xml
 /endpoints/cnf/pom.xml
 /endpoints/ds0/pom.xml
/endpoints/ds0/src/main/java/org/mobicents/media/server/ds0/DS0Endpoint.java
 /endpoints/ivr/pom.xml
 /endpoints/packet-relay/pom.xml
 /endpoints/pom.xml
 /endpoints/soundcard/pom.xml
 /hardware/dahdi/java/pom.xml
/hardware/dahdi/java/src/main/java/org/mobicents/media/hardware/dahdi/Channel.java /hardware/dahdi/java/src/main/java/org/mobicents/media/hardware/dahdi/Selector.java
 /hardware/dahdi/native/linux/pom.xml
 /hardware/dahdi/native/pom.xml
 /hardware/dahdi/native/src/main/native/schannel.c
 /hardware/dahdi/pom.xml
 /hardware/pom.xml
 /io/local/pom.xml
 /io/network/pom.xml
 /io/pom.xml
 /io/rtp/pom.xml
 /io/rtp/src/main/java/org/mobicents/media/server/impl/rtp/JitterBuffer.java
/io/rtp/src/main/java/org/mobicents/media/server/impl/rtp/RTPDataChannel.java
 /io/rtp/src/main/java/org/mobicents/media/server/impl/rtp/RTPInput.java
 /io/ss7/pom.xml
 /io/ss7/src/main/java/org/mobicents/media/server/io/ss7/SS7DataChannel.java
 /io/ss7/src/main/java/org/mobicents/media/server/io/ss7/SS7Input.java
 /io/ss7/src/main/java/org/mobicents/media/server/io/ss7/SS7Manager.java
 /io/ss7/src/main/java/org/mobicents/media/server/io/ss7/SS7Output.java
 /jsr-309/pom.xml
/jsr-309/src/main/java/org/mobicents/javax/media/mscontrol/mediagroup/signals/SignalDetectorImpl.java
 /pom.xml
 /resources/dsp/pom.xml
 /resources/generator/pom.xml
 /resources/mediaplayer/pom.xml
/resources/mediaplayer/src/main/java/org/mobicents/media/server/impl/resource/mediaplayer/audio/AudioPlayerImpl.java /resources/mediaplayer/src/main/java/org/mobicents/media/server/impl/resource/mediaplayer/audio/gsm/GsmTrackImpl.java /resources/mediaplayer/src/main/java/org/mobicents/media/server/impl/resource/mediaplayer/audio/wav/WavTrackImpl.java
 /resources/pom.xml
 /resources/recorder/pom.xml
/resources/recorder/src/main/java/org/mobicents/media/server/impl/resource/audio/AudioRecorderImpl.java /resources/recorder/src/main/java/org/mobicents/media/server/impl/resource/audio/RecorderEventImpl.java
 /resources/telephony/dtmf/pom.xml
 /resources/telephony/pom.xml
 /resources/telephony/tone/pom.xml
 /scheduler/pom.xml
/scheduler/src/main/java/org/mobicents/media/server/scheduler/Scheduler.java
 /spi/pom.xml
 /spi/src/main/java/org/mobicents/media/server/spi/Endpoint.java
 /spi/src/main/java/org/mobicents/media/server/spi/EndpointInstaller.java
 /spi/src/test/java/org/mobicents/media/server/spi/memory/FrameTest.java

=======================================
--- /dev/null
+++ /controls/mgcp/src/main/java/org/mobicents/media/server/mgcp/tx/cmd/EndpointConfigurationCmd.java Sun Jul 1 07:11:22 2012
@@ -0,0 +1,202 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.mobicents.media.server.mgcp.tx.cmd;
+
+import java.io.IOException;
+import org.mobicents.media.server.mgcp.MgcpEvent;
+import org.mobicents.media.server.mgcp.controller.MgcpCall;
+import org.mobicents.media.server.mgcp.controller.MgcpConnection;
+import org.mobicents.media.server.mgcp.controller.MgcpEndpoint;
+import org.mobicents.media.server.mgcp.controller.naming.UnknownEndpointException;
+import org.mobicents.media.server.mgcp.message.MgcpRequest;
+import org.mobicents.media.server.mgcp.message.MgcpResponse;
+import org.mobicents.media.server.mgcp.message.MgcpResponseCode;
+import org.mobicents.media.server.mgcp.message.Parameter;
+import org.mobicents.media.server.mgcp.tx.Action;
+import org.mobicents.media.server.scheduler.Scheduler;
+import org.mobicents.media.server.scheduler.Task;
+import org.mobicents.media.server.scheduler.TaskChain;
+import org.mobicents.media.server.utils.Text;
+
+/**
+ * Endpoint configuration command
+ *
+ * @author oifa yulian
+ */
+public class EndpointConfigurationCmd extends Action {
+    //response strings
+    private final static Text SUCCESS= new Text("Success");
+    private final static Text MU_LAW= new Text("e:mu");
+    private final static Text A_LAW= new Text("e:A");
+
+ private final static Text BEARER_INFORMATION_MISSING = new Text("Missing bearer information value"); + private final static Text INVALID_BEARER_INFORMATION = new Text("Invalid bearer information value");
+
+    private MgcpRequest request;
+
+    //local and domain name parts of the endpoint identifier
+    private Text localName = new Text();
+    private Text domainName = new Text();
+
+    //layout local and domain names into endpoint identifier
+    private Text[] endpointName = new Text[]{localName, domainName};
+
+    private MgcpEndpoint endpoint;
+    private MgcpEndpoint[] endpoints = new MgcpEndpoint[1];
+
+    private TaskChain handler;
+
+    private int code;
+    private Text message;
+
+    public EndpointConfigurationCmd(Scheduler scheduler) {
+        handler = new TaskChain(2);
+
+        Configurator configurator = new Configurator(scheduler);
+        Responder responder = new Responder(scheduler);
+
+        handler.add(configurator);
+        handler.add(responder);
+
+        ErrorHandler errorHandler = new ErrorHandler(scheduler);
+
+        this.setActionHandler(handler);
+        this.setRollbackHandler(errorHandler);
+    }
+
+    private class Configurator extends Task {
+
+        public Configurator(Scheduler scheduler) {
+            super(scheduler);
+        }
+
+        public int getQueueNumber()
+        {
+               return scheduler.MANAGEMENT_QUEUE;
+        }
+
+        @Override
+        public long perform() {
+            request = (MgcpRequest) getEvent().getMessage();
+
+ Parameter bearerInformation = request.getParameter(Parameter.BARER_INFORMATION);
+            if (bearerInformation == null) {
+ throw new MgcpCommandException(MgcpResponseCode.PROTOCOL_ERROR, BEARER_INFORMATION_MISSING);
+            }
+
+            boolean isALaw=false;
+            if(bearerInformation.getValue().equals(MU_LAW))
+               {
+                       //do nothing
+               }
+               else if(bearerInformation.getValue().equals(A_LAW))
+                       isALaw=true;
+               else
+ throw new MgcpCommandException(MgcpResponseCode.PROTOCOL_ERROR, INVALID_BEARER_INFORMATION);
+
+            //getting endpoint name
+            request.getEndpoint().divide('@', endpointName);
+            //searching endpoint
+            try {
+                int n = transaction().find(localName, endpoints);
+                if (n == 0) {
+ throw new MgcpCommandException(MgcpResponseCode.ENDPOINT_NOT_AVAILABLE, new Text("Endpoint not available"));
+                }
+            } catch (UnknownEndpointException e) {
+ throw new MgcpCommandException(MgcpResponseCode.ENDPOINT_UNKNOWN, new Text("Endpoint not available"));
+            }
+
+            //extract found endpoint
+            endpoint = endpoints[0];
+
+            endpoint.configure(isALaw);
+            return 0;
+        }
+
+    }
+
+    private class Responder extends Task {
+
+        public Responder(Scheduler scheduler) {
+            super(scheduler);
+        }
+
+        public int getQueueNumber()
+        {
+               return scheduler.MANAGEMENT_QUEUE;
+        }
+
+        @Override
+        public long perform() {
+ MgcpEvent evt = transaction().getProvider().createEvent(MgcpEvent.RESPONSE, getEvent().getAddress());
+            MgcpResponse response = (MgcpResponse) evt.getMessage();
+ response.setResponseCode(MgcpResponseCode.TRANSACTION_WAS_EXECUTED);
+            response.setResponseString(SUCCESS);
+            response.setTxID(transaction().getId());
+
+            try {
+                transaction().getProvider().send(evt);
+            } catch (IOException e) {
+            } finally {
+                evt.recycle();
+            }
+
+            return 0;
+        }
+
+    }
+
+    private class ErrorHandler extends Task {
+
+        public ErrorHandler(Scheduler scheduler) {
+            super(scheduler);
+        }
+
+        public int getQueueNumber()
+        {
+               return scheduler.MANAGEMENT_QUEUE;
+        }
+
+        @Override
+        public long perform() {
+ code = ((MgcpCommandException)transaction().getLastError()).getCode(); + message = ((MgcpCommandException)transaction().getLastError()).getErrorMessage();
+
+ MgcpEvent evt = transaction().getProvider().createEvent(MgcpEvent.RESPONSE, getEvent().getAddress());
+            MgcpResponse response = (MgcpResponse) evt.getMessage();
+            response.setResponseCode(code);
+            response.setResponseString(message);
+            response.setTxID(transaction().getId());
+
+            try {
+                transaction().getProvider().send(evt);
+            } catch (IOException e) {
+            } finally {
+                evt.recycle();
+            }
+
+            return 0;
+        }
+
+    }
+
+}
=======================================
--- /bootstrap/pom.xml  Tue Jun  5 11:56:27 2012
+++ /bootstrap/pom.xml  Sun Jul  1 07:11:22 2012
@@ -6,7 +6,7 @@
     <parent>
         <groupId>org.mobicents.media</groupId>
         <artifactId>server</artifactId>
-        <version>2.4.0-SNAPSHOT</version>
+        <version>2.4.0.CR1</version>
     </parent>

     <groupId>org.mobicents.media</groupId>
@@ -74,6 +74,11 @@
             <artifactId>soundcard</artifactId>
             <version>${project.version}</version>
         </dependency>
+        <dependency>
+            <groupId>org.mobicents.media.endpoints</groupId>
+            <artifactId>ds0</artifactId>
+            <version>${project.version}</version>
+        </dependency>
              <dependency>
             <groupId>org.mobicents.media.endpoints</groupId>
             <artifactId>local-to-remote-bridge</artifactId>
@@ -146,42 +151,42 @@
                     </execution>
                 </executions>
             </plugin>
-                              <!--<plugin>
-                                <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
-                                <executions>
-                                        <execution>
-                                                <id>copy</id>
-                                                <phase>package</phase>
-                                                <goals>
-                                                        <goal>copy</goal>
-                                                </goals>
-                                                <configuration>
-                                                        <artifactItems>
- <artifactItem> - <groupId> - org.mobicents.media.hardware - </groupId> - <artifactId> - libmobicents-dahdi-linux - </artifactId> - <version> - ${pom.version} - </version> - <type>so</type> - <overWrite>true</overWrite> - <outputDirectory> - ${project.build.directory}/mms-server/native - </outputDirectory> - <destFileName> - libmobicents-dahdi-linux.so - </destFileName> - </artifactItem>
-                                                        </artifactItems>
-                                                </configuration>
-                                        </execution>
-                                </executions>
-                        </plugin>-->
+               <!--<plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-dependency-plugin</artifactId>
+                <executions>
+                    <execution>
+                       <id>copy</id>
+                       <phase>package</phase>
+                       <goals>
+                          <goal>copy</goal>
+                       </goals>
+                       <configuration>
+                          <artifactItems>
+                              <artifactItem>
+                                 <groupId>
+                                     org.mobicents.media.hardware
+                                 </groupId>
+                                 <artifactId>
+                                     libmobicents-dahdi-linux
+                                 </artifactId>
+                                 <version>
+                                     ${pom.version}
+                                 </version>
+                                 <type>so</type>
+                                 <overWrite>true</overWrite>
+                                 <outputDirectory>
+ ${project.build.directory}/mms-server.dir/native
+                                 </outputDirectory>
+                                 <destFileName>
+                                     libmobicents-dahdi-linux.so
+                                 </destFileName>
+                             </artifactItem>
+                         </artifactItems>
+                      </configuration>
+                  </execution>
+              </executions>
+            </plugin>  -->
        </plugins>
     </build>

=======================================
--- /bootstrap/src/main/config/server-beans.xml Mon May 28 08:12:44 2012
+++ /bootstrap/src/main/config/server-beans.xml Sun Jul  1 07:11:22 2012
@@ -104,4 +104,16 @@
        <property name="localConnections">5</property>
     </bean>

+       <!-- DS0 Endpoints configuration sample -->
+ <!--<bean name="DS0" class="org.mobicents.media.server.VirtualSS7EndpointInstaller">
+        <property name="namePattern">mobicents/ds0/[1..15]</property>
+        <property name="dspFactory"><inject bean="DSP"/></property>
+        <property name="SS7Manager"><inject bean="SS7"/></property>
+ <property name="endpointClass">org.mobicents.media.server.ds0.DS0Endpoint</property>
+        <property name="rtpConnections">1</property>
+        <property name="localConnections">1</property>
+        <property name="startChannelID">125</property>
+        <property name="isALaw">true</property>
+    </bean>-->
+
 </deployment>
=======================================
--- /chassis/pom.xml    Tue Jun  5 11:56:27 2012
+++ /chassis/pom.xml    Sun Jul  1 07:11:22 2012
@@ -6,7 +6,7 @@
     <parent>
         <groupId>org.mobicents.media</groupId>
         <artifactId>server</artifactId>
-        <version>2.4.0-SNAPSHOT</version>
+        <version>2.4.0.CR1</version>
     </parent>

     <groupId>org.mobicents.media</groupId>
=======================================
--- /chassis/src/main/java/org/mobicents/media/server/BaseEndpointImpl.java Mon May 28 08:12:44 2012 +++ /chassis/src/main/java/org/mobicents/media/server/BaseEndpointImpl.java Sun Jul 1 07:11:22 2012
@@ -63,7 +63,7 @@
     private EndpointState state = EndpointState.READY;

     //connections subsytem
-    private Connections connections;
+    protected Connections connections;

     //rtp protocol manager
     private RTPManager rtpManager;
@@ -323,6 +323,11 @@
        return connections.getActiveConnectionsCount();
     }

+    public void configure(boolean isALaw)
+    {
+
+    }
+
     public abstract void unblock();
     public abstract void block();

=======================================
--- /chassis/src/main/java/org/mobicents/media/server/Server.java Wed Nov 2 12:34:02 2011 +++ /chassis/src/main/java/org/mobicents/media/server/Server.java Sun Jul 1 07:11:22 2012
@@ -123,9 +123,9 @@
      * @param installer the endpoints installer
      */
     public void addInstaller(EndpointInstaller installer) {
-        ((VirtualEndpointInstaller)installer).setServer(this);
-        installers.add(installer);
-        installer.install();
+       ((VirtualEndpointInstaller)installer).setServer(this);
+       installers.add(installer);
+        installer.install();
     }

     /**
=======================================
--- /chassis/src/main/java/org/mobicents/media/server/VirtualEndpointInstaller.java Wed Nov 2 12:34:02 2011 +++ /chassis/src/main/java/org/mobicents/media/server/VirtualEndpointInstaller.java Sun Jul 1 07:11:22 2012
@@ -38,14 +38,14 @@
  */
 public class VirtualEndpointInstaller implements EndpointInstaller {

-    private String namePattern;
-    private EndpointNameGenerator nameParser;
+    private String namePattern;
     private String endpointClass;
-    private DspFactory dspFactory;
+    protected DspFactory dspFactory;
     private int localConnections;
     private int rtpConnections;

-    private Server server;
+    protected EndpointNameGenerator nameParser;
+    protected Server server;

     /**
      * Creates new endpoint installer.
=======================================
--- /chassis/src/main/java/org/mobicents/media/server/VirtualSS7EndpointInstaller.java Mon May 28 08:12:44 2012 +++ /chassis/src/main/java/org/mobicents/media/server/VirtualSS7EndpointInstaller.java Sun Jul 1 07:11:22 2012
@@ -35,54 +35,18 @@
* Endpoint installer is used for automatic creation and instalation of endpoints.
  *
  * It uses three parameters: the name pattern, class name and configuration
- * @author kulikov
+ * @author oifa yulian
  */
-public class VirtualSS7EndpointInstaller implements EndpointInstaller {
-
-    private String namePattern;
-    private EndpointNameGenerator nameParser;
-    private String endpointClass;
-    private DspFactory dspFactory;
+public class VirtualSS7EndpointInstaller extends VirtualEndpointInstaller {
+
     private SS7Manager ss7Manager;
-    private int localConnections;
-    private int rtpConnections;
     private int startChannelID=1;
     private boolean isALaw=true;

-    private Server server;
-
     /**
      * Creates new endpoint installer.
      */
-    public VirtualSS7EndpointInstaller() {
-        nameParser = new EndpointNameGenerator();
-    }
-
-    /**
-     * Creates relation with server instance.
-     *
-     * @param server the server instance.
-     */
-    public void setServer(Server server) {
-        this.server = server;
-    }
-
-    /**
-     * Gets the pattern used for generating endpoint name.
-     *
-     * @return text pattern
-     */
-    public String getNamePattern() {
-        return namePattern;
-    }
-
-    /**
-     * Sets the pattern used for generating endpoint name.
-     *
-     * @param namePattern the pattern text.
-     */
-    public void setNamePattern(String namePattern) {
-        this.namePattern = namePattern;
+    public VirtualSS7EndpointInstaller() {
     }

     /**
@@ -138,82 +102,25 @@
     public void setSS7Manager(SS7Manager ss7Manager) {
         this.ss7Manager = ss7Manager;
     }
-
-    /**
-     * Gets the name of the class implementing endpoint.
-     *
-     * @return the fully qualified class name.
-     */
-    public String getEndpointClass() {
-        return this.endpointClass;
-    }
-
-    /**
-     * Sets the name of the class implementing endpoint.
-     *
-     * @param endpointClass the fully qualified class name.
-     */
-    public void setEndpointClass(String endpointClass) {
-        this.endpointClass = endpointClass;
-    }
-
-    public void setDspFactory(DspFactory dspFactory) {
-        this.dspFactory = dspFactory;
-    }
-
-    /**
-     * Gets the number of local connections allowed per endpoint
-     *
-     * @return the number of local connections.
-     */
-    public int getLocalConnections() {
-        return this.localConnections;
-    }
-
-    /**
-     * Sets the number of local connections allowed per endpoint
-     *
-     * @param localConnections the number of local connections.
-     */
-    public void setLocalConnections(int localConnections) {
-        this.localConnections = localConnections;
-    }
-
-    /**
-     * Gets the number of local connections allowed per endpoint
-     *
-     * @return the number of local connections.
-     */
-    public int getRtpConnections() {
-        return this.rtpConnections;
-    }
-
-    /**
-     * Sets the number of local connections allowed per endpoint
-     *
-     * @param localConnections the number of local connections.
-     */
-    public void setRtpConnections(int rtpConnections) {
-        this.rtpConnections = rtpConnections;
-    }
-
+
     /**
      * (Non Java-doc.)
      *
      * @throws ResourceUnavailableException
      */
+    @Override
     public void install() {
-        ClassLoader loader = Server.class.getClassLoader();
-        nameParser.setPattern(namePattern);
+       ClassLoader loader = Server.class.getClassLoader();
+        nameParser.setPattern(getNamePattern());
         int index=startChannelID;
         while (nameParser.hasMore()) {
             String name = nameParser.next();
-            try {
- Constructor constructor = loader.loadClass(this.endpointClass).getConstructor(String.class);
+            try {
+ Constructor constructor = loader.loadClass(this.getEndpointClass()).getConstructor(String.class,SS7Manager.class,int.class,boolean.class); BaseSS7EndpointImpl endpoint = (BaseSS7EndpointImpl) constructor.newInstance(name,ss7Manager,index++,isALaw);
                 endpoint.setDspFactory(dspFactory);
-                endpoint.setLocalConnections(localConnections);
-                endpoint.setRtpConnections(rtpConnections);
+                endpoint.setLocalConnections(getLocalConnections());
+                endpoint.setRtpConnections(getRtpConnections());
                 server.install(endpoint);
             } catch (Exception e) {
                 server.logger.error("Couldn't instantiate endpoint", e);
=======================================
--- /chassis/src/main/java/org/mobicents/media/server/connection/Channel.java Fri Feb 17 05:07:24 2012 +++ /chassis/src/main/java/org/mobicents/media/server/connection/Channel.java Sun Jul 1 07:11:22 2012
@@ -223,7 +223,7 @@
     public void connect(RTPDataChannel other) {
        this.isRTP = true;

-        txPipe.connect(mixer.getOutput());
+       txPipe.connect(mixer.getOutput());
         txPipe.connect(other.getOutput());

         rxPipe.connect(splitter.getInput());
=======================================
--- /chassis/src/main/java/org/mobicents/media/server/connection/RtpConnectionImpl.java Mon May 28 08:12:44 2012 +++ /chassis/src/main/java/org/mobicents/media/server/connection/RtpConnectionImpl.java Sun Jul 1 07:11:22 2012
@@ -203,7 +203,7 @@
         if ((audio.isEmpty() || !audio.hasNonDTMF()) && video.isEmpty()) {
             throw new IOException("Codecs are not negotiated");
         }
-
+
         if (!audio.isEmpty()) {
                rtpAudioChannel.setFormatMap(audioFormats);
             try {
@@ -274,7 +274,7 @@
         if ((audio.isEmpty() || !audio.hasNonDTMF()) && video.isEmpty()) {
             throw new IOException("Codecs are not negotiated");
         }
-
+
         if (!audio.isEmpty()) {
                rtpAudioChannel.setFormatMap(audioFormats);
             try {
=======================================
--- /codecs/g711/pom.xml        Tue Jun  5 11:56:27 2012
+++ /codecs/g711/pom.xml        Sun Jul  1 07:11:22 2012
@@ -6,7 +6,7 @@
     <parent>
         <groupId>org.mobicents.servers.media.codecs</groupId>
         <artifactId>codecs</artifactId>
-        <version>2.4.0-SNAPSHOT</version>
+        <version>2.4.0.CR1</version>
     </parent>

     <groupId>org.mobicents.servers.media.codecs</groupId>
=======================================
--- /codecs/g729/pom.xml        Tue Jun  5 11:56:27 2012
+++ /codecs/g729/pom.xml        Sun Jul  1 07:11:22 2012
@@ -6,7 +6,7 @@
     <parent>
         <groupId>org.mobicents.servers.media.codecs</groupId>
         <artifactId>codecs</artifactId>
-        <version>2.4.0-SNAPSHOT</version>
+        <version>2.4.0.CR1</version>
     </parent>

     <groupId>org.mobicents.servers.media.codecs</groupId>
=======================================
--- /codecs/gsm/pom.xml Tue Jun  5 11:56:27 2012
+++ /codecs/gsm/pom.xml Sun Jul  1 07:11:22 2012
@@ -6,7 +6,7 @@
     <parent>
         <groupId>org.mobicents.servers.media.codecs</groupId>
         <artifactId>codecs</artifactId>
-        <version>2.4.0-SNAPSHOT</version>
+        <version>2.4.0.CR1</version>
     </parent>

     <groupId>org.mobicents.servers.media.codecs</groupId>
=======================================
--- /codecs/ilbc/pom.xml        Tue Jun  5 11:56:27 2012
+++ /codecs/ilbc/pom.xml        Sun Jul  1 07:11:22 2012
@@ -6,7 +6,7 @@
     <parent>
         <groupId>org.mobicents.servers.media.codecs</groupId>
         <artifactId>codecs</artifactId>
-        <version>2.4.0-SNAPSHOT</version>
+        <version>2.4.0.CR1</version>
     </parent>

     <groupId>org.mobicents.servers.media.codecs</groupId>
=======================================
--- /codecs/l16/pom.xml Tue Jun  5 11:56:27 2012
+++ /codecs/l16/pom.xml Sun Jul  1 07:11:22 2012
@@ -6,7 +6,7 @@
     <parent>
         <groupId>org.mobicents.servers.media.codecs</groupId>
         <artifactId>codecs</artifactId>
-        <version>2.4.0-SNAPSHOT</version>
+        <version>2.4.0.CR1</version>
     </parent>

     <groupId>org.mobicents.servers.media.codecs</groupId>
=======================================
--- /codecs/pom.xml     Tue Jun  5 11:56:27 2012
+++ /codecs/pom.xml     Sun Jul  1 07:11:22 2012
@@ -6,7 +6,7 @@
     <parent>
         <groupId>org.mobicents.media</groupId>
         <artifactId>server</artifactId>
-        <version>2.4.0-SNAPSHOT</version>
+        <version>2.4.0.CR1</version>
     </parent>

     <groupId>org.mobicents.servers.media.codecs</groupId>
=======================================
--- /component/pom.xml  Tue Jun  5 11:56:27 2012
+++ /component/pom.xml  Sun Jul  1 07:11:22 2012
@@ -6,7 +6,7 @@
     <parent>
         <groupId>org.mobicents.media</groupId>
         <artifactId>server</artifactId>
-        <version>2.4.0-SNAPSHOT</version>
+        <version>2.4.0.CR1</version>
     </parent>

     <groupId>org.mobicents.media</groupId>
=======================================
--- /controls/mgcp/pom.xml      Tue Jun  5 11:56:27 2012
+++ /controls/mgcp/pom.xml      Sun Jul  1 07:11:22 2012
@@ -6,7 +6,7 @@
     <parent>
         <groupId>org.mobicents.media.controls</groupId>
         <artifactId>controls</artifactId>
-        <version>2.4.0-SNAPSHOT</version>
+        <version>2.4.0.CR1</version>
     </parent>

     <groupId>org.mobicents.media.controls</groupId>
=======================================
--- /controls/mgcp/src/main/java/org/mobicents/media/server/mgcp/controller/MgcpEndpoint.java Mon May 28 08:12:44 2012 +++ /controls/mgcp/src/main/java/org/mobicents/media/server/mgcp/controller/MgcpEndpoint.java Sun Jul 1 07:11:22 2012
@@ -252,7 +252,7 @@
     protected void send(MgcpEvent message, SocketAddress address) {
        listener.process(message);
     }
-
+
     /**
      * Asks mgcp connection object from pool.
      *
@@ -292,4 +292,9 @@
                                this.stateListener.onFreed(this);
        }
     }
-}
+
+    public void configure(boolean isALaw)
+    {
+       endpoint.configure(isALaw);
+    }
+}
=======================================
--- /controls/mgcp/src/main/java/org/mobicents/media/server/mgcp/message/Parameter.java Mon Nov 21 15:38:06 2011 +++ /controls/mgcp/src/main/java/org/mobicents/media/server/mgcp/message/Parameter.java Sun Jul 1 07:11:22 2012
@@ -46,6 +46,7 @@
     public final static Text CONNECTION_PARAMETERS= new Text("P");
     public final static Text LOCAL_CONNECTION_OPTIONS= new Text("L");
     public final static Text REASON_CODE = new Text("E");
+    public final static Text BARER_INFORMATION = new Text("B");

     private Text key = new Text();
     private Text value = new Text();
=======================================
--- /controls/mgcp/src/main/java/org/mobicents/media/server/mgcp/params/LocalConnectionOptions.java Mon May 28 08:12:44 2012 +++ /controls/mgcp/src/main/java/org/mobicents/media/server/mgcp/params/LocalConnectionOptions.java Sun Jul 1 07:11:22 2012
@@ -40,7 +40,7 @@
     public final static Text RESOURCE_RESERVATION = new Text("r");
     public final static Text ENCRYPTION_KEY = new Text("k");
     public final static Text DTMF_CLAMP = new Text("x-dc");
-    public final static Text IS_LOCAL = new Text("x-islocal");
+    public final static Text IS_LOCAL = new Text("x-lo");

     public final static Text TRUE = new Text("true");

=======================================
--- /controls/mgcp/src/main/java/org/mobicents/media/server/mgcp/tx/cmd/ActionSelector.java Mon Nov 21 15:38:06 2011 +++ /controls/mgcp/src/main/java/org/mobicents/media/server/mgcp/tx/cmd/ActionSelector.java Sun Jul 1 07:11:22 2012
@@ -40,6 +40,7 @@
     private final static Text DELETE_CONNECTION = new Text("DLCX");
     private final static Text REQUEST_NOTIFICATION = new Text("RQNT");
     private final static Text REQUEST_NOTIFY = new Text("NTFY");
+    private final static Text ENDPOINT_CONFIGURATION = new Text("EPCF");

     private Text command;
     private MgcpRequest request;
@@ -49,6 +50,7 @@
     private ModifyConnectionCmd mdcx;
     private DeleteConnectionCmd dlcx;
     private NotificationRequestCmd rqnt;
+    private EndpointConfigurationCmd epcf;
     private NotifyCmd ntfy;

     /**
@@ -62,6 +64,7 @@
         dlcx = new DeleteConnectionCmd(scheduler);
         rqnt = new NotificationRequestCmd(scheduler);
         ntfy = new NotifyCmd(scheduler);
+        epcf = new EndpointConfigurationCmd(scheduler);
     }

     public Action getAction(MgcpEvent event) {
@@ -75,6 +78,8 @@
                     return crcx;
                 } else if (command.equals(MODIFY_CONNECTION)) {
                     return mdcx;
+                } else if (command.equals(ENDPOINT_CONFIGURATION)) {
+                    return epcf;
                 } else if (command.equals(DELETE_CONNECTION)) {
                        if(request.getParameter(Parameter.REASON_CODE)!=null) {
                                //its connection deletion from ms
=======================================
--- /controls/mgcp/src/test/java/org/mobicents/media/server/mgcp/controller/ConfiguratorTest.java Mon May 28 08:12:44 2012 +++ /controls/mgcp/src/test/java/org/mobicents/media/server/mgcp/controller/ConfiguratorTest.java Sun Jul 1 07:11:22 2012
@@ -133,6 +133,10 @@
             throw new UnsupportedOperationException("Not supported yet.");
         }

+        public void configure(boolean isALaw) {
+               throw new UnsupportedOperationException("Not supported yet.");
+        }
+
public String describe(MediaType mediaType) throws ResourceUnavailableException {
             throw new UnsupportedOperationException("Not supported yet.");
         }
=======================================
--- /controls/mgcp/src/test/java/org/mobicents/media/server/mgcp/controller/MyTestEndpoint.java Mon May 28 08:12:44 2012 +++ /controls/mgcp/src/test/java/org/mobicents/media/server/mgcp/controller/MyTestEndpoint.java Sun Jul 1 07:11:22 2012
@@ -101,6 +101,10 @@
     public void setDspFactory(DspFactory dspFactory) {
         throw new UnsupportedOperationException("Not supported yet.");
     }
+
+    public void configure(boolean isALaw) {
+       throw new UnsupportedOperationException("Not supported yet.");
+    }

     public Component getResource(MediaType mediaType, Class intf) {
         return null;
=======================================
--- /controls/pom.xml   Tue Jun  5 11:56:27 2012
+++ /controls/pom.xml   Sun Jul  1 07:11:22 2012
@@ -6,7 +6,7 @@
     <parent>
         <groupId>org.mobicents.media</groupId>
         <artifactId>server</artifactId>
-        <version>2.4.0-SNAPSHOT</version>
+        <version>2.4.0.CR1</version>
     </parent>

     <groupId>org.mobicents.media.controls</groupId>
=======================================
--- /endpoints/announcement/pom.xml     Tue Jun  5 11:56:27 2012
+++ /endpoints/announcement/pom.xml     Sun Jul  1 07:11:22 2012
@@ -6,7 +6,7 @@
     <parent>
         <groupId>org.mobicents.media.endpoints</groupId>
         <artifactId>endpoints</artifactId>
-        <version>2.4.0-SNAPSHOT</version>
+        <version>2.4.0.CR1</version>
     </parent>

     <groupId>org.mobicents.media.endpoints</groupId>
=======================================
--- /endpoints/bridge/pom.xml   Tue Jun  5 11:56:27 2012
+++ /endpoints/bridge/pom.xml   Sun Jul  1 07:11:22 2012
@@ -6,7 +6,7 @@
     <parent>
         <groupId>org.mobicents.media.endpoints</groupId>
         <artifactId>endpoints</artifactId>
-        <version>2.4.0-SNAPSHOT</version>
+        <version>2.4.0.CR1</version>
     </parent>

     <groupId>org.mobicents.media.endpoints</groupId>
=======================================
--- /endpoints/cnf/pom.xml      Tue Jun  5 11:56:27 2012
+++ /endpoints/cnf/pom.xml      Sun Jul  1 07:11:22 2012
@@ -6,7 +6,7 @@
     <parent>
         <groupId>org.mobicents.media.endpoints</groupId>
         <artifactId>endpoints</artifactId>
-        <version>2.4.0-SNAPSHOT</version>
+        <version>2.4.0.CR1</version>
     </parent>

     <groupId>org.mobicents.media.endpoints</groupId>
=======================================
--- /endpoints/ds0/pom.xml      Tue Jun  5 11:56:27 2012
+++ /endpoints/ds0/pom.xml      Sun Jul  1 07:11:22 2012
@@ -6,7 +6,7 @@
     <parent>
         <groupId>org.mobicents.media.endpoints</groupId>
         <artifactId>endpoints</artifactId>
-        <version>2.4.0-SNAPSHOT</version>
+        <version>2.4.0.CR1</version>
     </parent>

     <groupId>org.mobicents.media.endpoints</groupId>
@@ -85,7 +85,7 @@
                 </configuration>
             </plugin>
         </plugins>
-        <finalName>mobicents-announcement-${project.version}</finalName>
+        <finalName>mobicents-ds0-${project.version}</finalName>
     </build>

 </project>
=======================================
--- /endpoints/ds0/src/main/java/org/mobicents/media/server/ds0/DS0Endpoint.java Mon May 28 08:12:44 2012 +++ /endpoints/ds0/src/main/java/org/mobicents/media/server/ds0/DS0Endpoint.java Sun Jul 1 07:11:22 2012
@@ -27,10 +27,14 @@
 import org.mobicents.media.MediaSource;
 import org.mobicents.media.server.spi.MediaType;
 import org.mobicents.media.server.spi.ResourceUnavailableException;
+import org.mobicents.media.server.spi.TooManyConnectionsException;
 import org.mobicents.media.server.component.Splitter;
 import org.mobicents.media.server.component.audio.AudioMixer;
 import org.mobicents.media.server.impl.PipeImpl;
+import org.mobicents.media.server.BaseEndpointImpl;
 import org.mobicents.media.server.BaseSS7EndpointImpl;
+import org.mobicents.media.server.spi.Connection;
+import org.mobicents.media.server.spi.ConnectionType;
 import org.mobicents.media.server.io.ss7.SS7Manager;
 import org.mobicents.media.server.io.ss7.SS7DataChannel;
 /**
@@ -46,8 +50,8 @@

     private ArrayList<MediaSource> components = new ArrayList();

- public DS0Endpoint(String name,int endpointType,SS7Manager ss7Manager,int channelID,boolean isALaw) {
-        super(name,endpointType,ss7Manager,channelID,isALaw);
+ public DS0Endpoint(String name,SS7Manager ss7Manager,int channelID,boolean isALaw) { + super(name,BaseEndpointImpl.ENDPOINT_NORMAL,ss7Manager,channelID,isALaw);

         try
         {
@@ -55,7 +59,6 @@
         }
         catch(Exception e)
         {
-
         }
     }

@@ -73,7 +76,7 @@
     public MediaSource getSource(MediaType media) {
         switch (media) {
             case AUDIO:
-                return audioMixer.getOutput();
+               return audioMixer.getOutput();
             default:
                 return null;
         }
@@ -85,17 +88,20 @@
                audioMixer = new AudioMixer(getScheduler());
                MediaSink sink = audioMixer.newInput();
             MediaSource source=ss7DataChannel.getInput();
+ ss7DataChannel.getInput().setDsp(getDspFactory().newProcessor());
             PipeImpl p = new PipeImpl();
             p.connect(sink);
-            p.connect(source);
-
+            p.connect(source);
             components.add(source);
             sink.start();

             audioSplitter = new Splitter(getScheduler());
-            PipeImpl p1 = new PipeImpl();
-            p1.connect(audioSplitter.getInput());
-            p1.connect(ss7DataChannel.getOutput());
+            PipeImpl p1 = new PipeImpl();
+            source=audioSplitter.newOutput();
+            p1.connect(source);
+            p1.connect(ss7DataChannel.getOutput());
+ ss7DataChannel.getOutput().setDsp(getDspFactory().newProcessor());
+            source.start();

         } catch (Exception e) {
             throw new ResourceUnavailableException(e);
@@ -117,6 +123,12 @@
                 return null;
         }
     }
+
+    @Override
+    public void configure(boolean isALaw)
+    {
+       ss7DataChannel.setCodec(isALaw);
+    }

     @Override
     public void unblock() {
@@ -125,4 +137,30 @@
     @Override
     public void block() {
     }
-}
+
+    @Override
+ public Connection createConnection(ConnectionType type,boolean isLocal) throws TooManyConnectionsException, ResourceUnavailableException {
+       Connection connection=super.createConnection(type,isLocal);
+
+       if(getActiveConnectionsCount()==1)
+               ss7DataChannel.bind();
+
+       return connection;
+    }
+
+    @Override
+    public void deleteConnection(Connection connection) {
+       super.deleteConnection(connection);
+
+       if(getActiveConnectionsCount()==0)
+               ss7DataChannel.close();
+    }
+
+    @Override
+    public void deleteAllConnections() {
+       super.deleteAllConnections();
+
+       if(getActiveConnectionsCount()==0)
+               ss7DataChannel.close();
+    }
+}
=======================================
--- /endpoints/ivr/pom.xml      Tue Jun  5 11:56:27 2012
+++ /endpoints/ivr/pom.xml      Sun Jul  1 07:11:22 2012
@@ -6,7 +6,7 @@
     <parent>
         <groupId>org.mobicents.media.endpoints</groupId>
         <artifactId>endpoints</artifactId>
-        <version>2.4.0-SNAPSHOT</version>
+        <version>2.4.0.CR1</version>
     </parent>

     <groupId>org.mobicents.media.endpoints</groupId>
=======================================
--- /endpoints/packet-relay/pom.xml     Tue Jun  5 11:56:27 2012
+++ /endpoints/packet-relay/pom.xml     Sun Jul  1 07:11:22 2012
@@ -6,7 +6,7 @@
     <parent>
         <groupId>org.mobicents.media.endpoints</groupId>
         <artifactId>endpoints</artifactId>
-        <version>2.4.0-SNAPSHOT</version>
+        <version>2.4.0.CR1</version>
     </parent>

     <groupId>org.mobicents.media.endpoints</groupId>
=======================================
--- /endpoints/pom.xml  Tue Jun  5 11:56:27 2012
+++ /endpoints/pom.xml  Sun Jul  1 07:11:22 2012
@@ -6,7 +6,7 @@
     <parent>
         <groupId>org.mobicents.media</groupId>
         <artifactId>server</artifactId>
-        <version>2.4.0-SNAPSHOT</version>
+        <version>2.4.0.CR1</version>
     </parent>

     <groupId>org.mobicents.media.endpoints</groupId>
@@ -16,10 +16,10 @@
     <modules>
        <module>announcement</module>
        <module>ivr</module>
-        <module>soundcard</module>
-        <module>cnf</module>
+    <module>soundcard</module>
+    <module>cnf</module>
        <module>bridge</module>
-        <module>packet-relay</module>
+    <module>packet-relay</module>
        <module>ds0</module>
     </modules>

=======================================
--- /endpoints/soundcard/pom.xml        Tue Jun  5 11:56:27 2012
+++ /endpoints/soundcard/pom.xml        Sun Jul  1 07:11:22 2012
@@ -6,7 +6,7 @@
     <parent>
         <groupId>org.mobicents.media.endpoints</groupId>
         <artifactId>endpoints</artifactId>
-        <version>2.4.0-SNAPSHOT</version>
+        <version>2.4.0.CR1</version>
     </parent>

     <groupId>org.mobicents.media.endpoints</groupId>
=======================================
--- /hardware/dahdi/java/pom.xml        Tue Jun  5 11:56:27 2012
+++ /hardware/dahdi/java/pom.xml        Sun Jul  1 07:11:22 2012
@@ -6,7 +6,7 @@
        <parent>
                 <groupId>org.mobicents.media.hardware</groupId>
                 <artifactId>mobicents-dahdi-parent</artifactId>
-                <version>2.4.0-SNAPSHOT</version>
+                <version>2.4.0.CR1</version>
         </parent>

        <artifactId>mobicents-dahdi</artifactId>
=======================================
--- /hardware/dahdi/java/src/main/java/org/mobicents/media/hardware/dahdi/Channel.java Tue Jun 5 11:34:58 2012 +++ /hardware/dahdi/java/src/main/java/org/mobicents/media/hardware/dahdi/Channel.java Sun Jul 1 07:11:22 2012
@@ -61,6 +61,9 @@

     protected SelectorKey selectorKey;

+    protected int aLawCodec=2;
+    protected int muLawCodec=1;
+
     public Channel() {
     }

@@ -112,6 +115,22 @@
      */
     public native int openChannel(int id, int bufferSize);

+    public boolean setCodec(boolean isALaw)
+    {
+       int result;
+       if(isALaw)
+               result=configureChannel(fd, aLawCodec);
+       else
+               result=configureChannel(fd, muLawCodec);
+
+       return result>=0;
+    }
+
+    /**
+     *
+     */
+    public native int configureChannel(int fd, int codec);
+
     /**
      * Reads data from this pipe.
      *
=======================================
--- /hardware/dahdi/java/src/main/java/org/mobicents/media/hardware/dahdi/Selector.java Tue Jun 5 11:34:58 2012 +++ /hardware/dahdi/java/src/main/java/org/mobicents/media/hardware/dahdi/Selector.java Sun Jul 1 07:11:22 2012
@@ -80,7 +80,6 @@
         // perform actual registration
logger.info("Registering file descriptor:" + ((Channel) channel).fd);
         doRegister(((Channel) channel).fd);
-
         SelectorKeyImpl key = new SelectorKeyImpl(channel, this);
         channel.selectorKey = key;
         return key;
@@ -127,8 +126,8 @@

     public FastList<SelectorKey> selectNow(int ops, int timeout)
             throws IOException {
-       int count = doPoll(fds, ops, 20);
-        selected.clear();
+       int count = doPoll(fds, ops, 1);
+       selected.clear();
         for (int i = 0; i < count; i++) {
for (FastList.Node<Channel> n = registered.head(), end = registered
                     .tail(); (n = n.getNext()) != end;) {
=======================================
--- /hardware/dahdi/native/linux/pom.xml        Tue Jun  5 11:56:27 2012
+++ /hardware/dahdi/native/linux/pom.xml        Sun Jul  1 07:11:22 2012
@@ -4,7 +4,7 @@
        <parent>
                 <groupId>org.mobicents.media.hardware</groupId>
                 <artifactId>mobicents-media-hardware</artifactId>
-                <version>2.4.0-SNAPSHOT</version>
+                <version>2.4.0.CR1</version>
         </parent>

        <artifactId>libmobicents-dahdi-linux</artifactId>
=======================================
--- /hardware/dahdi/native/pom.xml      Tue Jun  5 11:56:27 2012
+++ /hardware/dahdi/native/pom.xml      Sun Jul  1 07:11:22 2012
@@ -4,10 +4,10 @@
        <parent>
                 <groupId>org.mobicents.media.hardware</groupId>
                 <artifactId>mobicents-dahdi-parent</artifactId>
-                <version>2.4.0-SNAPSHOT</version>
+                <version>2.4.0.CR1</version>
         </parent>

-       <artifactId>mobicents-dahdi-native</artifactId>
+       <artifactId>mobicents-dahdi-native</artifactId>

        <packaging>pom</packaging>

@@ -57,7 +57,7 @@
                                <module>linux</module>
                        </modules>
                </profile>
-               <!--profile>
+               <profile>
                        <id>maven-release</id>
                        <modules>
                                <module>linux</module>
@@ -68,7 +68,7 @@
                        <modules>
                                <module>linux</module>
                        </modules>
-               </profile-->
+               </profile>
        </profiles>

 </project>
=======================================
--- /hardware/dahdi/native/src/main/native/schannel.c Mon May 28 08:12:44 2012 +++ /hardware/dahdi/native/src/main/native/schannel.c Sun Jul 1 07:11:22 2012
@@ -40,15 +40,14 @@
     int res;
     int fd;

-    sprintf(devname,"/dev/dahdi/%d",zapid );
-
-
-
-    fd = open(devname, O_RDWR);
+    fd = open("/dev/dahdi/channel", O_RDWR);
     if (fd < 0) {
         return -1;
-    }
-
+    }
+       res = ioctl(fd, DAHDI_SPECIFY, &zapid);
+       if(res<0) {
+               return -1;
+       }

     bi.txbufpolicy = DAHDI_POLICY_IMMEDIATE;
     bi.rxbufpolicy = DAHDI_POLICY_IMMEDIATE;
@@ -62,8 +61,28 @@
         return -1;
     }

+       res = ioctl(fd, DAHDI_SET_BLOCKSIZE, &ioBufferSize);
+       if (res < 0) {
+        return -1;
+    }
+
+       int z = 1;
+       res = ioctl(fd, DAHDI_AUDIOMODE, &z);
+       if (res < 0) {
+        return -1;
+    }
+
     return fd;
 }
+
+static int configureChannel(jint fd,jint codec) {
+       int res = ioctl(fd, DAHDI_SETLAW, &codec);
+       if(res < 0) {
+               return -1;
+       }
+
+       return 0;
+}

JNIEXPORT void JNICALL Java_org_mobicents_media_hardware_dahdi_Selector_doRegister (JNIEnv *env, jobject obj, jint fd) {
     int i = channel_count;
@@ -155,7 +174,10 @@
     return openFileChannel(zapid,ioBufferSize);
 }

-
+JNIEXPORT jint JNICALL Java_org_mobicents_media_hardware_dahdi_Channel_configureChannel
+  (JNIEnv *env, jobject obj, jint fd, jint codec) {
+    return configureChannel(fd,codec);
+}

 /*
  * Class:     org_mobicents_media_server_impl_resource_zap_Schannel
@@ -266,6 +288,9 @@
  * Signature: ()V
  */
JNIEXPORT void JNICALL Java_org_mobicents_media_hardware_dahdi_Channel_closeChannel (JNIEnv *env, jobject obj, jint fd) {
+       int z = 0;
+       ioctl(fd, DAHDI_AUDIOMODE, &z);
+
     close(fd);
 }

=======================================
--- /hardware/dahdi/pom.xml     Tue Jun  5 11:56:27 2012
+++ /hardware/dahdi/pom.xml     Sun Jul  1 07:11:22 2012
@@ -4,7 +4,7 @@
        <parent>
                <groupId>org.mobicents.media.hardware</groupId>
                <artifactId>mobicents-media-hardware</artifactId>
-               <version>2.4.0-SNAPSHOT</version>
+               <version>2.4.0.CR1</version>
        </parent>

        <artifactId>mobicents-dahdi-parent</artifactId>
=======================================
--- /hardware/pom.xml   Tue Jun  5 11:56:27 2012
+++ /hardware/pom.xml   Sun Jul  1 07:11:22 2012
@@ -4,7 +4,7 @@
        <parent>
                <groupId>org.mobicents.media</groupId>
                <artifactId>server</artifactId>
-               <version>2.4.0-SNAPSHOT</version>
+               <version>2.4.0.CR1</version>
         </parent>

        <groupId>org.mobicents.media.hardware</groupId>
@@ -27,6 +27,12 @@
        <profiles>
                <profile>
                        <id>maven-release</id>
+                       <modules>
+                               <!--
+                               <module>dahdi</module>
+                                -->
+                               <module>dialogic</module>
+                       </modules>
                </profile>
        </profiles>

=======================================
--- /io/local/pom.xml   Tue Jun  5 11:56:27 2012
+++ /io/local/pom.xml   Sun Jul  1 07:11:22 2012
@@ -6,7 +6,7 @@
     <parent>
         <groupId>org.mobicents.media.io</groupId>
         <artifactId>io</artifactId>
-        <version>2.4.0-SNAPSHOT</version>
+        <version>2.4.0.CR1</version>
     </parent>

     <groupId>org.mobicents.media.io</groupId>
=======================================
--- /io/network/pom.xml Tue Jun  5 11:56:27 2012
+++ /io/network/pom.xml Sun Jul  1 07:11:22 2012
@@ -6,7 +6,7 @@
     <parent>
         <groupId>org.mobicents.media.io</groupId>
         <artifactId>io</artifactId>
-        <version>2.4.0-SNAPSHOT</version>
+        <version>2.4.0.CR1</version>
     </parent>

     <groupId>org.mobicents.media.io</groupId>
=======================================
--- /io/pom.xml Tue Jun  5 11:56:27 2012
+++ /io/pom.xml Sun Jul  1 07:11:22 2012
@@ -6,7 +6,7 @@
     <parent>
         <groupId>org.mobicents.media</groupId>
         <artifactId>server</artifactId>
-        <version>2.4.0-SNAPSHOT</version>
+        <version>2.4.0.CR1</version>
     </parent>

     <groupId>org.mobicents.media.io</groupId>
=======================================
--- /io/rtp/pom.xml     Tue Jun  5 11:56:27 2012
+++ /io/rtp/pom.xml     Sun Jul  1 07:11:22 2012
@@ -6,7 +6,7 @@
     <parent>
         <groupId>org.mobicents.media.io</groupId>
         <artifactId>io</artifactId>
-        <version>2.4.0-SNAPSHOT</version>
+        <version>2.4.0.CR1</version>
     </parent>

     <groupId>org.mobicents.media.io</groupId>
=======================================
--- /io/rtp/src/main/java/org/mobicents/media/server/impl/rtp/JitterBuffer.java Tue May 29 06:44:20 2012 +++ /io/rtp/src/main/java/org/mobicents/media/server/impl/rtp/JitterBuffer.java Sun Jul 1 07:11:22 2012
@@ -100,6 +100,8 @@
     //RTP dtmf event converter
     private DtmfConverter dtmfConverter;

+    private Boolean useBuffer=true;
+
private final static Logger logger = Logger.getLogger(JitterBuffer.class);
     /**
      * Creates new instance of jitter.
@@ -134,7 +136,7 @@
     public double getMaxJitter() {
         return 0;
     }
-
+
     /**
      * Get the number of dropped packets.
      *
@@ -143,6 +145,16 @@
     public int getDropped() {
         return dropCount;
     }
+
+    public boolean bufferInUse()
+    {
+       return this.useBuffer;
+    }
+
+    public void setBufferInUse(boolean useBuffer)
+    {
+       this.useBuffer=useBuffer;
+    }

     /**
      * Assigns listener for this buffer.
@@ -278,7 +290,7 @@

                //check if this buffer already full
                if (!ready) {
-                       ready = duration >= jitter && queue.size() > 1;
+                       ready = !useBuffer || (duration >= jitter && queue.size() 
> 1);
                        if (ready) {
                                if (listener != null) {
                                        listener.onFill();
=======================================
--- /io/rtp/src/main/java/org/mobicents/media/server/impl/rtp/RTPDataChannel.java Mon May 28 08:12:44 2012 +++ /io/rtp/src/main/java/org/mobicents/media/server/impl/rtp/RTPDataChannel.java Sun Jul 1 07:11:22 2012
@@ -202,10 +202,13 @@
             throw new SocketException(e.getMessage());
         }
         //bind data channel
-       if(!isLocal)
+       if(!isLocal) {
+               this.rxBuffer.setBufferInUse(true);
                rtpManager.udpManager.bind(dataChannel, PORT_ANY);
-       else
+       } else {
+               this.rxBuffer.setBufferInUse(false);
                rtpManager.udpManager.bindLocal(dataChannel, PORT_ANY);
+       }

         //if control enabled open rtcp channel as well
         if (rtpManager.isControlEnabled) {
=======================================
--- /io/rtp/src/main/java/org/mobicents/media/server/impl/rtp/RTPInput.java Mon May 28 08:12:44 2012 +++ /io/rtp/src/main/java/org/mobicents/media/server/impl/rtp/RTPInput.java Sun Jul 1 07:11:22 2012
@@ -65,8 +65,8 @@
        //digital signaling processor
     private Processor dsp;

-    private Integer preEvolveCount=0;
-    private Integer evolveCount=0;
+    protected Integer preEvolveCount=0;
+    protected Integer evolveCount=0;
        /**
      * Creates new receiver.
      */
@@ -122,7 +122,8 @@
                                System.out.println(e.getMessage());
                                e.printStackTrace();
                        }
-               }
+               }
+
         }

        return currFrame;
=======================================
--- /io/ss7/pom.xml     Tue Jun  5 11:56:27 2012
+++ /io/ss7/pom.xml     Sun Jul  1 07:11:22 2012
@@ -6,7 +6,7 @@
     <parent>
         <groupId>org.mobicents.media.io</groupId>
         <artifactId>io</artifactId>
-        <version>2.4.0-SNAPSHOT</version>
+        <version>2.4.0.CR1</version>
     </parent>

     <groupId>org.mobicents.media.io</groupId>
=======================================
***Additional files exist in this changeset.***

Reply via email to