[asterisk-dev] Sending digits directly to Asterisk using DAHDI during ramal dialing

Fábio Urquiza flus at cesar.org.br
Wed Feb 3 06:38:12 CST 2016


Hi Tzafrir,

I found the function *void dahdi_qevent_lock(struct dahdi_chan *chan, int
event) *where we send directly the tones detected and examples of how to
use it in *linux/drivers/dahdi/wct4xxp/base.c:874* and
*linux/drivers/dahdi/xpp/card_fxs.c:1573*.

Thanks very much for your help.

-Fabio Urquiza


On Wed, Feb 3, 2016 at 6:28 AM, Tzafrir Cohen <tzafrir.cohen at xorcom.com>
wrote:

> On Wed, Jan 20, 2016 at 05:19:59PM -0300, Fábio Urquiza wrote:
> > Hi All,
> >
> > I'm still developing a DAHDI driver to a specific PABX hardware that is
> > composed by a Digital Matrix controlled by a DSP. I already have sent a
> > message to the list with some questions about DAHDI developing and
> received
> > some very good advices. Now I'm facing a new problem.
> >
> > In this particular hardware the DSP is responsible for receiving all
> events
> > that happen in all cards. So, for instance, if a ramal connected to a FXS
> > card have its phone off hook, the DSP send us a message like the one
> below:
> >
> > Mbx: [a] Ev: [17],0,1 => Ramal 0 offhook
> >
> > I understand that my driver need to call something like this when that
> > event is generated:
> >
> > dahdi_hooksig(chan, DAHDI_RXSIG_OFFHOOK);
> >
> > After that, when digit in the ramal are been pressed, the DSP already
> does
> > the DTMF detection and send us messages like that:
> >
> > Mbx: [ff] Ev: [dc],0,30 => Digit 0x30 '0' detected
> >
> > Mbx: [ff] Ev: [dc],0,31 => Digit 0x31 '1' detected
> >
> >
> > Now my driver need to call a function to directly send the detected
> digits
> > to DAHDI. But I looked all *kernel.h* and *dahdi-base.c* and didn't
> found a
> > function to do that.
>
> Interfaces to userspace are in user.h .
>
> >
> > I imagine that in the normal operation Asterisk will be waiting for the
> > tones to do the DTMF itself. There is a way that I can send the digits
> > directly using DAHDI API and skip the Asterisk DTMF detection ?
>
> $ grep -A2 PULSEDIGIT include/dahdi/user.h
> #define DAHDI_EVENT_PULSEDIGIT          (1 << 16)       /* This is OR'd
> with the digit received */
> #define DAHDI_EVENT_DTMFDOWN            (1 << 17)       /* Ditto for DTMF
> key down event */
> #define DAHDI_EVENT_DTMFUP              (1 << 18)       /* Ditto for DTMF
> key up event */
>
> Pulse digit detection is handled by DAHDI. You may have encountered the
> funny message "Got pulse digit NNN" for values of NNN way larger than 10
> if you have a misconfigured phone/line (or badly-written driver).
>
> Reporting DTMF up and DTMF down is left for various drivers to
> implement, if they choose to. As you can see, there are currently two
> drivers that may send those events.
>
> See also DAHDI_TONEDETECT .
>
> --
>                Tzafrir Cohen
> icq#16849755              jabber:tzafrir.cohen at xorcom.com
> +972-50-7952406           mailto:tzafrir.cohen at xorcom.com
> http://www.xorcom.com
>
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> asterisk-dev mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20160203/d6a950ea/attachment.html>


More information about the asterisk-dev mailing list