answering calls
Hans Petter Selasky
hselasky at c2i.net
Fri May 13 07:05:47 PDT 2005
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
More information about the freebsd-isdn
mailing list