[asterisk-dev] DAHDI-analog: Unmuting backward audio path when dialing ?

Pavel Troller patrol at sinus.cz
Wed Sep 12 01:18:04 CDT 2012


Hi!
  I'm writing a custom signalling mode for DAHDI analog. One of things, which
I would like to achieve, is to be able to permanently listen to the channel
audio even in the dialling (especially pulse mode) state, to hear the dial
clicks and the cooperating switch responses (in interdigit pauses).
  I've found, that there is the "dialing" member of the private channel
structure, which, when set, causes the backward audio path to be blocked.
It is used for dialing control as well, so it's not possible just to prevent
it being set. 
  I tried to patch __dahdi_process_putaudio_chunk() in dahdi-base.c driver:


static inline void __dahdi_process_putaudio_chunk(struct dahdi_chan *ss, unsigned char *rxb)
{
        /* We transmit data from our master channel */
        /* Called with ss->lock held */
        struct dahdi_chan *ms = ss->master;
        /* Linear version of received data */
        short putlin[DAHDI_CHUNKSIZE],k[DAHDI_CHUNKSIZE];
        int x,r;
                        vvvvvvvvvvvvvvvvvvvvvvvvvvvvv
--->    if (ms->dialing && (ms->sig != DAHDI_SIG_UNI)) ms->afterdialingtimer = 50;
        else if (ms->afterdialingtimer) ms->afterdialingtimer--;
        if (ms->afterdialingtimer && !is_pseudo_chan(ms)) {
                /* Be careful since memset is likely a macro */
                rxb[0] = DAHDI_LIN2X(0, ms);
                memset(&rxb[1], rxb[0], DAHDI_CHUNKSIZE - 1);  /* receive as silence if dialing */
        }
...

where DAHDI_SIG_UNI is my private signalling being implemented. When the
patch is not there, I'm getting the silent code on the channel (which is
exactly what the routine is doing). But when it is there, I'm still not
getting the audio, I'm getting no data instead (the difference is, that
for example the SIP phone starts to play its own comfort noise because
it's not getting RTP data).

I'm pretty sure that the hardware and driver can send data even during the
dialling - when I forcibly clear the dialing variable, I can hear the audio
including dial clicks etc., but the dialling logic is disturbed and dialing
stops after the first digit is sent. 

I'm unable to find another place, which probably either stops reading audio
from the channel or stops bridging them to the originating channel - I
scanned chan_dahdi.c, sig_analog.c and physical DAHDI card driver, but
to no avail. 

With regards,
  Pavel



More information about the asterisk-dev mailing list