chan_unistim is an Asterisk channel driver for the Nortel proprietary

Unistim protocol, used by at least the following Nortel phones:
Nortel i2002, i2004 and i2050.

tested and comments sthen@, tested and OK krw.
This commit is contained in:
ian 2007-09-14 13:24:42 +00:00
parent e0eaf0cfa4
commit 0edace2c8d
6 changed files with 134 additions and 0 deletions

View File

@ -0,0 +1,45 @@
# $OpenBSD: Makefile,v 1.1.1.1 2007/09/14 13:24:42 ian Exp $
COMMENT= Asterisk access for Nortel i2002/i2004/i2050 phones
DISTNAME= chan_unistim-1.0.0.5c # for Asterisk 1.4
EXTRACT_SUFX= .tar.bz2
CATEGORIES= telephony
HOMEPAGE= http://mlkj.net/UNISTIM/
MAINTAINER= Ian Darwin <ian@openbsd.org>
# GPL V2
PERMIT_PACKAGE_CDROM= Yes
PERMIT_PACKAGE_FTP= Yes
PERMIT_DISTFILES_CDROM= Yes
PERMIT_DISTFILES_FTP= Yes
MASTER_SITES= http://mlkj.net/UNISTIM/
BUILD_DEPENDS= :asterisk->=1.4:telephony/asterisk
RUN_DEPENDS= :asterisk->=1.4:telephony/asterisk
CFLAGS+=-pipe -Wall -Wmissing-prototypes -Wmissing-declarations \
-D_REENTRANT -D_GNU_SOURCE -fPIC -O6 \
-Wno-missing-prototypes -Wno-missing-declarations -DCRYPTO \
-I ${PREFIX}/include
.if ${MACHINE_ARCH:L} == "powerpc"
CFLAGS+=-fsigned-char
.endif
MAKE_FLAGS= -DHAVE_SYS_STAT_H=1 -DHAVE_SYS_UIO_H=1 \
CC="${CC}" \
CFLAGS="${CFLAGS}" \
INSTALL_PREFIX="${PREFIX}" SYSCONFDIR='${SYSCONFDIR}'
NO_REGRESS= Yes
post-install:
${INSTALL_DATA_DIR} ${PREFIX}/share/examples/asterisk/chan_unistim
${INSTALL_DATA} ${WRKSRC}/README ${PREFIX}/share/examples/asterisk/chan_unistim
${INSTALL_DATA} ${WRKSRC}/unistim.conf ${PREFIX}/share/examples/asterisk/chan_unistim
.include <bsd.port.mk>

View File

@ -0,0 +1,5 @@
MD5 (chan_unistim-1.0.0.5c.tar.bz2) = NrvIzA3rtVhoROd/kIKuRA==
RMD160 (chan_unistim-1.0.0.5c.tar.bz2) = PEu8WDkuopXp6kn07dFe0D2X+Q4=
SHA1 (chan_unistim-1.0.0.5c.tar.bz2) = p2pXGINzR/A6kZvtPlntNrgS11U=
SHA256 (chan_unistim-1.0.0.5c.tar.bz2) = A9o2+Oqi7by6Dq0FOBmwLFrPpMcaxhsMsUUbqSDTN4A=
SIZE (chan_unistim-1.0.0.5c.tar.bz2) = 44084

View File

@ -0,0 +1,47 @@
$OpenBSD: patch-Makefile,v 1.1.1.1 2007/09/14 13:24:42 ian Exp $
--- Makefile.orig Sun Aug 27 00:22:39 2006
+++ Makefile Mon Jan 8 20:54:33 2007
@@ -5,29 +5,22 @@
.EXPORT_ALL_VARIABLES:
INSTALL_PREFIX=
-ASTERISK_HEADER_DIR=$(INSTALL_PREFIX)/usr/include
+ASTERISK_HEADER_DIR=${PREFIX}/include
-MODULES_DIR=$(INSTALL_PREFIX)/usr/lib/asterisk/modules
+MODULES_DIR=${PREFIX}/lib/asterisk/modules
-PROC=$(shell uname -m)
-
DEBUG=-g #-DDEBUG_THREADS -DDO_CRASH -DDETECT_DEADLOCKS #-pg
INCLUDE=-I$(ASTERISK_HEADER_DIR)
-CFLAGS=-pipe -Wall -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE
-CFLAGS+=-O6
+CFLAGS+=$(DEBUG) $(INCLUDE)
+PROC=$(shell uname -m)
CFLAGS+=$(shell if $(CC) -march=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=$(PROC)"; fi)
CFLAGS+=$(shell if uname -m | grep -q ppc; then echo "-fsigned-char"; fi)
LIBS=-ldl -lpthread -lm
-CC=gcc
INSTALL=install
SHAREDOS=chan_unistim.so
-CFLAGS+=-Wno-missing-prototypes -Wno-missing-declarations
-
-CFLAGS+=-DCRYPTO
-
all: $(SHAREDOS)
clean:
@@ -40,8 +33,5 @@ chan_unistim.so: chan_unistim.o
$(CC) -shared -Xlinker -x -o $@ chan_unistim.o
install: all
+ mkdir -p $(MODULES_DIR)
for x in $(SHAREDOS); do $(INSTALL) -m 755 $$x $(MODULES_DIR) ; done
-
-config: all
- cp unistim.conf $(INSTALL_PREFIX)/etc/asterisk/
-

View File

@ -0,0 +1,21 @@
$OpenBSD: patch-chan_unistim_c,v 1.1.1.1 2007/09/14 13:24:42 ian Exp $
--- chan_unistim.c.orig Sun May 13 14:52:20 2007
+++ chan_unistim.c Tue Jul 3 14:07:28 2007
@@ -31,6 +31,8 @@
#include <unistd.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
+#include <sys/stat.h>
+#include <sys/uio.h>
#include <net/if.h>
#include <errno.h>
#include <stdlib.h>
@@ -74,7 +76,7 @@
/* IP_PKTINFO is not portable. It's used to retrieve our IP.
Comment the next line if your running *BSD */
-#define HAVE_PKTINFO 1
+/* #define HAVE_PKTINFO 1 */
/* Beware, G729 and G723 are not supported by asterisk, except with the proper licence */
#define CAPABILITY AST_FORMAT_ALAW | AST_FORMAT_ULAW /* | AST_FORMAT_G729A | AST_FORMAT_G723_1 */

View File

@ -0,0 +1,10 @@
chan_unistim is a channel driver for the Nortel proprietary Unistim
protocol, used by at least the following Nortel phones: Nortel i2002,
i2004 and i2050. These phones do not use the standard SIP protocol,
although Nortel does sell a proprietary MS-Windows-only converter.
The following features are supported : Send/Receive CallerID, Redial,
SoftKeys, Send Text(), Music On Hold, Message Waiting Indication
(MWI), Distinctive ring, Transfer, Threeway call, History, Forward,
and Dynamic SoftKeys.

View File

@ -0,0 +1,6 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2007/09/14 13:24:42 ian Exp $
lib/asterisk/modules/chan_unistim.so
share/examples/asterisk/chan_unistim/
share/examples/asterisk/chan_unistim/README
share/examples/asterisk/chan_unistim/unistim.conf
@sample ${SYSCONFDIR}/asterisk/unistim.conf