From 7465309faa645f39be1f0ba0b1cfc7a3706e83c2 Mon Sep 17 00:00:00 2001 From: hm Date: Sun, 11 Aug 2002 15:47:26 +0000 Subject: add experimental support for Data over Voice (DoV) outgoing calls. based on patches received from Guy Ellis (guy@traverse.com.au), Chris Collins (xfire@xware.cx) and Phillip Musumeci (phillip@cs.jcu.edu.au). --- sys/i4b/include/i4b_ioctl.h | 13 +++++++++++-- sys/i4b/include/i4b_l3l4.h | 4 +++- sys/i4b/layer3/i4b_l2if.c | 18 ++++++++++++++---- sys/i4b/layer4/i4b_i4bdrv.c | 3 ++- sys/i4b/layer4/i4b_l4.c | 3 ++- sys/i4b/layer4/i4b_l4mgmt.c | 3 ++- 6 files changed, 34 insertions(+), 10 deletions(-) (limited to 'sys/i4b') diff --git a/sys/i4b/include/i4b_ioctl.h b/sys/i4b/include/i4b_ioctl.h index 9f06b10..5f99628 100644 --- a/sys/i4b/include/i4b_ioctl.h +++ b/sys/i4b/include/i4b_ioctl.h @@ -29,7 +29,7 @@ * * $FreeBSD$ * - * last edit-date: [Tue Mar 26 14:44:15 2002] + * last edit-date: [Sun Aug 11 12:39:58 2002] * *---------------------------------------------------------------------------*/ @@ -40,7 +40,7 @@ * version and release number for isdn4bsd package *---------------------------------------------------------------------------*/ #define VERSION 1 /* version number */ -#define REL 2 /* release number */ +#define REL 3 /* release number */ #define STEP 0 /* release step */ /*---------------------------------------------------------------------------* @@ -199,6 +199,12 @@ #define BPROT_RHDLC 1 /* raw HDLC: flag, data, crc, flag */ /*---------------------------------------------------------------------------* + * special bearer capability settings (i.e. Data over Voice) + *---------------------------------------------------------------------------*/ +#define BCAP_NONE 0 /* no special bearer capability */ +#define BCAP_DOV 1 /* Data over Voice */ + +/*---------------------------------------------------------------------------* * causes data type *---------------------------------------------------------------------------*/ typedef unsigned int cause_t; /* 32 bit unsigned int */ @@ -333,6 +339,7 @@ typedef struct { #define CHAN_ANY (-1) /* outgoing, not possible for incoming */ #define CHAN_NO (-2) /* call waiting (CW) for incoming */ int bprot; /* b channel protocot, see BPROT_XXX */ + int bcap; /* special bearer capability, see BCAP_XXX */ char dst_telno[TELNO_MAX]; /* destination telno */ char dst_subaddr[SUBADDR_MAX]; /* dest subaddr */ char src_telno[TELNO_MAX]; /* source telno */ @@ -562,6 +569,7 @@ typedef struct { int channel; /* channel to use */ int txdelay; /* tx delay after connect */ int bprot; /* b channel protocol */ + int bcap; /* special bearer capability */ int driver; /* driver to route b channel data to */ int driver_unit; /* unit number for above driver */ msg_shorthold_t shorthold_data; /* the shorthold data */ @@ -591,6 +599,7 @@ typedef struct { /* the following are only used for SETUP_RESP_ACCEPT !! */ int txdelay; /* tx delay after connect */ int bprot; /* B chan protocol */ + int bcap; /* special bearer capability */ 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 */ diff --git a/sys/i4b/include/i4b_l3l4.h b/sys/i4b/include/i4b_l3l4.h index 290a724..89303d7 100644 --- a/sys/i4b/include/i4b_l3l4.h +++ b/sys/i4b/include/i4b_l3l4.h @@ -29,7 +29,7 @@ * * $FreeBSD$ * - * last edit-date: [Sat Mar 9 15:57:44 2002] + * last edit-date: [Sun Aug 11 12:52:41 2002] * *---------------------------------------------------------------------------*/ @@ -138,6 +138,8 @@ typedef struct int bprot; /* B channel protocol BPROT_XXX */ + int bcap; /* special bearer capabilities BCAP_XXX */ + int driver; /* driver to use for B channel */ int driver_unit; /* unit for above driver number */ diff --git a/sys/i4b/layer3/i4b_l2if.c b/sys/i4b/layer3/i4b_l2if.c index fda3bc7..0a8584b 100644 --- a/sys/i4b/layer3/i4b_l2if.c +++ b/sys/i4b/layer3/i4b_l2if.c @@ -29,7 +29,7 @@ * * $FreeBSD$ * - * last edit-date: [Tue Mar 26 15:03:59 2002] + * last edit-date: [Sun Aug 11 12:48:41 2002] * *---------------------------------------------------------------------------*/ @@ -480,9 +480,19 @@ i4b_l3_tx_setup(call_desc_t *cd) break; case BPROT_RHDLC: /* raw HDLC */ - *ptr++ = IEI_BEARERCAP_LEN; - *ptr++ = IT_CAP_UNR_DIG_INFO; - *ptr++ = IT_RATE_64K; + if (cd->bcap == BCAP_DOV) /* Data over Voice */ + { + *ptr++ = IEI_BEARERCAP_LEN+1; + *ptr++ = IT_CAP_SPEECH; + *ptr++ = IT_RATE_64K; + *ptr++ = IT_UL1_G711A; + } + else + { + *ptr++ = IEI_BEARERCAP_LEN; + *ptr++ = IT_CAP_UNR_DIG_INFO; + *ptr++ = IT_RATE_64K; + } break; default: diff --git a/sys/i4b/layer4/i4b_i4bdrv.c b/sys/i4b/layer4/i4b_i4bdrv.c index 1617077..f9c7726 100644 --- a/sys/i4b/layer4/i4b_i4bdrv.c +++ b/sys/i4b/layer4/i4b_i4bdrv.c @@ -29,7 +29,7 @@ * * $FreeBSD$ * - * last edit-date: [Sun Mar 17 09:54:22 2002] + * last edit-date: [Sun Aug 11 12:42:46 2002] * *---------------------------------------------------------------------------*/ @@ -264,6 +264,7 @@ i4bioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td) cd->controller = mcr->controller; /* fill cd */ cd->bprot = mcr->bprot; + cd->bcap = mcr->bcap; cd->driver = mcr->driver; cd->driver_unit = mcr->driver_unit; cd->cr = get_rand_cr(ctrl_desc[cd->controller].unit); diff --git a/sys/i4b/layer4/i4b_l4.c b/sys/i4b/layer4/i4b_l4.c index 1f5163b..1a7f7e8 100644 --- a/sys/i4b/layer4/i4b_l4.c +++ b/sys/i4b/layer4/i4b_l4.c @@ -29,7 +29,7 @@ * * $FreeBSD$ * - * last edit-date: [Sat Mar 9 19:46:26 2002] + * last edit-date: [Sun Aug 11 12:43:14 2002] * *---------------------------------------------------------------------------*/ @@ -367,6 +367,7 @@ i4b_l4_connect_ind(call_desc_t *cd) mp->controller = cd->controller; mp->channel = cd->channelid; mp->bprot = cd->bprot; + mp->bcap = cd->bcap; cd->dir = DIR_INCOMING; diff --git a/sys/i4b/layer4/i4b_l4mgmt.c b/sys/i4b/layer4/i4b_l4mgmt.c index 17bf29a..1368fb9 100644 --- a/sys/i4b/layer4/i4b_l4mgmt.c +++ b/sys/i4b/layer4/i4b_l4mgmt.c @@ -29,7 +29,7 @@ * * $FreeBSD$ * - * last edit-date: [Sat Mar 9 19:48:32 2002] + * last edit-date: [Sun Aug 11 12:42:01 2002] * *---------------------------------------------------------------------------*/ @@ -368,6 +368,7 @@ i4b_print_cdp(call_desc_t *cdp) printf(" crflag = %d\n", cdp->crflag); printf(" channelid = %d\n", cdp->channelid); printf(" bprot = %d\n", cdp->bprot); + printf(" bcap = %d\n", cdp->bcap); printf(" driver = %d\n", cdp->driver); printf(" driver_unit = %d\n", cdp->driver_unit); printf(" call_state = %d\n", cdp->call_state); -- cgit v1.1