Review Board 1.7.16


MFC/R2 support for chan_dahdi

Review Request #40 - Created Nov. 7, 2008 and submitted

Moises Silva
team/moy/mfcr2
Reviewers
asterisk-dev
Asterisk
MFC/R2 support for chan_dahdi.

The code for tone detection (main/dsp.c) and generation (DAHDI MF support in chan_dahdi.c) is not actually being used now. In the early stages of development, spandsp was not LGPL and that's why applications can provide a MF interface to generate and detect the tones required for this signaling to work. Now that spandsp is LGPL, openr2 has embedded the R2 MF detector and generator and is the one currently being used. I had issues (tones either not being generated or not being detected properly) in some x86 64 bit, and the detection was 50% slower than the one in spandsp. Unless there is some important reason you can think of to switch back to DAHDI and main/dsp generator and detector, I suggest to get rid of that code, but I wanted to ask first. 

There is an issue with the way I currently handle how many monitor threads I launch. This code will launch as many monitor threads as group of channels are specified in the chan_dahdi.conf file.

channel=1-15,17-31

That would launch 2 monitor threads and use 2 r2link structures. There is maximum of NUM_SPANS r2link structures statically allocated when the module is loaded.

channel=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15

That would launch 15 threads, 15 r2link structures would be used with only 1 channel each. If some user specify the channels this way, a single DAHDI span would consume all the available structures. Not a common scenario though, since most users would just specify 1-15 in such cases. Should I get rid of that mechanism for launching monitor threads?
Lots of users currently using this in 1.2, 1.4 and 1.6 in Brazil, México and Argentina. An unknown number of users (but at least 1) for each of the following countries: colombia, nepal, thailand, venezuela, perú and probably others. The code in chan_dahdi.c is independent of the variants though, which are handled by the OpenR2 library.

Diff revision 3

This is not the most recent revision of the diff. The latest diff is revision 4. See what's changed.

1 2 3 4
1 2 3 4

  1. /trunk/configure.ac: Loading...
  2. /trunk/makeopts.in: Loading...
  3. /trunk/channels/chan_dahdi.c: Loading...
  4. /trunk/configs/chan_dahdi.conf.sample: Loading...
/trunk/configure.ac
Revision 168017 New Change
[20] 258 lines
[+20]
259
AST_EXT_LIB_SETUP([PORTAUDIO], [PortAudio], [portaudio])
259
AST_EXT_LIB_SETUP([PORTAUDIO], [PortAudio], [portaudio])
260
AST_EXT_LIB_SETUP([PRI], [ISDN PRI], [pri])
260
AST_EXT_LIB_SETUP([PRI], [ISDN PRI], [pri])
261
AST_EXT_LIB_SETUP([RESAMPLE], [LIBRESAMPLE], [resample])
261
AST_EXT_LIB_SETUP([RESAMPLE], [LIBRESAMPLE], [resample])
262
AST_EXT_LIB_SETUP([SPANDSP], [SPANDSP], [spandsp])
262
AST_EXT_LIB_SETUP([SPANDSP], [SPANDSP], [spandsp])
263
AST_EXT_LIB_SETUP([SS7], [ISDN SS7], [ss7])
263
AST_EXT_LIB_SETUP([SS7], [ISDN SS7], [ss7])

    
   
264
AST_EXT_LIB_SETUP([OPENR2], [MFR2], [openr2])
264
AST_EXT_LIB_SETUP([PWLIB], [PWlib], [pwlib])
265
AST_EXT_LIB_SETUP([PWLIB], [PWlib], [pwlib])
265
AST_EXT_LIB_SETUP([OPENH323], [OpenH323], [h323])
266
AST_EXT_LIB_SETUP([OPENH323], [OpenH323], [h323])
266
AST_EXT_LIB_SETUP([RADIUS], [Radius Client], [radius])
267
AST_EXT_LIB_SETUP([RADIUS], [Radius Client], [radius])
267
AST_EXT_LIB_SETUP([SDL], [Sdl], [sdl])
268
AST_EXT_LIB_SETUP([SDL], [Sdl], [sdl])
268
AST_EXT_LIB_SETUP([SDL_IMAGE], [Sdl Image library], [SDL_image])
269
AST_EXT_LIB_SETUP([SDL_IMAGE], [Sdl Image library], [SDL_image])
[+20] [20] 1149 lines
[+20]
1418
	AC_CHECK_HEADER([spandsp/expose.h], [AC_DEFINE_UNQUOTED([HAVE_SPANDSP_EXPOSE_H], 1, [Define to 1 if spandsp/expose.h is available.])], [], [#include <spandsp.h>])
1419
	AC_CHECK_HEADER([spandsp/expose.h], [AC_DEFINE_UNQUOTED([HAVE_SPANDSP_EXPOSE_H], 1, [Define to 1 if spandsp/expose.h is available.])], [], [#include <spandsp.h>])
1419
fi
1420
fi
1420

    
   
1421

   
1421
AST_EXT_LIB_CHECK([SS7], [ss7], [ss7_pollflags], [libss7.h])
1422
AST_EXT_LIB_CHECK([SS7], [ss7], [ss7_pollflags], [libss7.h])
1422

    
   
1423

   

    
   
1424
AST_EXT_LIB_CHECK([OPENR2], [openr2], [openr2_chan_new], [openr2.h])

    
   
1425

   
1423
if test "${USE_PWLIB}" != "no"; then
1426
if test "${USE_PWLIB}" != "no"; then
1424
	if test -n "${PWLIB_DIR}"; then
1427
	if test -n "${PWLIB_DIR}"; then
1425
		PWLIBDIR="${PWLIB_DIR}"
1428
		PWLIBDIR="${PWLIB_DIR}"
1426
	fi
1429
	fi
1427
	AST_CHECK_PWLIB()
1430
	AST_CHECK_PWLIB()
[+20] [20] 306 lines
/trunk/makeopts.in
Revision 168017 New Change
 
/trunk/channels/chan_dahdi.c
Revision 168017 New Change
 
/trunk/configs/chan_dahdi.conf.sample
Revision 168017 New Change
 
  1. /trunk/configure.ac: Loading...
  2. /trunk/makeopts.in: Loading...
  3. /trunk/channels/chan_dahdi.c: Loading...
  4. /trunk/configs/chan_dahdi.conf.sample: Loading...

https://reviewboard.asterisk.org/ runs on a server provided by Digium, Inc. and uses bandwidth donated to the open source Asterisk community by API Digital Communications in Huntsville, AL USA.
Please report problems with this site to asteriskteam@digium.com.