From owner-freebsd-isdn@FreeBSD.ORG Sun Nov 11 21:50:10 2012 Return-Path: Delivered-To: freebsd-isdn@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4F60BD6 for ; Sun, 11 Nov 2012 21:50:10 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe06.c2i.net [212.247.154.162]) by mx1.freebsd.org (Postfix) with ESMTP id CB2C88FC12 for ; Sun, 11 Nov 2012 21:50:09 +0000 (UTC) X-T2-Spam-Status: No, hits=-1.0 required=5.0 tests=ALL_TRUSTED Received: from [176.74.213.204] (account mc467741@c2i.net HELO laptop015.hselasky.homeunix.org) by mailfe06.swip.net (CommuniGate Pro SMTP 5.4.4) with ESMTPA id 342367160; Sun, 11 Nov 2012 22:45:01 +0100 From: Hans Petter Selasky To: freebsd-isdn@freebsd.org Subject: Re: ISDN4BSD (HPS version) is going into ports Date: Sun, 11 Nov 2012 22:46:44 +0100 User-Agent: KMail/1.13.7 (FreeBSD/9.1-PRERELEASE; KDE/4.8.4; amd64; ; ) References: <509E87EF.9070607@incore.de> In-Reply-To: <509E87EF.9070607@incore.de> X-Face: 'mmZ:T{)),Oru^0c+/}w'`gU1$ubmG?lp!=R4Wy\ELYo2)@'UZ24N@d2+AyewRX}mAm; Yp |U[@, _z/([?1bCfM{_"B<.J>mICJCHAzzGHI{y7{%JVz%R~yJHIji`y>Y}k1C4TfysrsUI -%GU9V5]iUZF&nRn9mJ'?&>O MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201211112246.44683.hselasky@c2i.net> Cc: Andreas Longwitz X-BeenThere: freebsd-isdn@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Using ISDN with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Nov 2012 21:50:10 -0000 On Saturday 10 November 2012 17:59:27 Andreas Longwitz wrote: > Hi, > > I am runnung FreeBSD 8.3 with isdn4bsd 2.0.4 + chan_capi 2.0.2 from > ports and asterisk 1.8.16. On my production system with two HFC-4S > adapters (one in NT-mode, the other in TE-mode) and some SIP-phones I > have the following problem: asterisk runs in a deadlock two or three > times a week, nothing but kill -9 helps. > > During looking for a possible reason for the deadlock I found that > asterisk never destroys a channel from a call initiated inbound by i4b. > > On the asterisk console the command "capi show" always gives the correct > infos about busy isdn channels, but "core show channels verbose" lists > more and more channels. For every call incoming via i4b the channel > remains in the list of active asterisk channels. Outgoing isdn channels > and all sip channels disappear after hangup. > > For a call incoming via i4b I see on hangup that chan_capi_hangup() is > called and then cd_free() with state=6 (CAPI_STATE_CONNECTED), > send_release_complete=1, causeOut=0x3490 and hangup_what=0. Afterwards I > see the call of capi_send_disconnect_req. > > In the case of dir_incoming I can see nothing that informs asterisk > about the free channel. I suppose in the case dir_outgoing this is done > by "ast_setstate(pbx_chan, AST_STATE_DOWN)" in cd_free(). Hi, I'll have a look at this issue this week. Sounds like reproducible. We probably should compare with other channel drivers what they are doing. Do you see this problem using older versions of asterisk? --HPS From owner-freebsd-isdn@FreeBSD.ORG Mon Nov 12 09:43:40 2012 Return-Path: Delivered-To: freebsd-isdn@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 94F5A901 for ; Mon, 12 Nov 2012 09:43:40 +0000 (UTC) (envelope-from longwitz@incore.de) Received: from dss.incore.de (dss.incore.de [195.145.1.138]) by mx1.freebsd.org (Postfix) with ESMTP id 4C2468FC13 for ; Mon, 12 Nov 2012 09:43:39 +0000 (UTC) Received: from inetmail.dmz (inetmail.dmz [10.3.0.3]) by dss.incore.de (Postfix) with ESMTP id 0776A5C81F; Mon, 12 Nov 2012 10:43:33 +0100 (CET) X-Virus-Scanned: amavisd-new at incore.de Received: from dss.incore.de ([10.3.0.3]) by inetmail.dmz (inetmail.dmz [10.3.0.3]) (amavisd-new, port 10024) with LMTP id OJx67US8Wrko; Mon, 12 Nov 2012 10:43:32 +0100 (CET) Received: from mail.incore (fwintern.dmz [10.0.0.253]) by dss.incore.de (Postfix) with ESMTP id 4958C5C825; Mon, 12 Nov 2012 10:43:32 +0100 (CET) Received: from bsdlo.incore (bsdlo.incore [192.168.0.84]) by mail.incore (Postfix) with ESMTP id 433D95084C; Mon, 12 Nov 2012 10:43:32 +0100 (CET) Message-ID: <50A0C4C4.9010100@incore.de> Date: Mon, 12 Nov 2012 10:43:32 +0100 From: Andreas Longwitz User-Agent: Thunderbird 2.0.0.19 (X11/20090113) MIME-Version: 1.0 To: Hans Petter Selasky Subject: Re: ISDN4BSD (HPS version) is going into ports References: <509E87EF.9070607@incore.de> <201211112246.44683.hselasky@c2i.net> In-Reply-To: <201211112246.44683.hselasky@c2i.net> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-isdn@freebsd.org X-BeenThere: freebsd-isdn@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Using ISDN with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2012 09:43:40 -0000 Hi, >> On the asterisk console the command "capi show" always gives the correct >> infos about busy isdn channels, but "core show channels verbose" lists >> more and more channels. For every call incoming via i4b the channel >> remains in the list of active asterisk channels. Outgoing isdn channels >> and all sip channels disappear after hangup. >> >> For a call incoming via i4b I see on hangup that chan_capi_hangup() is >> called and then cd_free() with state=6 (CAPI_STATE_CONNECTED), >> send_release_complete=1, causeOut=0x3490 and hangup_what=0. Afterwards I >> see the call of capi_send_disconnect_req. >> >> In the case of dir_incoming I can see nothing that informs asterisk >> about the free channel. I suppose in the case dir_outgoing this is done >> by "ast_setstate(pbx_chan, AST_STATE_DOWN)" in cd_free(). > > Hi, > > I'll have a look at this issue this week. Sounds like reproducible. We > probably should compare with other channel drivers what they are doing. As far as I can see sip_hangup() makes no difference between incoming and outgoing calls. chan_capi_hangup() calls cd_free(cd, 0), a function with extra handling for dir_outgoing. > > Do you see this problem using older versions of asterisk? Difficult to say. In asterisk 1.4 (with FreeBSD 6) not, in asterisk 1.6 probably yes. -- Andreas Longwitz From owner-freebsd-isdn@FreeBSD.ORG Mon Nov 12 10:23:42 2012 Return-Path: Delivered-To: freebsd-isdn@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C9C8FF6 for ; Mon, 12 Nov 2012 10:23:42 +0000 (UTC) (envelope-from freebsd@psconsult.nl) Received: from mx1.psconsult.nl (unknown [IPv6:2001:7b8:30f:e0::5059:ee8a]) by mx1.freebsd.org (Postfix) with ESMTP id 2B69B8FC08 for ; Mon, 12 Nov 2012 10:23:41 +0000 (UTC) Received: from mx1.psconsult.nl (mx1.hvnu.psconsult.nl [46.44.189.154]) by mx1.psconsult.nl (8.14.5/8.14.4) with ESMTP id qACANWxQ014035 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 12 Nov 2012 11:23:37 +0100 (CET) (envelope-from freebsd@psconsult.nl) Received: (from paul@localhost) by mx1.psconsult.nl (8.14.5/8.14.4/Submit) id qACANW0d014034; Mon, 12 Nov 2012 11:23:32 +0100 (CET) (envelope-from freebsd@psconsult.nl) X-Authentication-Warning: mx1.psconsult.nl: paul set sender to freebsd@psconsult.nl using -f Date: Mon, 12 Nov 2012 11:23:32 +0100 From: Paul Schenkeveld To: freebsd-isdn@freebsd.org Subject: Re: ISDN4BSD (HPS version) is going into ports Message-ID: <20121112102332.GA13575@psconsult.nl> References: <509E87EF.9070607@incore.de> <201211112246.44683.hselasky@c2i.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201211112246.44683.hselasky@c2i.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: freebsd-isdn@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Using ISDN with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2012 10:23:42 -0000 On Sun, Nov 11, 2012 at 10:46:44PM +0100, Hans Petter Selasky wrote: > On Saturday 10 November 2012 17:59:27 Andreas Longwitz wrote: > > Hi, > > > > I am runnung FreeBSD 8.3 with isdn4bsd 2.0.4 + chan_capi 2.0.2 from > > ports and asterisk 1.8.16. On my production system with two HFC-4S > > adapters (one in NT-mode, the other in TE-mode) and some SIP-phones I > > have the following problem: asterisk runs in a deadlock two or three > > times a week, nothing but kill -9 helps. > > > > During looking for a possible reason for the deadlock I found that > > asterisk never destroys a channel from a call initiated inbound by i4b. > > > > On the asterisk console the command "capi show" always gives the correct > > infos about busy isdn channels, but "core show channels verbose" lists > > more and more channels. For every call incoming via i4b the channel > > remains in the list of active asterisk channels. Outgoing isdn channels > > and all sip channels disappear after hangup. > > > > For a call incoming via i4b I see on hangup that chan_capi_hangup() is > > called and then cd_free() with state=6 (CAPI_STATE_CONNECTED), > > send_release_complete=1, causeOut=0x3490 and hangup_what=0. Afterwards I > > see the call of capi_send_disconnect_req. > > > > In the case of dir_incoming I can see nothing that informs asterisk > > about the free channel. I suppose in the case dir_outgoing this is done > > by "ast_setstate(pbx_chan, AST_STATE_DOWN)" in cd_free(). > > Hi, > > I'll have a look at this issue this week. Sounds like reproducible. We > probably should compare with other channel drivers what they are doing. > > Do you see this problem using older versions of asterisk? I still have one asterisk 1.8.8.1 server on FreeBSD 8.2 with a single HFC card connected to the public ISDN network. It's only used to receive calls. Seems my channels hang till next restart of asterisk too: pbx*CLI> core show channels verbose Channel Context Extension Prio State Application Data CallerID Duration Accountcode PeerAccount BridgedTo CAPI/isdn/30 isdn-in xxxxxxxxx 5 Ring (None) (None) yyyyyyyyyy - (None) CAPI/isdn/30 isdn-in xxxxxxxxx 5 Ring (None) (None) yyyyyyyyyy - (None) CAPI/isdn/30 isdn-in xxxxxxxxx 5 Ring (None) (None) yyyyyyyyyy - (None) CAPI/isdn/30 isdn-in xxxxxxxxx 5 Ring (None) (None) yyyyyyyyyy - (None) CAPI/isdn/30 isdn-in xxxxxxxxx 5 Ring (None) (None) yyyyyyyyyy - (None) CAPI/isdn/30 isdn-in xxxxxxxxx 5 Ring (None) (None) yyyyyyyyyy - (None) CAPI/isdn/30 isdn-in xxxxxxxxx 5 Ring (None) (None) yyyyyyyyyy - (None) CAPI/isdn/30 isdn-in xxxxxxxxx 5 Up (None) (None) yyyyyyyyyy 351:59:4 (None) CAPI/isdn/30 isdn-in xxxxxxxxx 5 Up (None) (None) yyyyyyyyyy 336:01:3 (None) CAPI/isdn/30 isdn-in xxxxxxxxx 7 Up (None) (None) yyyyyyyyyy - (None) CAPI/isdn/30 isdn-in xxxxxxxxx 5 Up (None) (None) 331:27:2 (None) CAPI/isdn/30 isdn-in xxxxxxxxx 5 Up (None) (None) yyyyyyyyyy 315:21:5 (None) CAPI/isdn/30 isdn-in xxxxxxxxx 5 Up (None) (None) 302:36:1 (None) CAPI/isdn/30 isdn-in xxxxxxxxx 5 Up (None) (None) yyyyyyyyyy 290:39:1 (None) CAPI/isdn/30 isdn-in xxxxxxxxx 5 Up (None) (None) yyyyyyyyyy 280:28:1 (None) CAPI/isdn/30 isdn-in xxxxxxxxx 5 Up (None) (None) 278:20:4 (None) CAPI/isdn/30 isdn-in xxxxxxxxx 5 Up (None) (None) 277:53:5 (None) CAPI/isdn/30 isdn-in xxxxxxxxx 5 Up (None) (None) 277:45:4 (None) CAPI/isdn/30 isdn-in xxxxxxxxx 5 Up (None) (None) yyyyyyyyyy 264:39:5 (None) CAPI/isdn/30 isdn-in xxxxxxxxx 5 Up (None) (None) yyyyyyyyyy 264:24:5 (None) CAPI/isdn/30 isdn-in xxxxxxxxx 5 Up (None) (None) yyyyyyyyyy 254:25:3 (None) CAPI/isdn/30 isdn-in xxxxxxxxx 5 Up (None) (None) yyyyyyyyyy 239:24:1 (None) CAPI/isdn/30 isdn-in xxxxxxxxx 5 Up (None) (None) yyyyyyyyyy 234:59:0 (None) CAPI/isdn/30 isdn-in xxxxxxxxx 5 Up (None) (None) yyyyyyyyyy 232:32:3 (None) CAPI/isdn/30 isdn-in xxxxxxxxx 5 Up (None) (None) yyyyyyyyyy 231:07:1 (None) CAPI/isdn/30 isdn-in xxxxxxxxx 5 Up (None) (None) yyyyyyyyyy 210:29:1 (None) CAPI/isdn/30 isdn-in xxxxxxxxx 5 Up (None) (None) yyyyyyyyyy 187:45:1 (None) CAPI/isdn/30 isdn-in xxxxxxxxx 5 Up (None) (None) yyyyyyyyyy 167:34:1 (None) CAPI/isdn/30 isdn-in xxxxxxxxx 5 Up (None) (None) yyyyyyyyyy 167:10:2 (None) CAPI/isdn/30 isdn-in xxxxxxxxx 5 Up (None) (None) yyyyyyyyyy 147:33:0 (None) CAPI/isdn/30 isdn-in xxxxxxxxx 5 Up (None) (None) 142:21:1 (None) CAPI/isdn/30 isdn-in xxxxxxxxx 5 Up (None) (None) yyyyyyyyyy 140:36:1 (None) CAPI/isdn/30 isdn-in xxxxxxxxx 5 Up (None) (None) yyyyyyyyyy 113:32:1 (None) CAPI/isdn/30 isdn-in xxxxxxxxx 10 Up (None) (None) - (None) CAPI/isdn/30 isdn-in xxxxxxxxx 5 Up (None) (None) yyyyyyyyyy 88:15:20 (None) CAPI/isdn/30 isdn-in xxxxxxxxx 5 Up (None) (None) yyyyyyyyyy 64:05:35 (None) CAPI/isdn/30 isdn-in xxxxxxxxx 5 Ring (None) (None) yyyyyyyyyy - (None) 37 active channels 0 active calls 111 calls processed The asterisk process was started on Oct 28, 2012 which matches the oldest channel. HTH Paul Schenkeveld From owner-freebsd-isdn@FreeBSD.ORG Mon Nov 12 14:01:26 2012 Return-Path: Delivered-To: freebsd-isdn@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 09BD8725 for ; Mon, 12 Nov 2012 14:01:26 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe08.c2i.net [212.247.154.226]) by mx1.freebsd.org (Postfix) with ESMTP id 79A368FC13 for ; Mon, 12 Nov 2012 14:01:25 +0000 (UTC) X-T2-Spam-Status: No, hits=-0.2 required=5.0 tests=ALL_TRUSTED, BAYES_50 Received: from [176.74.213.204] (account mc467741@c2i.net HELO laptop015.hselasky.homeunix.org) by mailfe08.swip.net (CommuniGate Pro SMTP 5.4.4) with ESMTPA id 344634262; Mon, 12 Nov 2012 14:56:17 +0100 From: Hans Petter Selasky To: Paul Schenkeveld Subject: Re: ISDN4BSD (HPS version) is going into ports Date: Mon, 12 Nov 2012 14:58:01 +0100 User-Agent: KMail/1.13.7 (FreeBSD/9.1-PRERELEASE; KDE/4.8.4; amd64; ; ) References: <509E87EF.9070607@incore.de> <201211112246.44683.hselasky@c2i.net> <20121112102332.GA13575@psconsult.nl> In-Reply-To: <20121112102332.GA13575@psconsult.nl> X-Face: 'mmZ:T{)),Oru^0c+/}w'`gU1$ubmG?lp!=R4Wy\ELYo2)@'UZ24N@d2+AyewRX}mAm; Yp |U[@, _z/([?1bCfM{_"B<.J>mICJCHAzzGHI{y7{%JVz%R~yJHIji`y>Y}k1C4TfysrsUI -%GU9V5]iUZF&nRn9mJ'?&>O MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201211121458.01139.hselasky@c2i.net> Cc: freebsd-isdn@freebsd.org X-BeenThere: freebsd-isdn@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Using ISDN with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2012 14:01:26 -0000 Hi, I looks like this is a problem on 1.8.x only. I have a 1.6.x system bridging to SIP and more and I don't see lots of unref'ed structures. It appears to me that the Asterisk API has changed, and now needs a final de- ref, by the allocator of the call structure. Could you try this patch, on a non-production system and see what happens: Index: chan_capi/chan_capi.c =================================================================== --- chan_capi/chan_capi.c (revision 2419) +++ chan_capi/chan_capi.c (working copy) @@ -1945,6 +1945,11 @@ if (pbx_chan->rings == 0) pbx_chan->rings = 1; } + } else { +#if (CC_AST_VERSION >= 0x10800) + /* drop final refcount */ + hangup_what |= 2; +#endif } if (hard_hangup) { Thank you, -- HPS From owner-freebsd-isdn@FreeBSD.ORG Mon Nov 12 20:49:49 2012 Return-Path: Delivered-To: freebsd-isdn@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 785F9F6A for ; Mon, 12 Nov 2012 20:49:49 +0000 (UTC) (envelope-from freebsd@psconsult.nl) Received: from mx1.psconsult.nl (unknown [IPv6:2001:7b8:30f:e0::5059:ee8a]) by mx1.freebsd.org (Postfix) with ESMTP id 274F38FC1A for ; Mon, 12 Nov 2012 20:49:48 +0000 (UTC) Received: from mx1.psconsult.nl (mx1.hvnu.psconsult.nl [46.44.189.154]) by mx1.psconsult.nl (8.14.5/8.14.4) with ESMTP id qACKngUf017740 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 12 Nov 2012 21:49:47 +0100 (CET) (envelope-from freebsd@psconsult.nl) Received: (from paul@localhost) by mx1.psconsult.nl (8.14.5/8.14.4/Submit) id qACKngrb017739 for freebsd-isdn@freebsd.org; Mon, 12 Nov 2012 21:49:42 +0100 (CET) (envelope-from freebsd@psconsult.nl) X-Authentication-Warning: mx1.psconsult.nl: paul set sender to freebsd@psconsult.nl using -f Date: Mon, 12 Nov 2012 21:49:42 +0100 From: Paul Schenkeveld To: freebsd-isdn@freebsd.org Subject: Re: ISDN4BSD (HPS version) is going into ports Message-ID: <20121112204941.GA17627@psconsult.nl> References: <509E87EF.9070607@incore.de> <201211112246.44683.hselasky@c2i.net> <20121112102332.GA13575@psconsult.nl> <201211121458.01139.hselasky@c2i.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201211121458.01139.hselasky@c2i.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: freebsd-isdn@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Using ISDN with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2012 20:49:49 -0000 On Mon, Nov 12, 2012 at 02:58:01PM +0100, Hans Petter Selasky wrote: > Hi, > > I looks like this is a problem on 1.8.x only. I have a 1.6.x system bridging > to SIP and more and I don't see lots of unref'ed structures. > > It appears to me that the Asterisk API has changed, and now needs a final de- > ref, by the allocator of the call structure. Could you try this patch, on a > non-production system and see what happens: I don't have a non-production system with ISDN installed atm, will try and get hold of one for testing. With kind regards, Paul Schenkeveld From owner-freebsd-isdn@FreeBSD.ORG Mon Nov 12 22:14:29 2012 Return-Path: Delivered-To: freebsd-isdn@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 34FA8892 for ; Mon, 12 Nov 2012 22:14:29 +0000 (UTC) (envelope-from longwitz@incore.de) Received: from dss.incore.de (dss.incore.de [195.145.1.138]) by mx1.freebsd.org (Postfix) with ESMTP id DF9A38FC12 for ; Mon, 12 Nov 2012 22:14:28 +0000 (UTC) Received: from inetmail.dmz (inetmail.dmz [10.3.0.3]) by dss.incore.de (Postfix) with ESMTP id A1B315C860; Mon, 12 Nov 2012 23:14:27 +0100 (CET) X-Virus-Scanned: amavisd-new at incore.de Received: from dss.incore.de ([10.3.0.3]) by inetmail.dmz (inetmail.dmz [10.3.0.3]) (amavisd-new, port 10024) with LMTP id 3wjBaROZZ1xq; Mon, 12 Nov 2012 23:14:26 +0100 (CET) Received: from mail.incore (fwintern.dmz [10.0.0.253]) by dss.incore.de (Postfix) with ESMTP id E7C475C85F; Mon, 12 Nov 2012 23:14:26 +0100 (CET) Received: from bsdmhs.longwitz (unknown [192.168.99.6]) by mail.incore (Postfix) with ESMTP id 8A8085084C; Mon, 12 Nov 2012 23:14:26 +0100 (CET) Message-ID: <50A174C2.2050807@incore.de> Date: Mon, 12 Nov 2012 23:14:26 +0100 From: Andreas Longwitz User-Agent: Thunderbird 2.0.0.19 (X11/20090113) MIME-Version: 1.0 To: Hans Petter Selasky Subject: Re: ISDN4BSD (HPS version) is going into ports References: <509E87EF.9070607@incore.de> <201211112246.44683.hselasky@c2i.net> In-Reply-To: <201211112246.44683.hselasky@c2i.net> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-isdn@freebsd.org X-BeenThere: freebsd-isdn@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Using ISDN with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2012 22:14:29 -0000 Hi Hans > It appears to me that the Asterisk API has changed, and now needs a > final deref, by the allocator of the call structure. Could you try > this patch, on a non-production system and see what happens: > Index: chan_capi/chan_capi.c > =================================================================== > --- chan_capi/chan_capi.c (revision 2419) > +++ chan_capi/chan_capi.c (working copy) > @@ -1945,6 +1945,11 @@ > if (pbx_chan->rings == 0) > pbx_chan->rings = 1; > } > + } else { > +#if (CC_AST_VERSION >= 0x10800) > + /* drop final refcount */ > + hangup_what |= 2; > +#endif > } > > if (hard_hangup) { I have tried this patch and the result with one incoming call looks like this: -> asterisk -rx "core show channels" (before the call) Channel Location State Application(Data) 0 active channels 0 active calls 0 calls processed Asterisk ending (0). -> asterisk -rx "core show channels" (during the call) Channel Location State Application(Data) CAPI/ISDN_TE_1/49940 4994068@capi_telekom Up Playback(rup_ansage_zeiten) 1 active channel 1 active call 1 call processed Asterisk ending (0). -> asterisk -rx "core show channels" (after hangup) Channel Location State Application(Data) 4994068@capi_telekom Up (None) 1 active channel 0 active calls 1 call processed Asterisk ending (0) With the patch, only the name of the channel has gone, not the channel itself. Without the patch the output of the last command (after hangup) was the same as during the call. . -- Andreas Longwitz From owner-freebsd-isdn@FreeBSD.ORG Tue Nov 13 11:01:18 2012 Return-Path: Delivered-To: freebsd-isdn@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A555B747 for ; Tue, 13 Nov 2012 11:01:18 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe06.c2i.net [212.247.154.162]) by mx1.freebsd.org (Postfix) with ESMTP id 2CD068FC13 for ; Tue, 13 Nov 2012 11:01:15 +0000 (UTC) X-T2-Spam-Status: No, hits=-0.2 required=5.0 tests=ALL_TRUSTED, BAYES_50 Received: from [176.74.213.204] (account mc467741@c2i.net HELO laptop015.hselasky.homeunix.org) by mailfe06.swip.net (CommuniGate Pro SMTP 5.4.4) with ESMTPA id 342999703; Tue, 13 Nov 2012 12:01:09 +0100 From: Hans Petter Selasky To: Andreas Longwitz Subject: Re: ISDN4BSD (HPS version) is going into ports Date: Tue, 13 Nov 2012 12:02:47 +0100 User-Agent: KMail/1.13.7 (FreeBSD/9.1-PRERELEASE; KDE/4.8.4; amd64; ; ) References: <509E87EF.9070607@incore.de> <201211112246.44683.hselasky@c2i.net> <50A174C2.2050807@incore.de> In-Reply-To: <50A174C2.2050807@incore.de> X-Face: 'mmZ:T{)),Oru^0c+/}w'`gU1$ubmG?lp!=R4Wy\ELYo2)@'UZ24N@d2+AyewRX}mAm; Yp |U[@, _z/([?1bCfM{_"B<.J>mICJCHAzzGHI{y7{%JVz%R~yJHIji`y>Y}k1C4TfysrsUI -%GU9V5]iUZF&nRn9mJ'?&>O MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201211131202.47188.hselasky@c2i.net> Cc: freebsd-isdn@freebsd.org X-BeenThere: freebsd-isdn@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Using ISDN with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2012 11:01:18 -0000 Hi, The issue about "core show channels" that shows more and more channels, happens only in Asterisk 1.8.x and is due to chan_capi not updating the channel name correctly according to how Asterisk expects it being done. The issue about deadlock should be solved by moving the channel allocation outside of the CAPI applications lock. Channel free is already outside this lock. There now will always be a free channel, when no call is pending. Please also note that the CDR start time might be different than before. That means it should be set to the time when the PBX thread was started for incoming calls, not when doing DID (dial in digits), and for outgoing calls, when the asterisk channel was allocated. Fixes are available in my I4B SVN repository in the trunk/chan_capi folder. Please test and report back! Thanks for valuable feedback! --HPS From owner-freebsd-isdn@FreeBSD.ORG Tue Nov 13 14:46:02 2012 Return-Path: Delivered-To: freebsd-isdn@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8C483DA3 for ; Tue, 13 Nov 2012 14:46:02 +0000 (UTC) (envelope-from longwitz@incore.de) Received: from dss.incore.de (dss.incore.de [195.145.1.138]) by mx1.freebsd.org (Postfix) with ESMTP id 433CC8FC14 for ; Tue, 13 Nov 2012 14:46:01 +0000 (UTC) Received: from inetmail.dmz (inetmail.dmz [10.3.0.3]) by dss.incore.de (Postfix) with ESMTP id A0EB65C8D5; Tue, 13 Nov 2012 15:45:55 +0100 (CET) X-Virus-Scanned: amavisd-new at incore.de Received: from dss.incore.de ([10.3.0.3]) by inetmail.dmz (inetmail.dmz [10.3.0.3]) (amavisd-new, port 10024) with LMTP id zd87v2fNLazx; Tue, 13 Nov 2012 15:45:54 +0100 (CET) Received: from mail.incore (fwintern.dmz [10.0.0.253]) by dss.incore.de (Postfix) with ESMTP id BC9075C8D4; Tue, 13 Nov 2012 15:45:54 +0100 (CET) Received: from bsdlo.incore (bsdlo.incore [192.168.0.84]) by mail.incore (Postfix) with ESMTP id B573550880; Tue, 13 Nov 2012 15:45:54 +0100 (CET) Message-ID: <50A25D22.7040504@incore.de> Date: Tue, 13 Nov 2012 15:45:54 +0100 From: Andreas Longwitz User-Agent: Thunderbird 2.0.0.19 (X11/20090113) MIME-Version: 1.0 To: Hans Petter Selasky Subject: Re: ISDN4BSD (HPS version) is going into ports References: <509E87EF.9070607@incore.de> <201211112246.44683.hselasky@c2i.net> <50A174C2.2050807@incore.de> <201211131202.47188.hselasky@c2i.net> In-Reply-To: <201211131202.47188.hselasky@c2i.net> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-isdn@freebsd.org X-BeenThere: freebsd-isdn@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Using ISDN with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2012 14:46:02 -0000 Hi Hans, > The issue about "core show channels" that shows more and more channels, > happens only in Asterisk 1.8.x and is due to chan_capi not updating the > channel name correctly according to how Asterisk expects it being done. With revision 2473 of isnd4bsd this problem is solved: -> asterisk -rx "core show channels" (before incoming call) Channel Location State Application(Data) CAPI//-free s@default:1 Down (None) 1 active channel 0 active calls 0 calls processed Asterisk ending (0). -> asterisk -rx "core show channels" (during the call) Channel Location State Application(Data) SIP/34-00000000 4994068@from-interna Ringing AppDial((Outgoing Line)) CAPI/ISDN_TE_1/49940 4994068@capi_telekom Ring Dial(SIP/34,30,gj) CAPI//-free s@default:1 Down (None) 3 active channels 1 active call 1 call processed Asterisk ending (0). -> asterisk -rx "core show channels" (after hangup) Channel Location State Application(Data) CAPI//-free s@default:1 Down (None) 1 active channel 0 active calls 1 call processed Asterisk ending (0). > The issue about deadlock should be solved by moving the channel allocation > outside of the CAPI applications lock. Channel free is already outside this > lock. There now will always be a free channel, when no call is pending. Please > also note that the CDR start time might be different than before. That means > it should be set to the time when the PBX thread was started for incoming > calls, not when doing DID (dial in digits), and for outgoing calls, when the > asterisk channel was allocated. > > Fixes are available in my I4B SVN repository in the trunk/chan_capi folder. > > Please test and report back! I will do some tests and then update my production server and report the results. > Thanks for valuable feedback! Thanks for valuable correction! -- Andreas Longwitz From owner-freebsd-isdn@FreeBSD.ORG Thu Nov 15 17:11:01 2012 Return-Path: Delivered-To: freebsd-isdn@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4F1F370A for ; Thu, 15 Nov 2012 17:11:01 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe04.c2i.net [212.247.154.98]) by mx1.freebsd.org (Postfix) with ESMTP id C64488FC13 for ; Thu, 15 Nov 2012 17:11:00 +0000 (UTC) X-T2-Spam-Status: No, hits=-1.0 required=5.0 tests=ALL_TRUSTED Received: from [176.74.213.204] (account mc467741@c2i.net HELO laptop015.hselasky.homeunix.org) by mailfe04.swip.net (CommuniGate Pro SMTP 5.4.4) with ESMTPA id 343992561; Thu, 15 Nov 2012 18:10:52 +0100 From: Hans Petter Selasky To: freebsd-isdn@freebsd.org Subject: Re: ISDN4BSD (HPS version) is going into ports Date: Thu, 15 Nov 2012 18:12:32 +0100 User-Agent: KMail/1.13.7 (FreeBSD/9.1-PRERELEASE; KDE/4.8.4; amd64; ; ) References: <509E87EF.9070607@incore.de> In-Reply-To: <509E87EF.9070607@incore.de> X-Face: 'mmZ:T{)),Oru^0c+/}w'`gU1$ubmG?lp!=R4Wy\ELYo2)@'UZ24N@d2+AyewRX}mAm; Yp |U[@, _z/([?1bCfM{_"B<.J>mICJCHAzzGHI{y7{%JVz%R~yJHIji`y>Y}k1C4TfysrsUI -%GU9V5]iUZF&nRn9mJ'?&>O MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201211151812.32616.hselasky@c2i.net> Cc: Andreas Longwitz X-BeenThere: freebsd-isdn@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Using ISDN with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Nov 2012 17:11:01 -0000 Hi, The chan_capi port has now been updated to version "chan_capi-2.0.3" which should resolve the mentioned issues. If not, please let me know. Thanks! -_HPS