From owner-freebsd-isdn@FreeBSD.ORG Sat May 28 13:34:11 2005 Return-Path: X-Original-To: freebsd-isdn@freebsd.org Delivered-To: freebsd-isdn@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2F99016A41C for ; Sat, 28 May 2005 13:34:11 +0000 (GMT) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe06.swip.net [212.247.154.161]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9408743D1D for ; Sat, 28 May 2005 13:34:10 +0000 (GMT) (envelope-from hselasky@c2i.net) X-T2-Posting-ID: Y1QAsIk9O44SO+J/q9KNyQ== Received: from mp-216-46-229.daxnet.no ([193.216.46.229] verified) by mailfe06.swip.net (CommuniGate Pro SMTP 4.3c5) with ESMTP id 368676549; Sat, 28 May 2005 15:34:08 +0200 From: Hans Petter Selasky To: freebsd-isdn@freebsd.org Date: Sat, 28 May 2005 15:34:56 +0200 User-Agent: KMail/1.7 References: <20050526202222.E2BD81EAE291@alice.turbocat.de> <20050527140607.GA41449@minerva.krx.nl> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200505281534.58499.hselasky@c2i.net> Cc: Steven Looman Subject: Re: Asterisk on FreeBSD + ISDN BRI X-BeenThere: freebsd-isdn@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: hselasky@c2i.net List-Id: Using ISDN with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 May 2005 13:34:11 -0000 On Friday 27 May 2005 16:21, Juha-Matti Liukkonen wrote: > Hi, > > back in the day when I wrote the AVM active card support to i4b, I > fantasized about pulling the capi layer up as the kernel-userland > interface instead of i4b_layer4; this would have meant implementing a > capi-specification-compliant (and AFAIK linux-compatible) /dev/capi20 > and rewriting isdnd to use it instead of the current i4b* devices. A > good part of the necessary support code is already present in the > capi layer (i4b layer4 only registers as one client application for > the somewhat-more-generic capi layer). > > Passive card support would have meant writing a "capi link-layer > driver" (a la capi_iavc for the AVM isdn chipsets) for the i4b > passive stack, which hosts the existing passive card drivers. Didn't > seem an insurmountable task at the time. Re-doing isdnd, on the other > hand, did seem like somewhat of an effort. > > I'm not sure what the relevance of this design is any more, > considering that c4b is sort-of doing the same thing, but this way > it'd be reasonably easy to provide a CAPI interface for all i4b- > supported passive cards. I know that Windows uses CAPI to support ISDN devices, but the problem there is that only one ISDN device is allowed at a time. So can CAPI handle more than one physical device per CAPI interface (/dev/capi20) ? > > On 27.5.2005, at 17.06, Steven Looman wrote: > > Or how about writing a capi emulation layer on top of the CAPI > > interface? > > Don't know if this is possible at all, since there can be timing > > issues? This shouldn't be so difficult. One just has got to number the consumers, for example /dev/i4b0, /dev/i4b1, /dev/i4b2 ... Then the cdid (call-descriptor-ID) will be shared among all interfaces. When sending messages to these devices then two modes have got to be supported: Broadcast and peer-to-peer. A function, cd_set_consumer(), decides whether a given call-descriptor (cd) receives/transmits broadcasted or peered messages. By default broadcast is selected. Then an incoming call will look like this: cd_set_consumer(cd, NULL); i4b_l4_connect_ind(cd); ... case I4B_CONNECT_RESPONSE: c1 = consumer-pointer of the device that received the message; if(cd->consumer == NULL || cd->consumer == c1) { while((c2 = ...)) { if(c1 != c2) { cd_set_consumer(cd, c2); i4b_l4_disconnect_ind(cd); } } cd_set_consumer(cd, c1); N_CONNECT_RESPONSE(...); } ... Something similar to this is done to allow the DSS1 protocol to operate in NT-mode. Though one has got to put a limit on the number of consumers, for the sake of speed. I guess that "consumer" is called AppletID in CAPI? After this transition is done, one can just put a packet converter on top of one of the /dev/i4bN devices to get a CAPI device? > > The ability to use CAPI with cheap cards (like in Windows for > > example) sounds > > great as it would be easier to write multiplatform applications. I don't think that CAPI is fit for every situation. Putting things in a library on top of "isdnd" is going to be much more powerful than if one writes a dedicated CAPI-compatible telephony application? What kind of applications are we talking about porting? --HPS