From c7e9e0760d20d3dea410fd91130515f43718f9f5 Mon Sep 17 00:00:00 2001 From: hm Date: Sun, 11 Aug 2002 15:47:26 +0000 Subject: [PATCH] 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). --- share/examples/isdn/README | 2 +- share/examples/isdn/ReleaseNotes | 10 +++++++++- share/examples/isdn/ThankYou | 4 ++++ sys/i386/include/i4b_ioctl.h | 13 +++++++++++-- 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 ++- usr.sbin/i4b/isdnd/isdnd.h | 4 +++- usr.sbin/i4b/isdnd/isdnd.rc.5 | 21 ++++++++++++++++++++- usr.sbin/i4b/isdnd/msghdl.c | 4 +++- usr.sbin/i4b/isdnd/rc_config.c | 9 ++++++++- usr.sbin/i4b/isdnd/rc_parse.y | 4 +++- usr.sbin/i4b/isdnd/rc_scan.l | 3 ++- 16 files changed, 98 insertions(+), 20 deletions(-) diff --git a/share/examples/isdn/README b/share/examples/isdn/README index 62064ec2105e..f0fcac7d348d 100644 --- a/share/examples/isdn/README +++ b/share/examples/isdn/README @@ -6,7 +6,7 @@ $FreeBSD$ isdn4bsd ======== - Version 1.02.00 / March 2002 + Version 1.03.00 / August 2002 written by: diff --git a/share/examples/isdn/ReleaseNotes b/share/examples/isdn/ReleaseNotes index cf3484727aa9..a839acc281f7 100644 --- a/share/examples/isdn/ReleaseNotes +++ b/share/examples/isdn/ReleaseNotes @@ -1,8 +1,16 @@ $FreeBSD$ -ReleaseNotes for isdn4bsd last edit-date: [Tue Mar 26 15:11:33 2002] +ReleaseNotes for isdn4bsd last edit-date: [Sun Aug 11 17:39:06 2002] ================================================================================ +release 1.03 +-------------------------------------------------------------------------------- + +- add support for Data over Voice (DoV) outgoing calls, see entry keywork + bcap in isdnd.rc(5). + based on patches received from Guy Ellis (guy@traverse.com.au), + Chris Collins (xfire@xware.cx) and Phillip Musumeci (phillip@cs.jcu.edu.au). + release 1.02 -------------------------------------------------------------------------------- diff --git a/share/examples/isdn/ThankYou b/share/examples/isdn/ThankYou index 502ed4d16623..6a0455865079 100644 --- a/share/examples/isdn/ThankYou +++ b/share/examples/isdn/ThankYou @@ -17,6 +17,7 @@ Thanks a lot for postcards from: Darmstadt Delft Dresden + Eggstaett am Hartsee Flekkefjord Freiburg Habichtswald @@ -243,6 +244,7 @@ The following people contributed in one or the other way to isdn4bsd: Aurelien Bargy Bart van Leeuwen Caspar Schlegel + Chris Collins Christian Wolf Christoph Kukulies Daniel Rock @@ -251,6 +253,7 @@ The following people contributed in one or the other way to isdn4bsd: Doobee R. Tzeck Dominik Brettnacher Gabor Dolla + Guy Ellis H. Eckert Hans Huebner Harald Hanche-Olsen @@ -273,6 +276,7 @@ The following people contributed in one or the other way to isdn4bsd: Nils Ulltveit-Moe Paul Herman Paul Sijben + Phillip Musumeci Philippe Guezou Rob Pickering Stefan Esser diff --git a/sys/i386/include/i4b_ioctl.h b/sys/i386/include/i4b_ioctl.h index 9f06b10cbc9c..5f996285095b 100644 --- a/sys/i386/include/i4b_ioctl.h +++ b/sys/i386/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 */ /*---------------------------------------------------------------------------* @@ -198,6 +198,12 @@ #define BPROT_NONE 0 /* no protocol at all, raw data */ #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 *---------------------------------------------------------------------------*/ @@ -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_ioctl.h b/sys/i4b/include/i4b_ioctl.h index 9f06b10cbc9c..5f996285095b 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 */ /*---------------------------------------------------------------------------* @@ -198,6 +198,12 @@ #define BPROT_NONE 0 /* no protocol at all, raw data */ #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 *---------------------------------------------------------------------------*/ @@ -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 290a7247fc22..89303d72669d 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 fda3bc7b1ebc..0a8584b61f61 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 16170777aeb3..f9c77266231f 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 1f5163bdec79..1a7f7e8d988e 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 17bf29a51ec2..1368fb94f770 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); diff --git a/usr.sbin/i4b/isdnd/isdnd.h b/usr.sbin/i4b/isdnd/isdnd.h index 91285f329b36..f95e841c1752 100644 --- a/usr.sbin/i4b/isdnd/isdnd.h +++ b/usr.sbin/i4b/isdnd/isdnd.h @@ -29,7 +29,7 @@ * * $FreeBSD$ * - * last edit-date: [Tue Mar 26 14:36:20 2002] + * last edit-date: [Sun Aug 11 12:31:44 2002] * *---------------------------------------------------------------------------*/ @@ -288,6 +288,8 @@ typedef struct cfg_entry { int b1protocol; /* hdlc / raw */ + int bcap; /* special bearer capability (DoV) */ + int idle_time_in; /* max idle time incoming calls */ int idle_time_out; /* max idle time outgoing calls */ diff --git a/usr.sbin/i4b/isdnd/isdnd.rc.5 b/usr.sbin/i4b/isdnd/isdnd.rc.5 index 1533b936a790..ee2e35afdf32 100644 --- a/usr.sbin/i4b/isdnd/isdnd.rc.5 +++ b/usr.sbin/i4b/isdnd/isdnd.rc.5 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.\" last edit-date: [Tue Mar 26 14:35:02 2002] +.\" last edit-date: [Sun Aug 11 13:03:49 2002] .\" .Dd March 26, 2002 .Dt ISDND.RC 5 @@ -348,6 +348,25 @@ HDLC framing. .It Ar raw No framing at all (used for telephony). .El +.It Li bcap +Use a special bearer capability for this connection. +The keyword is optional. +.Pp +Any other value than +.Em dov +sets the bearer capability as configured by the +.Em b1protocol +keyword (see above). +The currently configurable values are: +.Pp +.Bl -tag -width Ds -compact +.It Ar dov +This connection is a +.Em Dov (Data over Voice) +connection. The b1protocol keyword must be set to +.Em hdlc . +This feature is experimental and does work on outgoing calls only. +.El .It Li budget-calloutperiod is used to specify a time period in seconds. Within this period, the number of calls diff --git a/usr.sbin/i4b/isdnd/msghdl.c b/usr.sbin/i4b/isdnd/msghdl.c index 0d5364a0cf67..2b122262f043 100644 --- a/usr.sbin/i4b/isdnd/msghdl.c +++ b/usr.sbin/i4b/isdnd/msghdl.c @@ -29,7 +29,7 @@ * * $FreeBSD$ * - * last edit-date: [Tue Mar 26 14:37:25 2002] + * last edit-date: [Sun Aug 11 12:37:16 2002] * *---------------------------------------------------------------------------*/ @@ -1201,6 +1201,7 @@ sendm_connect_req(cfg_entry_t *cep) mcr.txdelay = cep->isdntxdelout; mcr.bprot = cep->b1protocol; + mcr.bcap = cep->bcap; mcr.driver = cep->usrdevicename; mcr.driver_unit = cep->usrdeviceunit; @@ -1271,6 +1272,7 @@ sendm_connect_resp(cfg_entry_t *cep, int cdid, int response, cause_t cause) mcr.txdelay = cep->isdntxdelin; mcr.bprot = cep->b1protocol; + mcr.bcap = cep->bcap; mcr.driver = cep->usrdevicename; mcr.driver_unit = cep->usrdeviceunit; diff --git a/usr.sbin/i4b/isdnd/rc_config.c b/usr.sbin/i4b/isdnd/rc_config.c index 09a2c2e20434..b06685cb6d40 100644 --- a/usr.sbin/i4b/isdnd/rc_config.c +++ b/usr.sbin/i4b/isdnd/rc_config.c @@ -29,7 +29,7 @@ * * $FreeBSD$ * - * last edit-date: [Tue Mar 26 14:37:38 2002] + * last edit-date: [Sun Aug 11 12:30:49 2002] * *---------------------------------------------------------------------------*/ @@ -411,6 +411,13 @@ cfg_setval(int keyword) } break; + case BCAP: + DBGL(DL_RCCF, (log(LL_DBG, "entry %d: bcap = %s", entrycount, yylval.str))); + cfg_entry_tab[entrycount].bcap = BCAP_NONE; + if(!(strcmp(yylval.str, "dov"))) + cfg_entry_tab[entrycount].bcap = BCAP_DOV; + break; + case BEEPCONNECT: do_bell = yylval.booln; DBGL(DL_RCCF, (log(LL_DBG, "system: beepconnect = %d", yylval.booln))); diff --git a/usr.sbin/i4b/isdnd/rc_parse.y b/usr.sbin/i4b/isdnd/rc_parse.y index 6630de9b30b9..0395bfb63c31 100644 --- a/usr.sbin/i4b/isdnd/rc_parse.y +++ b/usr.sbin/i4b/isdnd/rc_parse.y @@ -32,7 +32,7 @@ * * $FreeBSD$ * - * last edit-date: [Tue Mar 26 14:37:50 2002] + * last edit-date: [Sun Aug 11 12:27:28 2002] * *---------------------------------------------------------------------------*/ @@ -79,6 +79,7 @@ int controllercount = -1; %token ANSWERPROG %token B1PROTOCOL %token BEEPCONNECT +%token BCAP %token BUDGETCALLOUTPERIOD %token BUDGETCALLOUTNCALLS %token BUDGETCALLOUTSFILE @@ -426,6 +427,7 @@ filekeyword: BUDGETCALLBACKSFILE { $$ = BUDGETCALLBACKSFILE; } strkeyword: ANSWERPROG { $$ = ANSWERPROG; } | B1PROTOCOL { $$ = B1PROTOCOL; } + | BCAP { $$ = BCAP; } | CONNECTPROG { $$ = CONNECTPROG; } | DIALOUTTYPE { $$ = DIALOUTTYPE; } | DIRECTION { $$ = DIRECTION; } diff --git a/usr.sbin/i4b/isdnd/rc_scan.l b/usr.sbin/i4b/isdnd/rc_scan.l index d8cdfb60385a..ac5c018daffc 100644 --- a/usr.sbin/i4b/isdnd/rc_scan.l +++ b/usr.sbin/i4b/isdnd/rc_scan.l @@ -32,7 +32,7 @@ * * $FreeBSD$ * - * last edit-date: [Tue Mar 26 14:37:59 2002] + * last edit-date: [Sun Aug 11 12:27:50 2002] * *---------------------------------------------------------------------------*/ @@ -92,6 +92,7 @@ aliasing { return ALIASING; } aliasfile { return ALIASFNAME; } answerprog { return ANSWERPROG; } b1protocol { return B1PROTOCOL; } +bcap { return BCAP; } beepconnect { return BEEPCONNECT; } budget-callbackperiod { return BUDGETCALLBACKPERIOD; } budget-callbackncalls { return BUDGETCALLBACKNCALLS; }