DAHDI hangs-up when first digit dialled

Hi,
I have Asterisk running on a pi with an FXS port to which is connected an analogue phone. Asterisk is registered with a sip service, so the unit is acting as an ATA

Incoming calls ,from the SIP provider to the analogue phone, work fine. Likewise, DTMF tones for outgoing calls are detected…but as soon as the first tone is detected, asterisk hangs up - see below (the result of picking up the analogue handset and pressing “0”):

-- Starting simple switch on 'DAHDI/1-1'
[Apr  8 23:00:03] DTMF[19576][C-00000000]: channel.c:4126 __ast_read: DTMF begin '0' received on DAHDI/1-1
[Apr  8 23:00:03] DTMF[19576][C-00000000]: channel.c:4130 __ast_read: DTMF begin ignored '0' on DAHDI/1-1
[Apr  8 23:00:03] DTMF[19576][C-00000000]: channel.c:4040 __ast_read: DTMF end '0' received on DAHDI/1-1, duration 89 ms
[Apr  8 23:00:03] DTMF[19576][C-00000000]: channel.c:4110 __ast_read: DTMF end passthrough '0' on DAHDI/1-1
    -- Hanging up on 'DAHDI/1-1'
    -- Hungup 'DAHDI/1-1'

I am still getting to grips with the various config files…but any suggestions as to what I might be missing here?

Did you set immediate=no in your chan_dahdi.conf ?

Yep:

chan-dahdi.conf:

[general]

[channels]
        #include /etc/asterisk/dahdi-channels.conf

        usecallerid=yes
        hidecallerid=no
        callerid=asreceived
        language=en
        immediate=no
        dtmf=relax

dahdi-channels.conf:

; Autogenerated by /usr/sbin/dahdi_genconf on Mon Apr  1 22:29:20 2019
; If you edit this file and execute /usr/sbin/dahdi_genconf again,
; your manual changes will be LOST.
; Dahdi Channels Configurations (chan_dahdi.conf)
;
; This is not intended to be a complete chan_dahdi.conf. Rather, it is intended
; to be #include-d by /etc/chan_dahdi.conf that will include the global settings
;

; Span 1: WCTDM/4 "SwitchPi Thunder FXS/FXO Board 5" (MASTER)
;;; line="1 WCTDM/4/0 FXOKS  (EC: MG2 - INACTIVE)"
signalling=fxo_ks
group=5
context=fxo
channel => 1

;;; line="2 WCTDM/4/1 FXSKS  (EC: MG2 - INACTIVE)"
signalling=fxs_ks
callerid=asreceived
group=0
context=incoming
channel => 2
callerid=
group=
context=default

extensions.conf:

[default]
        exten =><sip_id>,1,DIAL(DAHDI/1)
        exten =><sip_id>,n,Hangup

[outgoing]
        exten => _X.,1,Set(CALLERID(num)=<sip_id>)
        exten => _X.,2,Dial(SIP/${EXTEN}@sip_provider,30,trg)
        exten => _X.,3,Hangup

[general]
        register=<sip_id>:<sip_provider>@xxxxx.co.uk/<sip_id>
        localnet=192.168.1.0/255.255.255.0
        externhost=yyyyyy
[sip_provider]
        disallow=all
        host=sipgate.co.uk
        username=<sip_id>
        secret=<sip_pw>
        type=peer
        fromuser=<sip_id>
        nat=yes
        qualify=yes
        authuser=<sip_id>
        dtmfmode=inband
        insecure=port,invite
        canreinvite=no
        allow=gsm

You appear to have configured the FXS port to go to a dialplan context of “fxo”. Given the extensions.conf you have provided there is no context named “fxo”. There is only “default” and “outgoing”. I assume you actually want to configure it to use the “outgoing” context.

I think that’s my FXO port - which I’m not using

I have an analogue phone connected to the FXS port, and a SIP connection to the internet

Signaling is opposite. On an FXO port you provide FXS signaling, on an FXS port you provide FXO signaling if I recall correctly - so what I mentioned would be your phone. It also matches the channel number from your initial log.

1 Like

Ah - the problem was I was referring to DAHDI channel 1 in the dial plan, which is my FXO port, not channel 2, which is my FXS port

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.