[asterisk-users] ISDN Timer T309

Martin asterisklist at callthem.info
Mon Apr 6 15:00:54 CDT 2009


Hi,

You're right. I wasn't aware of this patch getting into the code.
In the version you're running the code is already present.

The only problem I see is that some other timer kicks in here and the
T309 cannot be scheduled.

q931.c has this ...
/* For a call in Active state, activate T309 only if there is no timer
already running. */

You'd have to probably dig deeper in it to find out more. But this is
the "latest" explanation I see.
That would explain why the call is disconnected/hanged up right when
the alarm happens.

One way to fix it for you would be to remove the already running timer
so the T309 could be scheduled since
anyways all other timers do not matter since without T309 the call is
hanged up anyways.

Martin

On Mon, Apr 6, 2009 at 12:23 PM, Afonso Zimmermann <afonso at disc-os.org> wrote:
> Martin escreveu:
>
> Based on the Asterisk logs you posted the Asterisk doesn't have it
> implemented per:
>
> "The implementation of timer T309 in the user side is optional"
>
> Martin
>
> On Mon, Apr 6, 2009 at 6:22 AM, Afonso Zimmermann <afonso at disc-os.org>
> wrote:
>
>
> Martin escreveu:
>
> What is the specification for T309 ? I'm too lazy to look it up.
>
> The default behaviour when the alarm of layer 1 (electrical T1/E1) is
> detected is to assume
> all calls dropped on both sides and that's what Asterisk does.
>
> The timer is simply deactivated since all the calls are supposed to
> drop. I believe that agrees with Q921/Q931 specs.
>
> Martin
>
> On Fri, Apr 3, 2009 at 12:14 PM, Afonso Zimmermann <afonso at disc-os.org>
> wrote:
>
>
> Hi everione,
>
> I'm make some test with pri timer T309. I'm using asterisk 1.4.23.1, libpri
> 1.4.9, dahdi-linux 2.1.0.4 and dahdi-tools 2.1.0.2. But in my tests, the
> timer fail with a telco link in this scenario:
>
> Telco Phone <----------> Telco <-----------> Asterisk <------------> Sip
> Phone
>
> When i make a call from Telco Phone to Sip Phone, the call complete, but
> when i disconnect the link and reconnect in few seconds, the Asterisk clear
> call:
>
> [Apr  3 10:44:40] WARNING[13081]: chan_dahdi.c:4385 handle_alarms: Detected
> alarm on channel 1: Red Alarm
> [Apr  3 10:44:40] NOTICE[21088]: chan_dahdi.c:9558 pri_dchannel: PRI got
> event: Alarm (4) on Primary D-channel of span 1
>   == Spawn extension (disc-from-trunk-TR001, 9800, 2) exited non-zero on
> 'DAHDI/1-1'
> [Apr  3 10:44:40] WARNING[21088]: chan_dahdi.c:3021 pri_find_dchan: No
> D-channels available!  Using Primary channel 16 as D-channel anyway!
> [Apr  3 10:44:40] WARNING[21089]: chan_dahdi.c:4385 handle_alarms: Detected
> alarm on channel 2: Red Alarm
> [Apr  3 10:44:40] WARNING[21089]: chan_dahdi.c:2012 dahdi_disable_ec: Unable
> to disable echo cancellation on channel 2: Invalid argument
> [Apr  3 10:44:40] WARNING[21089]: chan_dahdi.c:4385 handle_alarms: Detected
> alarm on channel 3: Red Alarm
> [Apr  3 10:44:40] WARNING[21089]: chan_dahdi.c:2012 dahdi_disable_ec: Unable
> to disable echo cancellation on channel 3: Invalid argument
> [Apr  3 10:44:40] WARNING[21089]: chan_dahdi.c:4385 handle_alarms: Detected
> alarm on channel 4: Red Alarm
> [Apr  3 10:44:40] WARNING[21089]: chan_dahdi.c:2012 dahdi_disable_ec: Unable
> to disable echo cancellation on channel 4: Invalid argument
> [Apr  3 10:44:40] WARNING[21089]: chan_dahdi.c:4385 handle_alarms: Detected
> alarm on channel 5: Red Alarm
> [Apr  3 10:44:40] WARNING[21089]: chan_dahdi.c:2012 dahdi_disable_ec: Unable
> to disable echo cancellation on channel 5: Invalid argument
> [Apr  3 10:44:40] WARNING[21089]: chan_dahdi.c:4385 handle_alarms: Detected
> alarm on channel 6: Red Alarm
> [Apr  3 10:44:40] WARNING[21089]: chan_dahdi.c:2012 dahdi_disable_ec: Unable
> to disable echo cancellation on channel 6: Invalid argument
> [Apr  3 10:44:40] WARNING[21089]: chan_dahdi.c:4385 handle_alarms: Detected
> alarm on channel 7: Red Alarm
> [Apr  3 10:44:40] WARNING[21089]: chan_dahdi.c:2012 dahdi_disable_ec: Unable
> to disable echo cancellation on channel 7: Invalid argument
> [Apr  3 10:44:40] WARNING[21089]: chan_dahdi.c:4385 handle_alarms: Detected
> alarm on channel 8: Red Alarm
> [Apr  3 10:44:40] WARNING[21089]: chan_dahdi.c:2012 dahdi_disable_ec: Unable
> to disable echo cancellation on channel 8: Invalid argument
> [Apr  3 10:44:40] WARNING[21089]: chan_dahdi.c:4385 handle_alarms: Detected
> alarm on channel 9: Red Alarm
> [Apr  3 10:44:40] WARNING[21089]: chan_dahdi.c:2012 dahdi_disable_ec: Unable
> to disable echo cancellation on channel 9: Invalid argument
> [Apr  3 10:44:40] WARNING[21089]: chan_dahdi.c:4385 handle_alarms: Detected
> alarm on channel 10: Red Alarm
> [Apr  3 10:44:40] WARNING[21089]: chan_dahdi.c:2012 dahdi_disable_ec: Unable
> to disable echo cancellation on channel 10: Invalid argument
> [Apr  3 10:44:40] WARNING[21089]: chan_dahdi.c:4385 handle_alarms: Detected
> alarm on channel 11: Red Alarm
> [Apr  3 10:44:40] WARNING[21089]: chan_dahdi.c:2012 dahdi_disable_ec: Unable
> to disable echo cancellation on channel 11: Invalid argument
> [Apr  3 10:44:40] WARNING[21089]: chan_dahdi.c:4385 handle_alarms: Detected
> alarm on channel 12: Red Alarm
> [Apr  3 10:44:40] WARNING[21089]: chan_dahdi.c:2012 dahdi_disable_ec: Unable
> to disable echo cancellation on channel 12: Invalid argument
> [Apr  3 10:44:40] WARNING[21089]: chan_dahdi.c:4385 handle_alarms: Detected
> alarm on channel 13: Red Alarm
> [Apr  3 10:44:40] WARNING[21089]: chan_dahdi.c:2012 dahdi_disable_ec: Unable
> to disable echo cancellation on channel 13: Invalid argument
> [Apr  3 10:44:40] WARNING[21089]: chan_dahdi.c:4385 handle_alarms: Detected
> alarm on channel 14: Red Alarm
> [Apr  3 10:44:40] WARNING[21089]: chan_dahdi.c:2012 dahdi_disable_ec: Unable
> to disable echo cancellation on channel 14: Invalid argument
> [Apr  3 10:44:40] WARNING[21089]: chan_dahdi.c:4385 handle_alarms: Detected
> alarm on channel 15: Red Alarm
> [Apr  3 10:44:40] WARNING[21089]: chan_dahdi.c:2012 dahdi_disable_ec: Unable
> to disable echo cancellation on channel 15: Invalid argument
> [Apr  3 10:44:40] WARNING[21089]: chan_dahdi.c:4385 handle_alarms: Detected
> alarm on channel 17: Red Alarm
> [Apr  3 10:44:40] WARNING[21089]: chan_dahdi.c:2012 dahdi_disable_ec: Unable
> to disable echo cancellation on channel 17: Invalid argument
> [Apr  3 10:44:40] WARNING[21089]: chan_dahdi.c:4385 handle_alarms: Detected
> alarm on channel 18: Red Alarm
> [Apr  3 10:44:40] WARNING[21089]: chan_dahdi.c:2012 dahdi_disable_ec: Unable
> to disable echo cancellation on channel 18: Invalid argument
> [Apr  3 10:44:40] WARNING[21089]: chan_dahdi.c:4385 handle_alarms: Detected
> alarm on channel 19: Red Alarm
> [Apr  3 10:44:40] WARNING[21089]: chan_dahdi.c:2012 dahdi_disable_ec: Unable
> to disable echo cancellation on channel 19: Invalid argument
> [Apr  3 10:44:40] WARNING[21089]: chan_dahdi.c:4385 handle_alarms: Detected
> alarm on channel 20: Red Alarm
> [Apr  3 10:44:40] WARNING[21089]: chan_dahdi.c:2012 dahdi_disable_ec: Unable
> to disable echo cancellation on channel 20: Invalid argument
> [Apr  3 10:44:40] WARNING[21089]: chan_dahdi.c:4385 handle_alarms: Detected
> alarm on channel 21: Red Alarm
> [Apr  3 10:44:40] WARNING[21089]: chan_dahdi.c:2012 dahdi_disable_ec: Unable
> to disable echo cancellation on channel 21: Invalid argument
> NEW_HANGUP DEBUG: Calling q931_hangup, ourstate Active, peerstate Active
> [Apr  3 10:44:40] WARNING[21089]: chan_dahdi.c:4385 handle_alarms: Detected
> alarm on channel 22: Red Alarm
> q931.c:3009 q931_disconnect: call 1 on channel 1 enters state 11 (Disconnect
> Request)
>
>
> Protocol Discriminator: Q.931 (8)  len=9
> Call Ref: len= 2 (reference 1/0x1) (Terminator)
> Message type: DISCONNECT (69)
> [08 02 81 90]
> Cause (len= 4) [ Ext: 1  Coding: CCITT (ITU) standard (0)  Spare: 0
> Location: Private network serving the local user (1)
>
>
> [Apr  3 10:44:40] WARNING[21089]: chan_dahdi.c:2012 dahdi_disable_ec:
>
>
>                   Ext: 1  Cause: Normal Clearing (16), class = Normal Event
>
>
> (1) ]
> Unable to disable echo cancellation on channel 22: Invalid argument
>     -- Hungup 'DAHDI/1-1'
> [Apr  3 10:44:40] WARNING[21089]: chan_dahdi.c:4385 handle_alarms: Detected
> alarm on channel 23: Red Alarm
> [Apr  3 10:44:40] WARNING[21089]: chan_dahdi.c:2012 dahdi_disable_ec: Unable
> to disable echo cancellation on channel 23: Invalid argument
> [Apr  3 10:44:40] WARNING[21089]: chan_dahdi.c:4385 handle_alarms: Detected
> alarm on channel 24: Red Alarm
> [Apr  3 10:44:40] WARNING[21089]: chan_dahdi.c:2012 dahdi_disable_ec: Unable
> to disable echo cancellation on channel 24: Invalid argument
> [Apr  3 10:44:40] WARNING[21089]: chan_dahdi.c:4385 handle_alarms: Detected
> alarm on channel 25: Red Alarm
> [Apr  3 10:44:40] WARNING[21089]: chan_dahdi.c:2012 dahdi_disable_ec: Unable
> to disable echo cancellation on channel 25: Invalid argument
> [Apr  3 10:44:40] WARNING[21089]: chan_dahdi.c:4385 handle_alarms: Detected
> alarm on channel 26: Red Alarm
> [Apr  3 10:44:40] WARNING[21089]: chan_dahdi.c:2012 dahdi_disable_ec: Unable
> to disable echo cancellation on channel 26: Invalid argument
> [Apr  3 10:44:40] WARNING[21089]: chan_dahdi.c:4385 handle_alarms: Detected
> alarm on channel 27: Red Alarm
> [Apr  3 10:44:40] WARNING[21089]: chan_dahdi.c:2012 dahdi_disable_ec: Unable
> to disable echo cancellation on channel 27: Invalid argument
> [Apr  3 10:44:40] WARNING[21089]: chan_dahdi.c:4385 handle_alarms: Detected
> alarm on channel 28: Red Alarm
> [Apr  3 10:44:40] WARNING[21089]: chan_dahdi.c:2012 dahdi_disable_ec: Unable
> to disable echo cancellation on channel 28: Invalid argument
> [Apr  3 10:44:40] WARNING[21089]: chan_dahdi.c:4385 handle_alarms: Detected
> alarm on channel 29: Red Alarm
> [Apr  3 10:44:40] WARNING[21089]: chan_dahdi.c:2012 dahdi_disable_ec: Unable
> to disable echo cancellation on channel 29: Invalid argument
> [Apr  3 10:44:40] WARNING[21089]: chan_dahdi.c:4385 handle_alarms: Detected
> alarm on channel 30: Red Alarm
> [Apr  3 10:44:40] WARNING[21089]: chan_dahdi.c:2012 dahdi_disable_ec: Unable
> to disable echo cancellation on channel 30: Invalid argument
> [Apr  3 10:44:40] WARNING[21089]: chan_dahdi.c:4385 handle_alarms: Detected
> alarm on channel 31: Red Alarm
> [Apr  3 10:44:40] WARNING[21089]: chan_dahdi.c:2012 dahdi_disable_ec: Unable
> to disable echo cancellation on channel 31: Invalid argument
> -- Timeout occured, restarting PRI
> q921.c:438 t200_expire: q921_state now is Q921_LINK_CONNECTION_RELEASED
> q931.c:4019 q931_dl_indication: link is DOWN
> q931.c:4030 q931_dl_indication: cancel call 1 on channel 1 in state 11
> (Disconnect Request)
> Sending Set Asynchronous Balanced Mode Extended
> q921.c:211 q921_send_sabme: q921_state now is Q921_AWAITING_ESTABLISH
> [Apr  3 10:44:44] WARNING[21088]: chan_dahdi.c:3021 pri_find_dchan: No
> D-channels available!  Using Primary channel 16 as D-channel anyway!
> q931.c:3996 pri_dl_down_cancelcall: Cancel non active call after data link
> failure
> q931.c:3951 pri_internal_clear: call 1 on channel 1 enters state 0 (Null)
> NEW_HANGUP DEBUG: Calling q931_hangup, ourstate Null, peerstate Null
> NEW_HANGUP DEBUG: Destroying the call, ourstate Null, peerstate Null
>   == Primary D-Channel on span 1 up
> Sending Set Asynchronous Balanced Mode Extended
> Sending Set Asynchronous Balanced Mode Extended
> Sending Set Asynchronous Balanced Mode Extended
> Sending Set Asynchronous Balanced Mode Extended
> Sending Set Asynchronous Balanced Mode Extended
>
> Apparently, the call is cleared before the libpri execute a t309 code.
>
> My system.conf:
>
> loadzone=br
> defaultzone=br
> span=1,0,0,ccs,hdb3,crc4
> bchan=1-15,17-31
> dchan=16
>
> My chan_dahdi.conf
>
> [trunkgroups]
>
> [channels]
> language=pt_BR
> usecallerid=yes
> hidecallerid=no
> callwaiting=> yes
> usecallingpres=> yes
> callwaitingcallerid=yes
> threewaycalling=yes
> transfer=yes
> cancallforward=yes
> callreturn=yes
> immediate=no
> callerid=asreceived
> faxdetect=both
> loglevel=255
> mfcr2_logging=all
> mfcr2_call_files=yes
> mfcr2_accept_on_offer=no
>
> signalling=pri_cpe
> switchtype=euroisdn
> context=disc-from-trunk-TR001
> pridialplan=unknown
> prilocaldialplan=unknown
> resetinterval=never
> priindication=inband
> facilityenable=no
> overlapdial=no
> txgain=0.0
> rxgain=0.0
> internationalprefix=
> nationalprefix=
> localprefix=
> privateprefix=
> unknownprefix=
> priexclusieve=no
> pritimer=>n200,3
> pritimer=>k,7
> pritimer=>t200,1000
> pritimer=>t203,10000
> pritimer=>t305,30000
> pritimer=>t308,4000
> pritimer=>t309,12000
> pritimer=>t313,4000
> group=1
> callgroup=1
> pickupgroup=1
> channel => 1-15,17-31
>
> Forgive me for my poor English. Any suggestions?
>
> --
> Afonso Zimmermann
>
> _______________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users
>
>
>
> _______________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users
>
>
>
>
> Hi Martin,
>
> The specification of the timer in Asterisk is:
>
> T309: Maintain active calls on Layer 2 disconnection (default -1, Asterisk
> clears calls) EuroISDN: 6000 to 12000 ms, according to (N200 + 1) x T200 +
> 2s
>
> In q931 standart:
>
> Whenever the network layer entity is notified by its data link layer entity
> via the DL-RELEASE
> indication primitive that there is a data link layer malfunction, the
> following procedure shall apply:
>
> a)     Any calls not in the Active state shall be cleared internally.
> b)     For any call in the Active state, a timer T309 shall be started (if
> implemented).
>        If timer T309 is already running, it shall not be restarted.
>        The Q.931 entity shall request layer 2 re-establishment by sending a
> DL-ESTABLISH
>        request primitive.
>        When informed of layer 2 re-establishment by means of the
> DL-ESTABLISH confirmation
>        primitive, the following procedure shall apply:
>        the Q.931 entity shall stop timer T309, and either:
>        –    the Q.931 entity shall send a STATUS message with cause No. 31,
> normal, unspecified,
>             to report the current state to the peer entity; or
>        –    the Q.931 entity shall perform the status enquiry procedure
> according to 5.8.10 to verify
>             the call state of the peer entity.
>        If timer T309 expires prior to data link re-establishment, the
> network shall clear the network
>        connection and call to the remote user with cause No. 27, destination
> out of order;
>        disconnect and release the B-channel; release the call reference and
> enter the Null state.
>        If timer T309 expires prior to data link re-establishment, the user
> shall clear the attached
>        connection (if any) with cause No. 27, destination out of order;
> disconnect and release the B-
>        channel; release the call reference and enter the Null state.
> When a backup D-channel is available, the procedures in Annex F may be used.
> The implementation of timer T309 in the user side is optional and in the
> network side is mandatory.
>
> There are more in this section, but this is the base of the timer usage.
>
> == Spawn extension (disc-from-trunk-TR001, 9800, 2) exited non-zero on
> 'DAHDI/1-1'
>
> This extension is a dial command. Is normal the dial command exit with
> non-zero in this situation?
>
> [disc-from-trunk-TR001]
>
> exten => _XXXX,1,Answer()
> exten => _XXXX,2,Dial(SIP/2002,,T)
> exten => _XXXX,3,Hangup()
>
> exten => _XXXXXXXX,1,Dial(DAHDI/g1/${EXTEN},,T)
> exten => _XXXXXXXX,n,Congestion()
> exten => _XXXXXXXX,n,Hangup()
>
> exten => _0800.,1,Dial(DAHDI/g1/${EXTEN},,T)
> exten => _0800.,n,Congestion()
> exten => _0800.,n,Hangup()
>
> --
> Afonso Zimmermann
>
> _______________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users
>
>
>
> _______________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users
>
>
>
>
> Hi,
>
> Really T309 isn't mandatory in CPE side. But in 2006, a patch for this timer
> is added:
>
> http://insects.digium.com/bug_view_page.php?bug_id=7271&history=1
>
> In 1.4 config files, the timer T309 is in documentation too. But how it work
> in Asterisk, I really don't know.
>
> I don't know if this timer is effective used in PABX. In Brazil, the telcos
> and ISDN PABX implements, but is not mandatory for homologation.
>
> --
> Afonso Zimmermann
>
> _______________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users
>



More information about the asterisk-users mailing list