Revision: a88344dfa95f
Author:   Oifa Yulian <[email protected]>
Date:     Sun Jul  1 00:32:39 2012
Log:      Updated Dahdi native driver

http://code.google.com/p/jss7/source/detail?r=a88344dfa95f

Modified:
/hardware/dahdi/java/src/main/java/org/mobicents/ss7/hardware/dahdi/Selector.java
 /hardware/dahdi/native/src/main/native/schannel.c

=======================================
--- /hardware/dahdi/java/src/main/java/org/mobicents/ss7/hardware/dahdi/Selector.java Thu May 17 05:52:04 2012 +++ /hardware/dahdi/java/src/main/java/org/mobicents/ss7/hardware/dahdi/Selector.java Sun Jul 1 00:32:39 2012
@@ -128,7 +128,7 @@

     public FastList<SelectorKey> selectNow(int ops, int timeout)
             throws IOException {
-       int count = doPoll(fds, ops, 20);
+       int count = doPoll(fds, ops, 1);
         selected.clear();
         for (int i = 0; i < count; i++) {
for (FastList.Node<Mtp1> n = registered.head(), end = registered
=======================================
--- /hardware/dahdi/native/src/main/native/schannel.c Thu May 17 05:52:04 2012 +++ /hardware/dahdi/native/src/main/native/schannel.c Sun Jul 1 00:32:39 2012
@@ -40,15 +40,15 @@
     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,6 +62,11 @@
         return -1;
     }

+       res = ioctl(fd, DAHDI_SET_BLOCKSIZE, &ioBufferSize);
+       if (res < 0) {
+        return -1;
+    }
+
     return fd;
 }

Reply via email to