From: Mark W. <ri...@us...> - 2002-03-25 14:10:25
|
Update of /cvsroot/ipcop/ipcop/config/kernel In directory usw-pr-cvs1:/tmp/cvs-serv24307/config/kernel Added Files: Tag: IPCOP_v0_1 isdn_net.c.diff Log Message: IPCop 0.1.2beta1 --- NEW FILE: isdn_net.c.diff --- --- isdn_net.c.bak Sun Mar 24 20:06:09 2002 +++ isdn_net.c Sun Mar 24 20:14:17 2002 @@ -20,6 +20,13 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * + * Data Over Voice (DOV) support added - Guy Ellis 23-Mar-02 gu...@tr... + * Outgoing calls - looks for a 'V' in first char of dialled number + * Incoming calls - checks first character of eaz as follows: + * Numeric - accept DATA only - original functionality + * 'V' - accept VOICE (DOV) only + * 'B' - accept BOTH DATA and DOV types + * */ /* Jan 2001: fix CISCO HDLC Bjoern A. Zeeb <i4...@za...> @@ -586,6 +593,7 @@ int i; int flags; isdn_ctrl cmd; + u_char *phone_number; // added GE while (p) { isdn_net_local *lp = p->local; @@ -708,6 +716,17 @@ cmd.command = ISDN_CMD_DIAL; cmd.parm.setup.si1 = 7; cmd.parm.setup.si2 = 0; + /* check for DOV - added GE */ + phone_number = lp->dial->num; + if ((*phone_number == 'v') || + (*phone_number == 'V')) + { /* DOV call */ + phone_number++; /* skip V */ + cmd.parm.setup.si1 = 1; + } + else /* DATA call */ + cmd.parm.setup.si1 = 7; + sprintf(cmd.parm.setup.eazmsn, "%s", isdn_map_eaz2msn(lp->msn, cmd.driver)); i = isdn_dc2minor(lp->isdn_device, lp->isdn_channel); @@ -718,6 +737,11 @@ } printk(KERN_INFO "%s: dialing %d %s...\n", lp->name, lp->dialretry, cmd.parm.setup.phone); + /* log call type GE */ + if (cmd.parm.setup.si1 == 1) + printk(KERN_INFO "Call type is DOV (Data over Voice)\n"); + else + printk(KERN_INFO "Call type is DATA\n"); lp->dtimer = 0; #ifdef ISDN_DEBUG_NET_DIAL printk(KERN_DEBUG "dial: d=%d c=%d\n", lp->isdn_device, @@ -2134,6 +2158,7 @@ isdn_net_phone *n; ulong flags; char nr[32]; + char *my_eaz; // added GE /* Search name in netdev-chain */ save_flags(flags); cli(); @@ -2152,13 +2177,14 @@ eaz = setup->eazmsn; if (dev->net_verbose > 1) printk(KERN_INFO "isdn_net: call from %s,%d,%d -> %s\n", nr, si1, si2, eaz); - /* Accept only calls with Si1 = 7 (Data-Transmission) */ - if (si1 != 7) { - restore_flags(flags); - if (dev->net_verbose > 1) - printk(KERN_INFO "isdn_net: Service-Indicator not 7, ignored\n"); - return 0; - } + /* Accept DATA and VOICE calls at this stage + local eaz is checked later for allowed call types - added GE */ + if ((si1 != 7) && (si1 != 1)){ + restore_flags(flags); + if (dev->net_verbose > 1) + printk(KERN_INFO "isdn_net: Service-Indicator not 1 or 7, ignored\n"); + return 0; + } n = (isdn_net_phone *) 0; p = dev->netdev; ematch = wret = swapped = 0; @@ -2180,8 +2206,28 @@ break; } swapped = 0; - if (!(matchret = isdn_msncmp(eaz, isdn_map_eaz2msn(lp->msn, di)))) - ematch = 1; + /* check acceptable call types for DOV - added GE */ + my_eaz = isdn_map_eaz2msn(lp->msn, di); + if (si1 == 1) /* it's a DOV call, check if we allow it */ + { + if ((*my_eaz == 'v') || (*my_eaz == 'V') + || (*my_eaz == 'b') || (*my_eaz == 'B')) + my_eaz++; /* skip to allow a match */ + else + my_eaz = 0; /* force non match */ + }; + if (si1 == 7) /* it's a DATA call, check if we allow it */ + { + if ((*my_eaz == 'b') || (*my_eaz == 'B')) + my_eaz++; /* skip to allow a match */ + }; + if (my_eaz) + matchret = isdn_msncmp(eaz, my_eaz); + else + matchret = 1; + if (!matchret) + ematch = 1; + /* Remember if more numbers eventually can match */ if (matchret > wret) wret = matchret; |