[asterisk-dev] Adding a signalling type to DAHDI

Pavel Troller patrol at sinus.cz
Mon Nov 23 03:33:02 CST 2009


Hi!
  I'm implementing new signalling variants for a special device (a kind of
E1 muldex with various analog interface cards like LB, CB etc.), which uses
not yet implemented variants of E1/CAS signalling.
  I would like to add a new signalling types to the DAHDI driver, but it
seems a bit problematic. 
  In the user.h file (from the dahdi-linux package), various DAHDI_SIG_XXX
symbols are declared, specifying various bits in a 32-bit word. Currently
used bit shifts are from 0 (FXS) to 20 (MTP2). Some of them use ORed values
with two or more bits.
  I don't understand the following lines in chan_dahdi.c:

  if (conf->is_sig_auto)
        chan_sig = sigtype_to_signalling(p.sigtype);
  if (p.sigtype != (chan_sig & 0x3ffff)) {
        ast_log(LOG_ERROR, "Signalling requested on channel %d is %s but line is in %s signalling\n", channel, sig2str(chan_sig), sig2str(p.sigtype));
  ...

  It looks like only the lower 18 bits (with shifts 0 to 17) are accepted
by this code, because otherwise an error is detected, even if the channel
type is automatic. So, signalling of DACS_RBS (bit 18 | 16 | 7), HARDHDLC 
(bits 19 | 7) and MTP2 (20 | 9) will not pass this check ? 
  I also know that higher bits of this word are used in chan_dahdi.c for
specifying various signalling variants of the EM signalling (for example
SIG_EMWINK uses bit 20, which already collides with DAHDI_SIG_MTP2, but it
is not serious because the other bits are different).
  So, my question is: I would like to allocate DAHDI_SIG_XXX defines for
thre new signalling types, which are not covered by any of the existing
definitions yet. How should I do it ? Just now, I've allocated bits 28,
29 and 30, which seems to be the only unused ones in the word. Of course
I had to modify the test above, otherwise it didn't pass. I know that it
is not clean; however, I cannot find any really clean method. Please give
me a hint :-).

With regards,
  Pavel Troller

  



More information about the asterisk-dev mailing list