Revision: 16067
Author: [email protected]
Date: Mon Dec 27 04:35:56 2010
Log: added specific linkset management here
http://code.google.com/p/mobicents/source/detail?r=16067
Added:
/trunk/protocols/ss7/hardware/dahdi/java/src/main/java/org/mobicents/ss7
/trunk/protocols/ss7/hardware/dahdi/java/src/main/java/org/mobicents/ss7/hardware
/trunk/protocols/ss7/hardware/dahdi/java/src/main/java/org/mobicents/ss7/hardware/dahdi
/trunk/protocols/ss7/hardware/dahdi/java/src/main/java/org/mobicents/ss7/hardware/dahdi/Channel.java
/trunk/protocols/ss7/hardware/dahdi/java/src/main/java/org/mobicents/ss7/hardware/dahdi/Selector.java
/trunk/protocols/ss7/hardware/dahdi/java/src/main/java/org/mobicents/ss7/hardware/dahdi/SelectorKeyImpl.java
/trunk/protocols/ss7/hardware/dahdi/java/src/main/java/org/mobicents/ss7/hardware/dahdi/oam
/trunk/protocols/ss7/hardware/dahdi/java/src/main/java/org/mobicents/ss7/hardware/dahdi/oam/DahdiLink.java
/trunk/protocols/ss7/hardware/dahdi/java/src/main/java/org/mobicents/ss7/hardware/dahdi/oam/DahdiLinkset.java
/trunk/protocols/ss7/hardware/dahdi/java/src/main/java/org/mobicents/ss7/hardware/dahdi/oam/DahdiLinksetFactory.java
/trunk/protocols/ss7/hardware/dialogic/java/src/main/java/org/mobicents/ss7
/trunk/protocols/ss7/hardware/dialogic/java/src/main/java/org/mobicents/ss7/hardware
/trunk/protocols/ss7/hardware/dialogic/java/src/main/java/org/mobicents/ss7/hardware/dialogic
/trunk/protocols/ss7/hardware/dialogic/java/src/main/java/org/mobicents/ss7/hardware/dialogic/InterProcessCommunicator.java
/trunk/protocols/ss7/hardware/dialogic/java/src/main/java/org/mobicents/ss7/hardware/dialogic/oam
/trunk/protocols/ss7/hardware/dialogic/java/src/main/java/org/mobicents/ss7/hardware/dialogic/oam/DialogicLinkset.java
/trunk/protocols/ss7/hardware/dialogic/java/src/main/java/org/mobicents/ss7/hardware/dialogic/oam/DialogicLinksetFactory.java
/trunk/protocols/ss7/hardware/m3ua
/trunk/protocols/ss7/hardware/m3ua/pom.xml
/trunk/protocols/ss7/hardware/m3ua/src
/trunk/protocols/ss7/hardware/m3ua/src/main
/trunk/protocols/ss7/hardware/m3ua/src/main/java
/trunk/protocols/ss7/hardware/m3ua/src/main/java/org
/trunk/protocols/ss7/hardware/m3ua/src/main/java/org/mobicents
/trunk/protocols/ss7/hardware/m3ua/src/main/java/org/mobicents/ss7
/trunk/protocols/ss7/hardware/m3ua/src/main/java/org/mobicents/ss7/m3ua
/trunk/protocols/ss7/hardware/m3ua/src/main/java/org/mobicents/ss7/m3ua/oam
/trunk/protocols/ss7/hardware/m3ua/src/main/java/org/mobicents/ss7/m3ua/oam/M3UALinkset.java
/trunk/protocols/ss7/hardware/m3ua/src/main/java/org/mobicents/ss7/m3ua/oam/M3UALinksetFactory.java
Deleted:
/trunk/protocols/ss7/hardware/dahdi/java/src/main/java/org/mobicents/protocols/ss7/hardware/Mtp1.java
/trunk/protocols/ss7/hardware/dahdi/java/src/main/java/org/mobicents/protocols/ss7/hardware/dahdi
/trunk/protocols/ss7/hardware/dialogic/java/src/main/java/org/mobicents/protocols/ss7/hardware/dialogic
Modified:
/trunk/protocols/ss7/hardware/dahdi/java/pom.xml
/trunk/protocols/ss7/hardware/dahdi/native/linux/pom.xml
/trunk/protocols/ss7/hardware/dahdi/native/pom.xml
/trunk/protocols/ss7/hardware/dahdi/native/src/main/native/schannel.c
/trunk/protocols/ss7/hardware/dialogic/java/pom.xml
/trunk/protocols/ss7/hardware/dialogic/native/linux/pom.xml
/trunk/protocols/ss7/hardware/dialogic/native/pom.xml
/trunk/protocols/ss7/hardware/dialogic/native/src/main/native/ipc.c
/trunk/protocols/ss7/hardware/pom.xml
=======================================
--- /dev/null
+++
/trunk/protocols/ss7/hardware/dahdi/java/src/main/java/org/mobicents/ss7/hardware/dahdi/Channel.java
Mon Dec 27 04:35:56 2010
@@ -0,0 +1,210 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright XXXX, Red Hat Middleware LLC, and individual contributors as
indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a full listing
+ * of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU General Public License, v. 2.0.
+ * This program is distributed in the hope that it will be useful, but
WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ * You should have received a copy of the GNU General Public License,
+ * v. 2.0 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+package org.mobicents.ss7.hardware.dahdi;
+
+import java.io.IOException;
+
+import org.mobicents.protocols.ss7.mtp.Mtp1;
+import org.mobicents.protocols.stream.api.SelectorKey;
+import org.mobicents.protocols.stream.api.SelectorProvider;
+import org.mobicents.protocols.stream.api.StreamSelector;
+
+/**
+ *
+ * @author kulikov
+ * @author baranowb
+ * @author amit bhayani
+ */
+public class Channel implements Mtp1 {
+
+ private final static String LIB_NAME = "mobicents-dahdi-linux";
+
+ static {
+ try {
+ System.loadLibrary(LIB_NAME);
+ System.out.println("Loaded library
mobicents-dahdi-linux");
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ private int span;
+ private int channelID;
+ private int code;
+ private String linkName;
+ private int ioBufferSize = 32; // lets default to 32, it seems optimal.
+ protected int fd;
+
+ private Object link;
+
+ protected SelectorKey selectorKey;
+
+ public Channel() {
+ }
+
+ public int getSpan() {
+ return span;
+ }
+
+ public void setSpan(int span) {
+ this.span = span;
+ }
+
+ public int getChannelID() {
+ return channelID;
+ }
+
+ public void setChannelID(int channelID) {
+ this.channelID = channelID;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setLinkName(String linkName) {
+ this.linkName = linkName;
+ }
+
+ public String getLinkName() {
+ return linkName;
+ }
+
+ public int getIOBufferSize() {
+ return ioBufferSize;
+ }
+
+ public void setIOBufferSize(int bufferSize) {
+ this.ioBufferSize = bufferSize;
+ }
+
+ public void open() {
+ int zapid = 31 * (span - 1) + channelID;
+ fd = openChannel(zapid, ioBufferSize);
+ }
+
+ /**
+ * Opens this channel and prepares it for reading.
+ *
+ * @param id
+ * - id of zap device, its appended at the end of path, for
+ * instance: /dev/dahdi/${id}
+ * @param bufferSize
+ * - size of buffer to be used for I/O ops.
+ */
+ public native int openChannel(int id, int bufferSize);
+
+ /**
+ * Reads data from this pipe.
+ *
+ * @param buffer
+ * the byte buffer to read data.
+ * @return the number of bytes actualy read.
+ */
+ public int read(byte[] buffer) throws IOException {
+ return readData(fd, buffer);
+ }
+
+ public native int readData(int fd, byte[] buffer);
+
+ /**
+ * Writes specified data to the pipe.
+ *
+ * @param buffer
+ * the buffer with data to write
+ * @param len
+ * the length of the buffer.
+ */
+ public int write(byte[] buffer) throws IOException {
+ writeData(fd, buffer, buffer.length);
+ return buffer.length; //?
+ }
+
+ public native void writeData(int fd, byte[] buffer, int len);
+
+ /**
+ * Registers pipe for polling.
+ *
+ * @param fd
+ * the file descriptor.
+ */
+ public native void doRegister(int fd);
+
+ /**
+ * Unregisters pipe from polling.
+ *
+ * @param fd
+ * the file descriptor.
+ */
+ public native void doUnregister(int fd);
+
+ public void close() {
+ closeChannel(fd);
+ }
+
+ /**
+ * Closes this pipe.
+ */
+ public native void closeChannel(int fd);
+
+ @Override
+ public String toString() {
+ return Integer.toString(channelID);
+ }
+
+ public void setLink(Object link) {
+ this.link = link;
+ }
+
+ public Object getLink() {
+ return this.link;
+ }
+
+ protected void doRegister(StreamSelector selector) {
+ doRegister(fd);
+ }
+
+ protected void doUnregister(StreamSelector selector) {
+ doUnregister(fd);
+ }
+
+ public boolean isReadable() {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public boolean isWriteable() {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public SelectorProvider provider() {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public SelectorKey register(StreamSelector selector) throws IOException
{
+ return ((Selector) selector).register(this);
+ }
+
+ public void write(byte[] data, int len) throws IOException {
+ this.writeData(fd, data, len);
+ }
+
+}
=======================================
--- /dev/null
+++
/trunk/protocols/ss7/hardware/dahdi/java/src/main/java/org/mobicents/ss7/hardware/dahdi/Selector.java
Mon Dec 27 04:35:56 2010
@@ -0,0 +1,154 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright XXXX, Red Hat Middleware LLC, and individual contributors as
indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a full listing
+ * of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU General Public License, v. 2.0.
+ * This program is distributed in the hope that it will be useful, but
WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ * You should have received a copy of the GNU General Public License,
+ * v. 2.0 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+package org.mobicents.ss7.hardware.dahdi;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.apache.log4j.Logger;
+import org.mobicents.protocols.ss7.mtp.Mtp1;
+import org.mobicents.protocols.stream.api.SelectorKey;
+import org.mobicents.protocols.stream.api.Stream;
+import org.mobicents.protocols.stream.api.StreamSelector;
+
+public class Selector implements StreamSelector {
+
+ private final static String LIB_NAME = "mobicents-dahdi-linux";
+
+ public final static int READ = 0x01;
+ public final static int WRITE = 0x02;
+
+ /** array of selected file descriptors */
+ private int fds[] = new int[16];
+
+ /** array of registered channels */
+ private ArrayList<Mtp1> registered = new ArrayList();
+
+ private int ops;
+
+ /** array of selected channels */
+ private ArrayList<SelectorKey> selected = new ArrayList();
+ private static Logger logger = Logger.getLogger(Selector.class);
+
+ static {
+ try {
+ System.loadLibrary(LIB_NAME);
+ System.out.println("Loaded library
mobicents-dahdi-linux");
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ public Selector() {
+
+ }
+
+ /**
+ * Register channel with this selector.
+ *
+ * @param channel the channel to register.
+ */
+ public SelectorKey register(Channel channel) {
+ //add channel instance to the collection
+ registered.add(channel);
+ //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;
+ }
+
+ /**
+ * Unregister channel.
+ *
+ * @param channel the channel to unregister.
+ */
+ public void unregister(Channel channel) {
+ registered.remove(channel);
+ channel.selectorKey = null;
+ doUnregister(((Channel)channel).fd);
+ }
+
+ /**
+ * Registers pipe for polling.
+ *
+ *...@param fd the file descriptor.
+ */
+ public native void doRegister(int fd);
+
+ /**
+ * Unregisters pipe from polling.
+ *
+ * @param fd the file descriptor.
+ */
+ public native void doUnregister(int fd);
+
+ /**
+ * Delegates select call to unix poll function.
+ *
+ * @param fds the list of file descriptors.
+ * @param key selection key.
+ * @return the number of selected channels.
+ */
+ public native int doPoll(int[] fds, int key, int timeout);
+
+ public Collection<SelectorKey> selectNow(int ops, int timeout) throws
IOException {
+ int count = doPoll(fds, ops, 20);
+ selected.clear();
+ for (int i = 0; i < count; i++) {
+ for (Mtp1 chan : registered) {
+ Channel channel = (Channel) chan;
+ if (channel.fd == fds[i]) {
+ selected.add(channel.selectorKey);
+ }
+ }
+ }
+ return selected;
+ }
+
+ public void setOperation(int v) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public int getOperations() {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public boolean isReadOperation() {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public boolean isWriteOperation() {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public boolean isClosed() {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public void close() {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public Collection<Stream> getRegisteredStreams() {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+}
=======================================
--- /dev/null
+++
/trunk/protocols/ss7/hardware/dahdi/java/src/main/java/org/mobicents/ss7/hardware/dahdi/SelectorKeyImpl.java
Mon Dec 27 04:35:56 2010
@@ -0,0 +1,64 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package org.mobicents.ss7.hardware.dahdi;
+
+import org.mobicents.protocols.stream.api.SelectorKey;
+import org.mobicents.protocols.stream.api.Stream;
+import org.mobicents.protocols.stream.api.StreamSelector;
+
+/**
+ *
+ * @author kulikov
+ */
+public class SelectorKeyImpl implements SelectorKey {
+
+ private boolean isValid;
+ private boolean isReadable;
+ private boolean isWritable;
+
+ private Channel channel;
+ private Selector selector;
+
+ private Object attachment;
+
+ protected SelectorKeyImpl(Channel channel, Selector selector) {
+ this.channel = channel;
+ this.selector = selector;
+ }
+
+ public boolean isValid() {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public boolean isReadable() {
+ return isReadable;
+ }
+
+ public boolean isWriteable() {
+ return isWritable;
+ }
+
+ public Stream getStream() {
+ return channel;
+ }
+
+ public StreamSelector getStreamSelector() {
+ return selector;
+ }
+
+ public void cancel() {
+ selector.unregister(channel);
+ }
+
+ public void attach(Object obj) {
+ this.attachment = obj;
+ }
+
+ public Object attachment() {
+ return this.attachment;
+ }
+
+}
=======================================
--- /dev/null
+++
/trunk/protocols/ss7/hardware/dahdi/java/src/main/java/org/mobicents/ss7/hardware/dahdi/oam/DahdiLink.java
Mon Dec 27 04:35:56 2010
@@ -0,0 +1,157 @@
+package org.mobicents.ss7.hardware.dahdi.oam;
+
+import java.nio.ByteBuffer;
+
+import javolution.xml.XMLFormat;
+import javolution.xml.stream.XMLStreamException;
+
+import org.mobicents.protocols.ss7.mtp.Mtp2;
+import org.mobicents.ss7.hardware.dahdi.Channel;
+import org.mobicents.ss7.linkset.oam.Link;
+import org.mobicents.ss7.linkset.oam.LinkMode;
+import org.mobicents.ss7.linkset.oam.LinkState;
+
+/**
+ *
+ * @author amit bhayani
+ *
+ */
+public class DahdiLink extends Link {
+
+ private int span = -1;
+ private int channelID = -1;
+ private int code = -1;
+
+ // TODO : Should Buffer Size also configurable from command line?
+ private int ioBufferSize = 32;
+
+ private static final String LINK_SPAN = "span";
+ private static final String LINK_CHANNEL_ID = "channelId";
+ private static final String LINK_CODE = "code";
+ private static final String LINK_IO_BUFFER_SIZE = "iOBufferSize";
+
+ private Channel channel = null;
+ private Mtp2 mtp2 = null;
+
+ public DahdiLink() {
+ }
+
+ public DahdiLink(String linkName) {
+ super(linkName);
+ }
+
+ @Override
+ protected void init() {
+
+ if (this.mode == LinkMode.CONFIGURED) {
+ if (this.channel == null) {
+ channel = new Channel();
+ mtp2 = new Mtp2(this.linkName.toString() + "-" + this.code,
+ this.channel); // TODO : Optimize the String usage
+ }
+
+ channel.setChannelID(this.channelID);
+ channel.setCode(this.code);
+ channel.setIOBufferSize(this.ioBufferSize);
+ channel.setLinkName(this.linkName.toString());
+ channel.setSpan(this.span);
+ }
+ }
+
+ public int getSpan() {
+ return span;
+ }
+
+ public void setSpan(int span) {
+ this.span = span;
+ }
+
+ public int getChannelID() {
+ return channelID;
+ }
+
+ public void setChannelID(int channelID) {
+ this.channelID = channelID;
+ }
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public int getIoBufferSize() {
+ return ioBufferSize;
+ }
+
+ public void setIoBufferSize(int ioBufferSize) {
+ this.ioBufferSize = ioBufferSize;
+ }
+
+ @Override
+ public boolean noShutdown(ByteBuffer byteBuffer) {
+ if (this.state == LinkState.AVAILABLE) {
+ byteBuffer.put(LINK_ALREADY_ACTIVE);
+ return FALSE;
+ }
+
+ // Add check that all parameters are set before initializing the
+ // Link. Else send error message
+ if (this.span == -1 || this.code == -1 || this.channelID == -1) {
+ byteBuffer.put(LINK_NOT_CONFIGURED);
+ return FALSE;
+ }
+
+ this.mode = LinkMode.CONFIGURED;
+
+ this.init();
+ return TRUE;
+ }
+
+ /**
+ * Management Operations
+ */
+ public void shutdown(ByteBuffer byteBuffer) {
+
+ }
+
+ protected static final XMLFormat<DahdiLink> DAHDI_LINK_XML = new
XMLFormat<DahdiLink>(
+ DahdiLink.class) {
+
+ @Override
+ public void read(javolution.xml.XMLFormat.InputElement xml,
+ DahdiLink link) throws XMLStreamException {
+
+ LINK_XML.read(xml, link);
+
+ link.span = xml.getAttribute(LINK_SPAN, -1);
+ link.channelID = xml.getAttribute(LINK_CHANNEL_ID, -1);
+ link.code = xml.getAttribute(LINK_CODE, -1);
+ link.ioBufferSize = xml.getAttribute(LINK_IO_BUFFER_SIZE, 32);
+
+ link.init();
+ }
+
+ @Override
+ public void write(DahdiLink link,
+ javolution.xml.XMLFormat.OutputElement xml)
+ throws XMLStreamException {
+
+ LINK_XML.write(link, xml);
+
+ xml.setAttribute(LINK_SPAN, link.getSpan());
+ xml.setAttribute(LINK_CHANNEL_ID, link.getChannelID());
+ xml.setAttribute(LINK_CODE, link.getCode());
+ xml.setAttribute(LINK_IO_BUFFER_SIZE, link.getIoBufferSize());
+ }
+ };
+
+ /**
+ *
+ */
+ protected Mtp2 getMtp2() {
+ return this.mtp2;
+ }
+}
=======================================
--- /dev/null
+++
/trunk/protocols/ss7/hardware/dahdi/java/src/main/java/org/mobicents/ss7/hardware/dahdi/oam/DahdiLinkset.java
Mon Dec 27 04:35:56 2010
@@ -0,0 +1,190 @@
+package org.mobicents.ss7.hardware.dahdi.oam;
+
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.util.concurrent.ConcurrentLinkedQueue;
+
+import javolution.util.FastMap;
+import javolution.xml.XMLFormat;
+import javolution.xml.stream.XMLStreamException;
+
+import org.mobicents.protocols.ss7.mtp.Mtp3;
+import org.mobicents.protocols.ss7.mtp.Mtp3Listener;
+import org.mobicents.ss7.linkset.oam.Link;
+import org.mobicents.ss7.linkset.oam.LinkMode;
+import org.mobicents.ss7.linkset.oam.Linkset;
+import org.mobicents.ss7.linkset.oam.LinksetMode;
+import org.mobicents.ss7.linkset.oam.LinksetState;
+import org.mobicents.ss7.linkset.oam.LinkOAMMessages;
+
+/**
+ *
+ * @author amit bhayani
+ *
+ */
+public class DahdiLinkset extends Linkset implements Mtp3Listener {
+
+ private Mtp3 mtp3 = null;
+ private ConcurrentLinkedQueue<byte[]> queue = new
ConcurrentLinkedQueue();
+
+ public DahdiLinkset() {
+ super();
+ }
+
+ public DahdiLinkset(String linksetName, int opc, int dpc, int ni) {
+ super(linksetName, opc, dpc, ni);
+ }
+
+ @Override
+ protected void init() {
+
+ if (this.mode == LinksetMode.CONFIGURED) {
+
+ if (this.mtp3 == null) {
+ // TODO fix String to TextBuilder
+ this.mtp3 = new Mtp3(this.linksetName);
+ }
+
+ this.mtp3.clearLinks();
+ this.mtp3.addMtp3Listener(this);
+
+ for (FastMap.Entry<String, Link> e = this.links.head(), end =
this.links
+ .tail(); (e = e.getNext()) != end;) {
+ Link value = e.getValue();
+ if (value.getMode() == LinkMode.CONFIGURED) {
+ this.mtp3.addLink(((DahdiLink) value).getMtp2());
+ }
+ }
+
+ if (this.state != LinksetState.SHUTDOWN) {
+ try {
+ this.mtp3.start();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ }
+
+ /**
+ * Operations
+ */
+ @Override
+ public boolean addLink(String linkName, ByteBuffer byteBuffer) {
+
+ if (links.containsKey(linkName)) {
+ byteBuffer.put(LinkOAMMessages.LINK_ALREADY_EXIST);
+ return FALSE;
+ }
+
+ DahdiLink link = new DahdiLink(linkName);
+ link.setLinkSet(this);
+
+ this.links.put(linkName, link);
+
+ // Send back success message
+ byteBuffer.put(LinkOAMMessages.LINK_SUCCESSFULLY_ADDED);
+ return TRUE;
+
+ }
+
+ @Override
+ public boolean noShutdown(ByteBuffer byteBuffer) {
+ if (this.state == LinksetState.AVAILABLE) {
+ byteBuffer.put(LinkOAMMessages.LINKSET_ALREADY_ACTIVE);
+ return FALSE;
+ }
+
+ // Check if atleast one Link is in Configured mode
+ for (FastMap.Entry<String, Link> e = this.links.head(), end =
this.links
+ .tail(); (e = e.getNext()) != end;) {
+ Link value = e.getValue();
+ if (value.getMode() == LinkMode.CONFIGURED) {
+ this.mode = LinksetMode.CONFIGURED;
+ break;
+ }
+
+ }
+
+ // If at least 1 Link is configured, lets start Mtp3
+ if (this.mode == LinksetMode.CONFIGURED) {
+ this.init();
+ return TRUE;
+ }
+
+ byteBuffer.put(LinkOAMMessages.LINKSET_NO_LINKS_CONFIGURED);
+ return FALSE;
+
+ }
+
+ /**
+ * XML Serialization/Deserialization
+ */
+ protected static final XMLFormat<DahdiLinkset> DAHDI_LINKSET_XML = new
XMLFormat<DahdiLinkset>(
+ DahdiLinkset.class) {
+
+ @Override
+ public void read(javolution.xml.XMLFormat.InputElement xml,
+ DahdiLinkset linkSet) throws XMLStreamException {
+ LINKSET_XML.read(xml, linkSet);
+
+ linkSet.init();
+ }
+
+ @Override
+ public void write(DahdiLinkset linkSet,
+ javolution.xml.XMLFormat.OutputElement xml)
+ throws XMLStreamException {
+ LINKSET_XML.write(linkSet, xml);
+ }
+ };
+
+ /**
+ * Stream implementation methods
+ */
+
+ @Override
+ protected boolean poll(int operation, int timeout) {
+ if (mtp3 != null) {
+ mtp3.run();
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ @Override
+ public int read(byte[] paramArrayOfByte) throws IOException {
+ if (queue.isEmpty()) {
+ return 0;
+ }
+ paramArrayOfByte = queue.poll();
+ return paramArrayOfByte == null ? 0 : paramArrayOfByte.length;
+ }
+
+ @Override
+ public int write(byte[] paramArrayOfByte) throws IOException {
+ mtp3.send(paramArrayOfByte, paramArrayOfByte.length);
+ return paramArrayOfByte.length;
+ }
+
+ // TODO : We still working with Listener model. rather change MTP3 to
give
+ // back byte[] and caller calls .read(byte[] data) to read data
+ /**
+ * Mtp3Listener Methods
+ */
+ public void linkDown() {
+ this.state = LinksetState.UNAVAILABLE;
+
+ }
+
+ public void linkUp() {
+ queue.clear();
+ this.state = LinksetState.AVAILABLE;
+ }
+
+ public void receive(byte[] msgBuff) {
+ queue.offer(msgBuff);
+ }
+
+}
=======================================
--- /dev/null
+++
/trunk/protocols/ss7/hardware/dahdi/java/src/main/java/org/mobicents/ss7/hardware/dahdi/oam/DahdiLinksetFactory.java
Mon Dec 27 04:35:56 2010
@@ -0,0 +1,92 @@
+package org.mobicents.ss7.hardware.dahdi.oam;
+
+import org.mobicents.ss7.linkset.oam.Linkset;
+import org.mobicents.ss7.linkset.oam.LinksetFactory;
+
+/**
+ *
+ * @author amit bhayani
+ *
+ */
+public class DahdiLinksetFactory extends LinksetFactory {
+
+ private static final String NAME = "dahdi";
+
+ public DahdiLinksetFactory() {
+ }
+
+ @Override
+ public String getName() {
+ return NAME;
+ }
+
+ @Override
+ public Linkset createLinkset(String[] options) {
+
+ // opc 1 dpc 2 ni 3 linkset1
+ if (options.length < 7) {
+ return null;
+ }
+
+ String option = null;
+ int i = 0;
+ while (i < 7 && ((option = options[i]) == null)) {
+ i++;
+ }
+
+ // If offset + command length is not equal to options length
+ if (i + 7 != options.length) {
+ return null;
+ }
+
+ // If first option is not OPC
+ if (option.compareTo("opc") != 0) {
+ return null;
+ }
+
+ i++;
+ int opc;
+ try {
+ opc = Integer.parseInt(options[i]);
+ } catch (NumberFormatException e) {
+ return null;
+ }
+
+ i++;
+
+ if (options[i].compareTo("dpc") != 0) {
+ return null;
+ }
+
+ i++;
+
+ int dpc;
+ try {
+ dpc = Integer.parseInt(options[i]);
+ } catch (NumberFormatException e) {
+ return null;
+ }
+
+ i++;
+
+ if (options[i].compareTo("ni") != 0) {
+ return null;
+ }
+
+ i++;
+
+ int ni;
+ try {
+ ni = Integer.parseInt(options[i]);
+ } catch (NumberFormatException e) {
+ return null;
+ }
+
+ i++;
+
+ String name = options[i];
+
+ return new DahdiLinkset(name, opc, dpc, ni);
+ }
+
+}
=======================================
--- /dev/null
+++
/trunk/protocols/ss7/hardware/dialogic/java/src/main/java/org/mobicents/ss7/hardware/dialogic/InterProcessCommunicator.java
Mon Dec 27 04:35:56 2010
@@ -0,0 +1,94 @@
+/*
+ * The Java Call Control API for CAMEL 2
+ *
+ * The source code contained in this file is in in the public domain.
+ * It can be used in any project or product without prior permission,
+ * license or royalty payments. There is NO WARRANTY OF ANY KIND,
+ * EXPRESS, IMPLIED OR STATUTORY, INCLUDING, WITHOUT LIMITATION,
+ * THE IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE,
+ * AND DATA ACCURACY. We do not warrant or make any representations
+ * regarding the use of the software or the results thereof, including
+ * but not limited to the correctness, accuracy, reliability or
+ * usefulness of the software.
+ */
+
+package org.mobicents.ss7.hardware.dialogic;
+
+import java.io.IOException;
+
+/**
+ *
+ * @author Oleg Kulikov
+ */
+public class InterProcessCommunicator {
+ /** The identifier of the originated module */
+ private int source;
+ /** The identifier of the destination module */
+ private int destination;
+
+ /**
+ * Creates a new instance of InterProcessCommunicator
+ *
+ * @param source the integer identifier of the originated module
+ * @param destination the integer idenifier of the destination module.
+ */
+ public InterProcessCommunicator(int source, int destination) {
+ this.source = source;
+ this.destination = destination;
+ }
+
+ /**
+ * Receives a datagram from GCT Interprocess.
+ *
+ * @return received datagram.
+ */
+ public byte[] receive() throws IOException {
+ byte[] buffer = new byte[1000];
+ int len = receive(source, buffer);
+
+ if (len == -1) {
+ throw new IOException("Unable to read message from IPC");
+ }
+
+ byte[] message = new byte[len];
+ System.arraycopy(buffer, 0, message, 0, len);
+
+ return message;
+ }
+
+
+ /**
+ * Sends datagram to the destination module.
+ *
+ * @param packet the datagram to be sent.
+ */
+ public void send(byte[] packet) throws IOException {
+ int status = send(source, destination, packet);
+ if (status != 0) {
+ throw new IOException("Can not send packet");
+ }
+ }
+
+ /**
+ * Actualy receives datagram using Interprocces communication.
+ *
+ * @param source indicates the module id wich will receive datagrams.
+ * @param buffer the buffer wich should be used to store recevied
message.
+ * @return the actual length of the received message.
+ */
+ private native int receive(int source, byte[] buffer);
+
+ /**
+ * Actualy sends the message using interprocces communication.
+ *
+ * @param source the module id wich sends message.
+ * @param destionation the module id wich must receive message.
+ * @param buffer the buffer contained message.
+ * @return the number of actualy bytes sent.
+ */
+ private native int send(int source, int destination, byte[] buffer);
+
+ static {
+ System.loadLibrary("ipc");
+ }
+}
=======================================
--- /dev/null
+++
/trunk/protocols/ss7/hardware/dialogic/java/src/main/java/org/mobicents/ss7/hardware/dialogic/oam/DialogicLinkset.java
Mon Dec 27 04:35:56 2010
@@ -0,0 +1,69 @@
+package org.mobicents.ss7.hardware.dialogic.oam;
+
+import java.io.IOException;
+import java.nio.ByteBuffer;
+
+import org.mobicents.ss7.linkset.oam.LinkOAMMessages;
+import org.mobicents.ss7.linkset.oam.Linkset;
+import org.mobicents.ss7.linkset.oam.LinksetState;
+
+/**
+ *
+ * @author amit bhayani
+ *
+ */
+public class DialogicLinkset extends Linkset {
+
+ public DialogicLinkset() {
+ super();
+ }
+
+ public DialogicLinkset(String linkSetName, String type) {
+ super(linkSetName, type);
+ }
+
+ @Override
+ protected void init() {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public boolean noShutdown(ByteBuffer byteBuffer) {
+ if (this.state == LinksetState.AVAILABLE) {
+ byteBuffer.put(LinkOAMMessages.LINKSET_ALREADY_ACTIVE);
+ return FALSE;
+ }
+
+ // TODO Start Dialogic Linkset
+ return FALSE;
+ }
+
+ @Override
+ public boolean addLink(String linkName, ByteBuffer byteBuffer) {
+ return FALSE;
+ }
+
+ /**
+ * Stream implementation methods
+ */
+
+ @Override
+ protected boolean poll(int operation, int timeout) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public int read(byte[] paramArrayOfByte) throws IOException {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public int write(byte[] paramArrayOfByte) throws IOException {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+}
=======================================
--- /dev/null
+++
/trunk/protocols/ss7/hardware/dialogic/java/src/main/java/org/mobicents/ss7/hardware/dialogic/oam/DialogicLinksetFactory.java
Mon Dec 27 04:35:56 2010
@@ -0,0 +1,29 @@
+package org.mobicents.ss7.hardware.dialogic.oam;
+
+import org.mobicents.ss7.linkset.oam.Linkset;
+import org.mobicents.ss7.linkset.oam.LinksetFactory;
+
+/**
+ *
+ * @author amit bhayani
+ *
+ */
+public class DialogicLinksetFactory extends LinksetFactory {
+
+ private static final String NAME = "dialogic";
+
+ public DialogicLinksetFactory() {
+ super();
+ }
+
+ @Override
+ public String getName() {
+ return NAME;
+ }
+
+ @Override
+ public Linkset createLinkset(String[] options) {
+ return null;
+ }
+
+}
=======================================
--- /dev/null
+++ /trunk/protocols/ss7/hardware/m3ua/pom.xml Mon Dec 27 04:35:56 2010
@@ -0,0 +1,28 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <packaging>jar</packaging>
+ <parent>
+ <groupId>org.mobicents.protocols.ss7.hardware</groupId>
+ <artifactId>mobicents-hardware</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>mobicents-m3ua</artifactId>
+
+ <name>Mobicents SS7 M3UA Hardware</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>javolution</groupId>
+ <artifactId>javolution</artifactId>
+ </dependency>
+ <dependency>
+
<groupId>org.mobicents.protocols.ss7.management</groupId>
+ <artifactId>linkset</artifactId>
+ <version>${hardware.version}</version>
+ </dependency>
+ </dependencies>
+
+</project>
=======================================
--- /dev/null
+++
/trunk/protocols/ss7/hardware/m3ua/src/main/java/org/mobicents/ss7/m3ua/oam/M3UALinkset.java
Mon Dec 27 04:35:56 2010
@@ -0,0 +1,128 @@
+package org.mobicents.ss7.m3ua.oam;
+
+import java.io.IOException;
+import java.nio.ByteBuffer;
+
+import javolution.text.TextBuilder;
+import javolution.xml.XMLFormat;
+import javolution.xml.stream.XMLStreamException;
+
+import org.mobicents.ss7.linkset.oam.LinkOAMMessages;
+import org.mobicents.ss7.linkset.oam.Linkset;
+import org.mobicents.ss7.linkset.oam.LinksetState;
+
+/**
+ *
+ * @author amit bhayani
+ *
+ */
+public class M3UALinkset extends Linkset {
+
+ private static final String LINKSET_LOCAL_ADDRESS = "addr";
+ private static final String LINKSET_LOCAL_PORT = "port";
+
+ private TextBuilder localAddress = TextBuilder.newInstance();
+ private int localPort;
+
+ public M3UALinkset() {
+
+ }
+
+ public M3UALinkset(String linkSetName, String type) {
+ super(linkSetName, type);
+ }
+
+ @Override
+ protected void init() {
+ // TODO Auto-generated method stub
+
+ }
+
+ public TextBuilder getLocalAddress() {
+ return localAddress;
+ }
+
+ public void setLocalAddress(TextBuilder localAddress) {
+ for (int i = 0; i < localAddress.length(); i++) {
+ this.localAddress.append(localAddress.charAt(i));
+ }
+ }
+
+ public int getLocalPort() {
+ return localPort;
+ }
+
+ public void setLocalPort(int localPort) {
+ this.localPort = localPort;
+ }
+
+ /**
+ * Operations
+ */
+
+ @Override
+ public boolean addLink(String linkName, ByteBuffer byteBuffer) {
+ return FALSE;
+ }
+
+ @Override
+ public boolean noShutdown(ByteBuffer byteBuffer) {
+ if (this.state == LinksetState.AVAILABLE) {
+ byteBuffer.put(LinkOAMMessages.LINKSET_ALREADY_ACTIVE);
+ return FALSE;
+ }
+
+ // TODO : Add check that all parameters are set before starting the
+ // Link. Else send error message
+ return FALSE;
+ }
+
+ /**
+ * XML Serialization/Deserialization
+ */
+ protected static final XMLFormat<M3UALinkset> M3UA_LINKSET_XML = new
XMLFormat<M3UALinkset>(
+ M3UALinkset.class) {
+
+ @Override
+ public void read(javolution.xml.XMLFormat.InputElement xml,
+ M3UALinkset linkSet) throws XMLStreamException {
+ linkSet.localAddress
+ .append(xml.getAttribute(LINKSET_LOCAL_ADDRESS));
+ linkSet.localPort = xml.getAttribute(LINKSET_LOCAL_PORT, 0);
+ LINKSET_XML.read(xml, linkSet);
+ }
+
+ @Override
+ public void write(M3UALinkset linkSet,
+ javolution.xml.XMLFormat.OutputElement xml)
+ throws XMLStreamException {
+ xml.setAttribute(LINKSET_LOCAL_ADDRESS, linkSet.localAddress
+ .toString());
+ xml.setAttribute(LINKSET_LOCAL_PORT, linkSet.localPort);
+ LINKSET_XML.write(linkSet, xml);
+ }
+ };
+
+ /**
+ * Stream implementation methods
+ */
+
+ @Override
+ protected boolean poll(int operation, int timeout) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public int read(byte[] paramArrayOfByte) throws IOException {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public int write(byte[] paramArrayOfByte) throws IOException {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+}
=======================================
--- /dev/null
+++
/trunk/protocols/ss7/hardware/m3ua/src/main/java/org/mobicents/ss7/m3ua/oam/M3UALinksetFactory.java
Mon Dec 27 04:35:56 2010
@@ -0,0 +1,29 @@
+package org.mobicents.ss7.m3ua.oam;
+
+import org.mobicents.ss7.linkset.oam.Linkset;
+import org.mobicents.ss7.linkset.oam.LinksetFactory;
+
+/**
+ *
+ * @author amit bhayani
+ *
+ */
+public class M3UALinksetFactory extends LinksetFactory {
+
+ private static final String NAME = "m3ua";
+
+ public M3UALinksetFactory() {
+ super();
+ }
+
+ @Override
+ public String getName() {
+ return NAME;
+ }
+
+ @Override
+ public Linkset createLinkset(String[] options) {
+ return null;
+ }
+
+}
=======================================
---
/trunk/protocols/ss7/hardware/dahdi/java/src/main/java/org/mobicents/protocols/ss7/hardware/Mtp1.java
Fri Dec 17 02:11:58 2010
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Mobicents, Communications Middleware
- *
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party
- * contributors as
- * indicated by the @author tags or express copyright attribution
- * statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
- *
- * This copyrighted material is made available to anyone wishing to use,
modify,
- * copy, or redistribute it subject to the terms and conditions of the GNU
- * Lesser General Public License, as published by the Free Software
Foundation.
- *
- * This program 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 distribution; if not, write to:
- * Free Software Foundation, Inc.
- * 51 Franklin Street, Fifth Floor
- *
- * Boston, MA 02110-1301 USA
- */
-package org.mobicents.protocols.ss7.hardware;
-
-import java.io.IOException;
-import org.mobicents.protocols.stream.api.Stream;
-
-/**
- * @author baranowb
- * @author kulikov
- */
-public interface Mtp1 extends Stream {
- // FIXME: Oleg what's that?
- /**
- * Gets the code of this channel.
- *
- * @return the code of this channel.
- */
- public int getCode();
-
- /**
- * Set MTP2 layer serving this MTP1
- *
- * @param link
- */
- public void setLink(Object link);
-
- /**
- * Get MTP2 layer serving this MTP1
- *
- * @return
- */
- public Object getLink();
-
- /**
- * Fetches implementation dependent IO Buffer size which should be used
- *
- * @return integer number, Mtp2 implementation should assign buffers of
this
- * size to interact with Mtp1
- */
- public int getIOBufferSize();
-
- /**
- * Reads up to buffer.length bytes from layer 1.
- *
- * @param buffer
- * reader buffer
- * @return the number of actually read bytes.
- */
- public int read(byte[] buffer) throws IOException;
-
- /**
- * Writes data to layer 1.
- *
- * @param buffer
- * the buffer containing data to write.
- * @param bytesToWrite
- */
- public void write(byte[] buffer, int bytesToWrite) throws IOException;
-
- /**
- * Open message transfer part layer 1.
- */
- public void open() throws IOException;
-
- /**
- * Close message transfer part layer 1.
- */
- public void close();
-
-}
=======================================
--- /trunk/protocols/ss7/hardware/dahdi/java/pom.xml Fri Dec 17 02:11:58
2010
+++ /trunk/protocols/ss7/hardware/dahdi/java/pom.xml Mon Dec 27 04:35:56
2010
@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>
@@ -19,14 +21,26 @@
<dependencies>
<dependency>
+ <groupId>javolution</groupId>
+ <artifactId>javolution</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.mobicents.protocols.stream</groupId>
<artifactId>stream</artifactId>
- <version>${stream.version}</version>
</dependency>
+ <dependency>
+
<groupId>org.mobicents.protocols.ss7.management</groupId>
+ <artifactId>linkset</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.mobicents.protocols.ss7.mtp</groupId>
+ <artifactId>mtp</artifactId>
+ </dependency>
+
</dependencies>
<build>
<finalName>mobicents-dahdi</finalName>
-
+
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
=======================================
--- /trunk/protocols/ss7/hardware/dahdi/native/linux/pom.xml Fri Dec 17
02:11:58 2010
+++ /trunk/protocols/ss7/hardware/dahdi/native/linux/pom.xml Mon Dec 27
04:35:56 2010
@@ -77,7 +77,7 @@
<configuration>
<classNames>
<className>
-
org.mobicents.protocols.ss7.hardware.dahdi.Channel
+
org.mobicents.ss7.hardware.dahdi.Channel
</className>
</classNames>
</configuration>
@@ -91,7 +91,7 @@
<configuration>
<classNames>
<className>
-
org.mobicents.protocols.ss7.hardware.dahdi.Selector
+
org.mobicents.ss7.hardware.dahdi.Selector
</className>
</classNames>
</configuration>
=======================================
--- /trunk/protocols/ss7/hardware/dahdi/native/pom.xml Fri Dec 17 02:11:58
2010
+++ /trunk/protocols/ss7/hardware/dahdi/native/pom.xml Mon Dec 27 04:35:56
2010
@@ -21,7 +21,6 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
- <version>${junit.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
=======================================
--- /trunk/protocols/ss7/hardware/dahdi/native/src/main/native/schannel.c
Fri Dec 17 02:11:58 2010
+++ /trunk/protocols/ss7/hardware/dahdi/native/src/main/native/schannel.c
Mon Dec 27 04:35:56 2010
@@ -1,5 +1,5 @@
-#include <org_mobicents_protocols_ss7_hardware_dahdi_Channel.h>
-#include <org_mobicents_protocols_ss7_hardware_dahdi_Selector.h>
+#include <org_mobicents_ss7_hardware_dahdi_Channel.h>
+#include <org_mobicents_ss7_hardware_dahdi_Selector.h>
#include <user.h>
#include <errno.h>
#include <stdio.h>
@@ -34,14 +34,14 @@
return 0;
}
-JNIEXPORT void JNICALL
Java_org_mobicents_protocols_ss7_hardware_dahdi_Selector_doRegister (JNIEnv
*env, jobject obj, jint fd) {
+JNIEXPORT void JNICALL
Java_org_mobicents_ss7_hardware_dahdi_Selector_doRegister (JNIEnv *env,
jobject obj, jint fd) {
int i = channel_count;
channel_count = channel_count + 1;
fds[i].fd = fd;
fds[i].events = POLLIN|POLLPRI|POLLOUT;
}
-JNIEXPORT void JNICALL
Java_org_mobicents_protocols_ss7_hardware_dahdi_Selector_doUnregister
(JNIEnv *env, jobject obj, jint fd) {
+JNIEXPORT void JNICALL
Java_org_mobicents_ss7_hardware_dahdi_Selector_doUnregister (JNIEnv *env,
jobject obj, jint fd) {
struct pollfd temp[16];
int i;
@@ -60,7 +60,7 @@
}
}
-JNIEXPORT jint JNICALL
Java_org_mobicents_protocols_ss7_hardware_dahdi_Selector_doPoll (JNIEnv
*env, jobject obj, jintArray selected, jint flags, jint timeout) {
+JNIEXPORT jint JNICALL
Java_org_mobicents_ss7_hardware_dahdi_Selector_doPoll (JNIEnv *env, jobject
obj, jintArray selected, jint flags, jint timeout) {
int res;
jint *elements = (*env)->GetIntArrayElements(env, selected, 0);
@@ -87,7 +87,7 @@
return k;
}
-JNIEXPORT jint JNICALL
Java_org_mobicents_protocols_ss7_hardware_dahdi_Channel_openChannel
+JNIEXPORT jint JNICALL
Java_org_mobicents_ss7_hardware_dahdi_Channel_openChannel
(JNIEnv *env, jobject obj, jint zapid, jint ioBufferSize) {
struct dahdi_bufferinfo bi;
char devname[100];
@@ -125,7 +125,7 @@
* Method: read
* Signature: ([B)I
*/
-JNIEXPORT jint JNICALL
Java_org_mobicents_protocols_ss7_hardware_dahdi_Channel_readData
+JNIEXPORT jint JNICALL
Java_org_mobicents_ss7_hardware_dahdi_Channel_readData
(JNIEnv *env, jobject obj, jint fd, jbyteArray buff) {
int res = 0;
int count = 0;
@@ -170,7 +170,7 @@
* Method: write
* Signature: ([BI)V
*/
-JNIEXPORT void JNICALL
Java_org_mobicents_protocols_ss7_hardware_dahdi_Channel_writeData
+JNIEXPORT void JNICALL
Java_org_mobicents_ss7_hardware_dahdi_Channel_writeData
(JNIEnv *env, jobject obj, jint fd, jbyteArray buff, jint length) {
int res;
int len = length;
@@ -214,7 +214,7 @@
* Method: close
* Signature: ()V
*/
-JNIEXPORT void JNICALL
Java_org_mobicents_protocols_ss7_hardware_dahdi_Channel_closeChannel
(JNIEnv *env, jobject obj, jint fd) {
+JNIEXPORT void JNICALL
Java_org_mobicents_ss7_hardware_dahdi_Channel_closeChannel (JNIEnv *env,
jobject obj, jint fd) {
close(fd);
}
=======================================
--- /trunk/protocols/ss7/hardware/dialogic/java/pom.xml Fri Dec 17 02:11:58
2010
+++ /trunk/protocols/ss7/hardware/dialogic/java/pom.xml Mon Dec 27 04:35:56
2010
@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>
@@ -19,14 +21,21 @@
<dependencies>
<dependency>
+ <groupId>javolution</groupId>
+ <artifactId>javolution</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.mobicents.protocols.stream</groupId>
<artifactId>stream</artifactId>
- <version>${stream.version}</version>
+ </dependency>
+ <dependency>
+
<groupId>org.mobicents.protocols.ss7.management</groupId>
+ <artifactId>linkset</artifactId>
</dependency>
</dependencies>
<build>
<finalName>mobicents-dahdi</finalName>
-
+
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
=======================================
--- /trunk/protocols/ss7/hardware/dialogic/native/linux/pom.xml Fri Dec 17
02:11:58 2010
+++ /trunk/protocols/ss7/hardware/dialogic/native/linux/pom.xml Mon Dec 27
04:35:56 2010
@@ -73,7 +73,7 @@
<configuration>
<classNames>
<className>
-
org.mobicents.protocols.ss7.hardware.dialogic.InterProcessCommunicator
+
org.mobicents.ss7.hardware.dialogic.InterProcessCommunicator
</className>
</classNames>
</configuration>
=======================================
--- /trunk/protocols/ss7/hardware/dialogic/native/pom.xml Fri Dec 17
02:11:58 2010
+++ /trunk/protocols/ss7/hardware/dialogic/native/pom.xml Mon Dec 27
04:35:56 2010
@@ -21,7 +21,6 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
- <version>${junit.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
=======================================
--- /trunk/protocols/ss7/hardware/dialogic/native/src/main/native/ipc.c Fri
Dec 17 02:11:58 2010
+++ /trunk/protocols/ss7/hardware/dialogic/native/src/main/native/ipc.c Mon
Dec 27 04:35:56 2010
@@ -2,14 +2,14 @@
#include "msg.h"
#include "sysgct.h"
-#include
"org_mobicents_protocols_ss7_hardware_dialogic_InterProcessCommunicator.h"
+#include "org_mobicents_ss7_hardware_dialogic_InterProcessCommunicator.h"
/*
* Class: org_mobicents_gct_InterProcessCommunicator
* Method: receive
* Signature: (I[B)I
*/
-JNIEXPORT jint JNICALL
Java_org_mobicents_protocols_ss7_hardware_dialogic_InterProcessCommunicator_receive
+JNIEXPORT jint JNICALL
Java_org_mobicents_ss7_hardware_dialogic_InterProcessCommunicator_receive
(JNIEnv *env, jobject obj, jint src_module_id, jbyteArray msg_buffer) {
jclass cls;
jfieldID fid;
@@ -59,7 +59,7 @@
* Method: send
* Signature: (I[B)I
*/
-JNIEXPORT jint JNICALL
Java_org_mobicents_protocols_ss7_hardware_dialogic_InterProcessCommunicator_send
+JNIEXPORT jint JNICALL
Java_org_mobicents_ss7_hardware_dialogic_InterProcessCommunicator_send
(JNIEnv *env, jobject obj, jint src_module_id, jint dest_module_id,
jbyteArray msg_buffer) {
jclass cls;
jfieldID fid;
=======================================
--- /trunk/protocols/ss7/hardware/pom.xml Fri Dec 17 02:11:58 2010
+++ /trunk/protocols/ss7/hardware/pom.xml Mon Dec 27 04:35:56 2010
@@ -25,6 +25,7 @@
<modules>
<module>dahdi</module>
<module>dialogic</module>
+ <module>m3ua</module>
</modules>
<scm>