ftmod_isdn: FreeTDM port, first steps

- Requires non-public development version of libisdn(!)
- Based on older patches from http://oss.axsentis.de/gitweb/?p=ftmod_isdn.git;a=summary
- Rework of ftmod_isdn related buildsystem parts (Makefile.am, configure.in and libpcap.m4)
This commit is contained in:
Stefan Knoblich 2010-11-01 00:47:43 +01:00
parent 1b0ec75568
commit 3428bd3d43
6 changed files with 1131 additions and 1002 deletions

View File

@ -161,7 +161,7 @@ testanalog_CFLAGS = $(AM_CFLAGS) $(MY_CFLAGS)
#
# ftmod modules
#
mod_LTLIBRARIES = ftmod_zt.la ftmod_skel.la ftmod_analog.la ftmod_analog_em.la #ftmod_isdn.la
mod_LTLIBRARIES = ftmod_zt.la ftmod_skel.la ftmod_analog.la ftmod_analog_em.la
if HAVE_SCTP
@ -209,32 +209,13 @@ ftmod_wanpipe_la_LDFLAGS = -module -avoid-version -lsangoma
ftmod_wanpipe_la_LIBADD = $(MYLIB)
endif
#ftmod_isdn_la_SOURCES = \
#$(SRC)/isdn/EuroISDNStateNT.c \
#$(SRC)/isdn/EuroISDNStateTE.c \
#$(SRC)/isdn/mfifo.c \
#$(SRC)/isdn/Q921.c \
#$(SRC)/isdn/Q931api.c \
#$(SRC)/isdn/Q931.c \
#$(SRC)/isdn/Q931ie.c \
#$(SRC)/isdn/Q931mes.c \
#$(SRC)/isdn/Q931StateNT.c \
#$(SRC)/isdn/Q931StateTE.c \
#$(SRC)/isdn/nationalmes.c \
#$(SRC)/isdn/nationalStateNT.c \
#$(SRC)/isdn/nationalStateTE.c \
#$(SRC)/isdn/DMSmes.c \
#$(SRC)/isdn/DMSStateNT.c \
#$(SRC)/isdn/DMSStateTE.c \
#$(SRC)/isdn/5ESSmes.c \
#$(SRC)/isdn/5ESSStateNT.c \
#$(SRC)/isdn/5ESSStateTE.c \
#$(SRC)/isdn/Q932mes.c \
#$(SRC)/ftmod/ftmod_isdn/ftmod_isdn.c
#ftmod_isdn_la_CFLAGS = $(AM_CFLAGS) $(MY_CFLAGS) -D_GNU_SOURCE
#ftmod_isdn_la_LDFLAGS = $(PCAP_LIB_FLAGS) -module -avoid-version
#ftmod_isdn_la_LIBADD = $(MYLIB)
if HAVE_LIBISDN
mod_LTLIBRARIES += ftmod_isdn.la
ftmod_isdn_la_SOURCES = $(SRC)/ftmod/ftmod_isdn/ftmod_isdn.c
ftmod_isdn_la_CFLAGS = $(AM_CFLAGS) $(MY_CFLAGS) -D_GNU_SOURCE $(LIBISDN_CPPFLAGS) $(PCAP_CPPFLAGS)
ftmod_isdn_la_LDFLAGS = -shared -module -avoid-version $(LIBISDN_LDFLAGS) $(PCAP_LDFLAGS)
ftmod_isdn_la_LIBADD = $(MYLIB) $(LIBISDN_LIBS) $(PCAP_LIBS)
endif
ftmod_analog_la_SOURCES = $(SRC)/ftmod/ftmod_analog/ftmod_analog.c
ftmod_analog_la_CFLAGS = $(AM_CFLAGS) $(MY_CFLAGS)

View File

