From owner-freebsd-isdn@FreeBSD.ORG Fri May 13 14:05:47 2005 Return-Path: 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 206C816A4CE for ; Fri, 13 May 2005 14:05:46 +0000 (GMT) Received: from swip.net (mailfe10.swipnet.se [212.247.155.33]) by mx1.FreeBSD.org (Postfix) with ESMTP id E5CE743D54 for ; Fri, 13 May 2005 14:05:44 +0000 (GMT) (envelope-from hselasky@c2i.net) X-T2-Posting-ID: Y1QAsIk9O44SO+J/q9KNyQ== Received: from mp-217-202-122.daxnet.no ([193.217.202.122] verified) by mailfe10.swip.net (CommuniGate Pro SMTP 4.3c5) with ESMTP id 157068607; Fri, 13 May 2005 16:05:43 +0200 From: Hans Petter Selasky To: freebsd-isdn@freebsd.org Date: Fri, 13 May 2005 16:06:27 +0200 User-Agent: KMail/1.7 References: <20050513113445.EF9AF1EAE27C@alice.turbocat.de> In-Reply-To: <20050513113445.EF9AF1EAE27C@alice.turbocat.de> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200505131606.28752.hselasky@c2i.net> Subject: Re: answering calls X-BeenThere: freebsd-isdn@freebsd.org X-Mailman-Version: 2.1.1 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: Fri, 13 May 2005 14:05:47 -0000 On Friday 13 May 2005 13:34, David Wetzel wrote: > hi folks, > > I try to create a lib to wrap the i4b telephony stuff in a way that makes > it easy to use from external programs. I do this as a first step to add i4b > support to Asterisk. I do not intent to run the isdnd. > > Imagine there are N different ISDN cards in the system. Some may be Fritz > with 2 channels some may have a PRI with 30 channels. > > If I understand the documentation right, all signaling and accept/reject > control is made via /dev/isdn and the real voice data will flow via > /dev/isdntel* > > On an incoming call, I get the stuct msg_connect_ind_t which contains > controller and channel number. > > The driver's int number I seem to get via lookup_l4_driver() from > rc_config.c. > > But how to get the driver_unit? > How do I know which /dev/isdntel* to use? > The "/dev/isdntel*" are shared among all [ISDN-] controllers. It is isdnd's job to manage which controller gets connected to which "driver" and "driver_unit". When an incoming call is present this is done by replying with one of two messages: Here is a cp from my driver: /*---------------------------------------------------------------------------* * connect response * this is the answer to an incoming connect indication *---------------------------------------------------------------------------*/ typedef struct { cdid_t cdid; /* call descriptor id */ int response; /* what to do with incoming call */ #define SETUP_RESP_DNTCRE 0 /* don't care, call is not for me */ #define SETUP_RESP_REJECT 1 /* reject call */ #define SETUP_RESP_ACCEPT 2 /* accept call */ cause_t cause; /* cause for case SETUP_RESP_REJECT */ /* the following are only used for SETUP_RESP_ACCEPT !! */ int txdelay; /* tx delay after connect */ int bprot; /* B chan protocol */ int driver; /* driver to route b channel data to */ int driver_unit; /* unit number for above driver */ int max_idle_time; /* max time without activity on b ch */ } msg_connect_resp_t; I've also got the option to just alert: /*---------------------------------------------------------------------------* * send alert request *---------------------------------------------------------------------------*/ typedef struct { cdid_t cdid; /* call descriptor id */ } msg_alert_req_t; But recently there were some discussions about making the drivers like "/dev/i4btel*" dynamic, so maybe that will mean that there will be a static association between "/dev/i4btel*" and a certain controller and B-channel. --HPS