Said function has been added in libpri-1.4.11 and breaks
building with older libpri versions (i.e. the passive one for ftmod_pritap).
Check for pri_maintenance_service() in configure and disable
the "maintenance" subcommand if it is not available.
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
Portability fix for uClibc and other (linux) environments that lack execinfo.h.
ftdm_backtrace_walk() and related return FTDM_NOTIMPL and print a message
if backtraces are not available in the current environment.
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
Non-PRI_NEW_SET_API logging callbacks were only available in libpri-1.0 and older,
which also lacks PRI_IO_FUNCS (required) and wouldn't work anyway.
Explicitly check for both PRI_* feature defines at configure time and reject libpri
versions that lack them.
Remove the non-PRI_NEW_SET_API logging callbacks in ftmod_libpri.c.
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
Timer-based b-channel tx gating won't work anyway, so remove all those
"#if 0"-ed bits of cruft.
Also remove the mISDN-specific timerfd_create() check in configure.
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
Add I/O plugin for mISDN stack that is included in the linux kernel
since version 2.6.27.
The in-kernel mISDN stack uses a socket based interface (AF_ISDN),
data and control commands are exchanged via datagram messages.
This makes writing a driver that doesn't use a separate (per-span)
thread to handle all incoming events a bit tricky, because responses
to control messages and incoming data are mixed and interfacing
with the synchronous FreeTDM I/O API is problematic.
B(*)/D-channel handling:
The current version uses misdn_wait() to poll() for activity on
the non-blocking channel sockets and misdn_read() to receive and
handle all pending events up to the first PH_DATA_IND (data) message
(which is what the caller of the read method is actually after).
In case no data has been received, misdn_read() returns FTDM_SUCCESS
with *datalen = 0, which is OK for all the signalling modules tested
(ftmod_libpri and (out-of-tree) ftmod_isdn).
To send data, misdn_write() is called, which just sends a PH_DATA_REQ
message to the mISDN channel socket.
(*) B-channels use a per-channel timerfd as a timing reference for
'ready-for-write' poll()ing in misdn_wait().
This is a workaround for a limitation of mISDN sockets, which do not
support POLLOUT waiting on b-channel sockets (in a useful way).
Sending/receiving of data works the same way as on d-channels, otherwise.
The module has received some minimal testing using a beronet
single-port HFC E1 and a HFC4-S quad-port BRI card on linux-3.0.x.
--- Limitations ---
- Only the most basic features have been implemented (alarms,
sending/receiving data/audio).
- Spans are limited to E1 and BRI/BRI_PTMP trunk types.
- D-Channels only work on 16 for PRI and 3 for BRI.
- NT/TE mode information is not available from freetdm.conf /
at configure_span()-time so the module assumes TE mode,
which should be only a problem for cards that can change
the port configuration (pin-out) from software.
- Current design (b-channel timerfd / misdn_wait()/_read()/_write())
should be fine for most SoHo use-cases
(scalability / cpu usage / timing precision).
--- Requirements ---
- mISDNif.h header (/usr/include/mISDN/mISDNif.h), provided by mISDNuser
(http://isdn.eversberg.eu/download/lcr-1.7/mISDNuser-20100525.tar.gz).
- Linux kernel with mISDN and timerfd enabled (>= 2.6.27)
and libc with timerfd support.
mISDN options can be found in the:
"Device Drivers" -> "ISDN support" -> "Modular ISDN driver"
section of make menuconfig. Timerfd is usually enabled by default.
The FreeTDM configure script will check for missing mISDNif.h
header and timerfd support and print a message.
You should see the following in the summary screen on success:
ftmod_misdn........................ yes
NOTE: Forcing mISDN support using the "--with-misdn" configure option,
will cause the configure script to fail on the first missing
dependency.
--- Usage ---
To use the module, make sure you have mISDN support in the kernel
(kernel modules loaded or kernel with built-in mISDN running),
the "misdn_info" application shipped with mISDNuser will output
a list of available mISDN ports on your system, e.g.:
Found 5 ports
Port 0 'hfc-4s.1-1': TE/NT-mode BRI S/T (for phone lines & phones)
2 B-channels: 1-2
B-protocols: RAW HDLC X75slp
...
Port 4 'hfc-e1.2': TE/NT-mode PRI E1 (for phone lines & E1 devices)
30 B-channels: 1-15 17-31
B-protocols: RAW HDLC X75slp
NOTE: ftmod_misdn will print an error message if mISDN support is not available,
or if there are no ports installed.
- Example freetdm.conf settings
[span misdn BRI_1]
trunk_type => BRI_PTMP
b-channel => 0:1,2
d-channel => 0:3
[span misdn PRI_1]
trunk_type => E1
b-channel => hfc-e1.2:1-15,17-31
d-channel => hfc-e1.2:16
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
Default behaviour is unchanged.
Packagers should use this option to install freetdm.pc into
the system's main pkg-config directory (e.g. /usr/lib/pkgconfig).
Signed-off-by: Stefan Knoblich <s.knoblich@axsentis.de>
Tested-by: Stefan Knoblich <s.knoblich@axsentis.de>
- fixed bug in configure.ac to detect ftmod_pritap compilation
- ignore FTDM_SIGEVENT_RELEASED and FTDM_SIGEVENT_INDICATION_COMPLETED in mod_freetdm
- Destroy the state completed interrupt on channel destroy
- Fix analog polarity reversal bug when using 3-way calling or call-swap
add -Werror even when the compiler is unknown. This is just a work-around to gcc not being detected
as GNU by our current standalone build (not bootstrapped through FreeSWITCH)
Requires libpri-1.4.12_beta1 or newer!
Completely untested, AOC-S/D/E ChargingRequest operations are sent to NT (DTAG BRI PTMP),
but rejected with "Unrecognized Operation".
NOTE: FreeTDM core needs support for this to be useful!
Only AOC-E events are decoded and sent to the log.
To enable:
Set (or add) <param name="opts" value="aoc"> in your
libpri_spans span config.
Signed-off-by: Stefan Knoblich <s.knoblich@axsentis.de>
Fixes:
- Fix double locking in check_state(): remove ftdm_mutex_(un)lock calls.
New:
- Add lpwrap_init_bri() to initialize libpri in BRI mode
- Use trunk type to determine PRI/BRI and PTP/PTMP mode (no additional configuration required).
- Improve libpri detection code in configure.ac, check whether libpri is usable
and if BRI support is available (needs more work)
Cleanups:
- Whitespace and indentation cleanups
- Rename str2* functions to parse_*
- Simplify libpri_configure_span() option parsing and bail out on error
- Add "ftdm libpri help" command that displays usage information
- Coding style cleanups and other (minor) changes
Known issues:
- BRI PTMP TE Q.921 link does not go beyond TEI ASSIGNED state,
SABME requests are ignored by NT (EuroISDN DTAG, DAHDI-2.3.0.1, vzaphfc)
Signed-off-by: Stefan Knoblich <s.knoblich@axsentis.de>
- Use tabs instead of spaces for indentation
- Proper m4 quoting of parameters
- Fix broken AC_ARG_* handling:
--without-foo/--disable-foo set withval="no"/enableval="no"
and the third parameter of the AC_ARG_* macros is always
"user provided an --with*-foo/--*able-foo option" _NOT_ "yes",
while the fourth parameter is "user didn't provide this option"
(= the default if neither --with-foo/--enable-foo nor --without-foo/--disable-foo
has been set)
- Drop FTDM_CFLAGS in MY_CFLAGS (what was that used for anyway?)
- Drop MYLIB
- Drop SOLINK (unused)
- Rename MY_CFLAGS to FTDM_CFLAGS
- Rename all AM_CONDITION variables to HAVE_* for (optional) dependencies
and WANT_* for features
- Reorder mod_LTLIBRARIES lines
- Move some things in configure.ac around to group them
- Add -shared to modules LDFLAGS (we don't need "ftmod_foo.a" static modules, do we?)
- Import ax_compiler_vendor.m4, drop the macro definition from configure.ac
- Add AUTOMAKE_OPTS to Makefile.am and define FreeTDM as a foreign (= non-GNU) project
- Add ACLOCAL_FLAGS to Makefile.am and set AC_CONFIG_MACRO_DIR in configure.ac
custom m4 macros are kept in the build subdirectory
- Enable silent rules for automake-1.11 and newer (use make V=1 to get verbose output)
- configure option --with-modinstdir requires a value now and quits with an error message
if called without one (e.g. "./configure --without-modinstdir" or "./configure --with-modinstdir")
- Add configuration summary screen and category headers for modules in configure output
- 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)