@ -2,6 +2,10 @@ dnl libpcap.m4--PCAP libraries and includes
dnl Derrick Brashear
dnl from KTH krb and Arla
dnl $Id: libpcap.m4,v 1.4 2006/01/20 20:21:09 snsimon Exp $
dnl 2010/10/31 (stkn):
dnl rename: PCAP_INC_FLAGS -> PCAP_CPPFLAGS
dnl rename: PCAP_LIB_FLAGS -> PCAP_LDFLAGS (-L flags only)
dnl add: PCAP_LIBS (libs only)
AC_DEFUN([PCAP_INC_WHERE1], [
ac_cv_found_pcap_inc=no
@ -129,12 +133,14 @@ AC_ARG_WITH(pcap-include,
AC_MSG_RESULT(yes)
PCAP_INC_DIR=$ac_cv_pcap_where_inc
PCAP_LIB_DIR=$ac_cv_pcap_where_lib
PCAP_INC_FLAGS="-I${PCAP_INC_DIR}"
PCAP_LIB_FLAGS="-L${PCAP_LIB_DIR} -lpcap"
PCAP_CPPFLAGS="-I${PCAP_INC_DIR}"
PCAP_LDFLAGS="-L${PCAP_LIB_DIR}"
PCAP_LIBS="-lpcap"
AC_SUBST(PCAP_INC_DIR)
AC_SUBST(PCAP_LIB_DIR)
AC_SUBST(PCAP_INC_FLAGS)
AC_SUBST(PCAP_LIB_FLAGS)
AC_SUBST(PCAP_CPPFLAGS)
AC_SUBST(PCAP_LDFLAGS)
AC_SUBST(PCAP_LIBS)
AC_DEFINE([HAVE_LIBPCAP],[1],[libpcap])
else
ac_cv_found_pcap=no

View File

@ -12,6 +12,7 @@ AM_INIT_AUTOMAKE(libfreetdm,0.1)
AC_PROG_CC
AC_PROG_MAKE_SET
AM_PROG_CC_C_O
PKG_PROG_PKG_CONFIG
AC_PREFIX_DEFAULT(/usr/local/freetdm)
# AC_PREFIX_DEFAULT does not get expanded until too late so we need to do this to use prefix in this script
@ -217,8 +218,63 @@ if test "${have_sng_ss7}" = "yes"; then
fi
fi
##
# libisdn
#
HAVE_LIBISDN="no"
AC_ARG_WITH([libisdn],
[AS_HELP_STRING([--with-libisdn], [Install ftmod_isdn (libisdn stack)])],
[case "${withval}" in
no) with_libisdn="no" ;;
*) with_libisdn="yes" ;;
esac
],
[with_libisdn="no"]
)
if test "${with_libisdn}" != "no"
then
AC_MSG_RESULT([${as_nl}<<>> ftmod_isdn (libisdn stack)])
PKG_CHECK_MODULES([libisdn],
[libisdn >= 0.0.1],
[AC_MSG_CHECKING([libisdn version])
LIBISDN_VERSION="`${PKG_CONFIG} --modversion libisdn`"
if test -z "${LIBISDN_VERSION}"; then
AC_MSG_ERROR([Failed to retrieve libisdn version])
fi
AC_MSG_RESULT([${LIBISDN_VERSION}])
# check features
AC_MSG_CHECKING([for new experimental API])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[#include <libisdn/version.h>
#if !LIBISDN_FEATURE(API2)
#error "libisdn API v2 not available"
#endif
],
[;]
)],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])]
)
HAVE_LIBISDN="yes"
AC_DEFINE([HAVE_LIBISDN], [1], [libisdn support])
AC_SUBST([LIBISDN_CFLAGS], [${libisdn_CFLAGS}])
AC_SUBST([LIBISDN_CPPFLAGS],[${libisdn_CPPFLAGS}])
AC_SUBST([LIBISDN_LDFLAGS], [${libisdn_LDFLAGS}])
AC_SUBST([LIBISDN_LIBS], [${libisdn_LIBS}])
AC_SUBST([LIBISDN_VERSION])
],
[AC_MSG_ERROR([Need libisdn-0.0.1 or higher])]
)
fi
AM_CONDITIONAL([HAVE_LIBISDN], [test "${HAVE_LIBISDN}" = "yes"])
COMP_VENDOR_CFLAGS="$COMP_VENDOR_CFLAGS"
AC_SUBST(COMP_VENDOR_CFLAGS)
AC_MSG_RESULT([${as_nl}<<>> Creating output files])
AC_CONFIG_FILES([Makefile
freetdm.pc
mod_freetdm/Makefile])

File diff suppressed because it is too large Load Diff

View File

@ -1,23 +1,23 @@
/*
* Copyright (c) 2007, Anthony Minessale II
* All rights reserved.
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
*
* * Neither the name of the original author; nor the names of any contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
*
*
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@ -33,7 +33,6 @@
#ifndef FTDM_ISDN_H
#define FTDM_ISDN_H
#include "freetdm.h"
#define DEFAULT_DIGIT_TIMEOUT 10000 /* default overlap timeout: 10 seconds */
@ -42,17 +41,23 @@ typedef enum {
FTDM_ISDN_OPT_NONE = 0,
FTDM_ISDN_OPT_SUGGEST_CHANNEL = (1 << 0),
FTDM_ISDN_OPT_OMIT_DISPLAY_IE = (1 << 1), /*!< Do not send Caller name in outgoing SETUP message (= Display IE) */
FTDM_ISDN_OPT_DISABLE_TONES = (1 << 2), /*!< Disable tone generating thread (NT mode) */
FTDM_ISDN_OPT_DISABLE_TONES = (1 << 2), /*!< Disable tone generating thread (NT mode) */
FTDM_ISDN_OPT_MAX = (2 << 0)
} ftdm_isdn_opts_t;
typedef enum {
FTDM_ISDN_RUNNING = (1 << 0),
FTDM_ISDN_TONES_RUNNING = (1 << 1),
FTDM_ISDN_STOP = (1 << 2)
FTDM_ISDN_RUNNING = (1 << 0),
FTDM_ISDN_TONES_RUNNING = (1 << 1),
FTDM_ISDN_STOP = (1 << 2),
FTDM_ISDN_CAPTURE = (1 << 3),
FTDM_ISDN_CAPTURE_L3ONLY = (1 << 4)
} ftdm_isdn_flag_t;
#ifdef HAVE_PCAP
struct pcap_context;
#endif
struct ftdm_isdn_data {
Q921Data_t q921;
@ -60,6 +65,7 @@ struct ftdm_isdn_data {
ftdm_channel_t *dchan;
ftdm_channel_t *dchans[2];
struct ftdm_sigmsg sigmsg;
fio_signal_cb_t sig_cb;
uint32_t flags;
int32_t mode;
int32_t digit_timeout;
@ -67,6 +73,9 @@ struct ftdm_isdn_data {
ftdm_caller_data_t *outbound_crv[32768];
ftdm_channel_t *channels_local_crv[32768];
ftdm_channel_t *channels_remote_crv[32768];
#ifdef HAVE_PCAP
struct pcap_context *pcap;
#endif
};
typedef struct ftdm_isdn_data ftdm_isdn_data_t;
@ -75,7 +84,7 @@ typedef struct ftdm_isdn_data ftdm_isdn_data_t;
/* b-channel private data */
struct ftdm_isdn_bchan_data
{
L2ULONG digit_timeout;
int32_t digit_timeout;
};
typedef struct ftdm_isdn_bchan_data ftdm_isdn_bchan_data_t;
@ -91,6 +100,6 @@ typedef struct ftdm_isdn_bchan_data ftdm_isdn_bchan_data_t;
* c-basic-offset:4
* End:
* For VIM:
* vim:set softtabstop=4 shiftwidth=4 tabstop=4:
* vim:set softtabstop=4 shiftwidth=4 tabstop=4 expandtab:
*/

View File

@ -1,316 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="ftmod_isdn"
ProjectGUID="{729344A5-D5E9-434D-8EE8-AF8C6C795D15}"
RootNamespace="ftmod_isdn"
Keyword="Win32Proj"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\isdn\include;..\..\include"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;FTMOD_ISDN_EXPORTS;_CRT_SECURE_NO_WARNINGS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="4"
WarnAsError="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkIncremental="2"
GenerateDebugInformation="true"
SubSystem="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
AdditionalIncludeDirectories="..\..\isdn\include;..\..\include"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;FTMOD_ISDN_EXPORTS;_CRT_SECURE_NO_WARNINGS"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
WarningLevel="4"
WarnAsError="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkIncremental="1"
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="..\..\isdn\5ESSmes.c"
>
</File>
<File
RelativePath="..\..\isdn\5ESSStateNT.c"
>
</File>
<File
RelativePath="..\..\isdn\5ESSStateTE.c"
>
</File>
<File
RelativePath="..\..\isdn\DMSmes.c"
>
</File>
<File
RelativePath="..\..\isdn\DMSStateNT.c"
>
</File>
<File
RelativePath="..\..\isdn\DMSStateTE.c"
>
</File>
<File
RelativePath="..\..\isdn\EuroISDNStateNT.c"
>
</File>
<File
RelativePath="..\..\isdn\EuroISDNStateTE.c"
>
</File>
<File
RelativePath="..\..\isdn\mfifo.c"
>
</File>
<File
RelativePath="..\..\isdn\nationalmes.c"
>
</File>
<File
RelativePath="..\..\isdn\nationalStateNT.c"
>
</File>
<File
RelativePath="..\..\isdn\nationalStateTE.c"
>
</File>
<File
RelativePath="ftmod_isdn.c"
>
</File>
<File
RelativePath="..\..\isdn\Q921.c"
>
</File>
<File
RelativePath="..\..\isdn\Q931.c"
>
</File>
<File
RelativePath="..\..\isdn\Q931api.c"
>
</File>
<File
RelativePath="..\..\isdn\Q931ie.c"
>
</File>
<File
RelativePath="..\..\isdn\Q931mes.c"
>
</File>
<File
RelativePath="..\..\isdn\Q931StateNT.c"
>
</File>
<File
RelativePath="..\..\isdn\Q931StateTE.c"
>
</File>
<File
RelativePath="..\..\isdn\Q932mes.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath="..\..\isdn\include\5ESS.h"
>
</File>
<File
RelativePath="..\..\isdn\include\DMS.h"
>
</File>
<File
RelativePath="..\..\isdn\include\mfifo.h"
>
</File>
<File
RelativePath="..\..\isdn\include\national.h"
>
</File>
<File
RelativePath="..\..\isdn\include\Q921.h"
>
</File>
<File
RelativePath="..\..\isdn\include\Q921priv.h"
>
</File>
<File
RelativePath="..\..\isdn\include\Q931.h"
>
</File>
<File
RelativePath="..\..\isdn\include\Q931ie.h"
>
</File>
<File
RelativePath="..\..\isdn\include\Q932.h"
>
</File>
<File
RelativePath="ftdm_isdn.h"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>