Added patch to support analogmodem connections.

This commit is contained in:
armin 2004-07-27 18:06:54 +00:00
parent d769b7b4ad
commit b7f4727218
2 changed files with 22 additions and 5 deletions

View File

@ -1,5 +1,5 @@
.\" manual page [] for capiplugin 2.3
.\" $Id: capiplugin.8,v 1.10 2002/08/04 10:28:16 calle Exp $
.\" $Id: capiplugin.8,v 1.11 2004/07/27 18:06:54 armin Exp $
.\" SH section heading
.\" SS subsection heading
.\" LP paragraph
@ -327,7 +327,7 @@ See option \fIdialmax\fR.
phone number to dial to access an outside line. For example, \fInumberprefix 0\fR.
.TP
.B protocol \fIhdlc\fR | \fIx75\fR | \fIv42bis\fR | \fImodem\fR | \fIv110async\fR | \fIv120async\fR
.B protocol \fIhdlc\fR | \fIx75\fR | \fIv42bis\fR | \fImodem\fR | \fIanalogmodem\fR | \fIv110async\fR | \fIv120async\fR
ISDN protocol to use. With \fIhdlc\fR and \fIadskpppoe\fR,
the \fIsync\fR option must be added to the pppd.
With \fIx75\fR, \fIv42bis\fR, \fImodem\fR, \fIv110async\fR and \fIv120async\fR

View File

@ -27,7 +27,7 @@
#include <linux/if.h>
static char *revision = "$Revision: 1.34 $";
static char *revision = "$Revision: 1.35 $";
/* -------------------------------------------------------------------- */
@ -122,6 +122,7 @@ static STRINGLIST *inmsns;
#define PROTO_ADSLPPPOE 6
#define PROTO_ADSLPPPOA 7
#define PROTO_ADSLPPPOALLC 8
#define PROTO_ANALOGMODEM 9
static char *opt_proto = "hdlc";
static int proto = PROTO_HDLC;
static int opt_avmadsl = 0;
@ -407,11 +408,14 @@ static void plugin_check_options(void)
} else if (strcasecmp(opt_proto, "adslpppoallc") == 0) {
proto = PROTO_ADSLPPPOALLC;
if (!opt_channels) opt_channels = "1";
} else if (strcasecmp(opt_proto, "analogmodem") == 0) {
proto = PROTO_ANALOGMODEM;
} else {
option_error("capiplugin: unknown protocol \"%s\"", opt_proto);
die(1);
}
if (strcasecmp(opt_proto, "modem") == 0)
if (strcasecmp(opt_proto, "modem") == 0 ||
strcasecmp(opt_proto, "analogmodem") == 0)
cipmask = CIPMASK_VOICE;
else cipmask = CIPMASK_DATA;
@ -1277,7 +1281,7 @@ static void incoming(capi_connection *cp,
case 5: /* 7 kHz audio */
case 16: /* Telephony */
case 26: /* 7 kHz telephony */
if (proto == PROTO_MODEM) {
if (proto == PROTO_MODEM || proto == PROTO_ANALOGMODEM) {
if (demand) goto wakeupmatch;
if (coso == COSO_LOCAL) goto callback;
goto accept;
@ -1374,6 +1378,9 @@ accept:
case PROTO_V120_ASYNC:
(void) capiconn_accept(cp, 0, 9, 0, 0, 0, 0, 0);
break;
case PROTO_ANALOGMODEM:
(void) capiconn_accept(cp, 7, 7, 7, 0, 0, 0, 0);
break;
}
conn_remember(cp, CONNTYPE_INCOMING);
(void) capiconn_listen(ctx, controller, 0, 0);
@ -1580,6 +1587,16 @@ static capi_connection *setupconnection(char *num, int awaitingreject)
0, /* B3Config */
opt_channels ? AdditionalInfo : 0,
0);
} else if (proto == PROTO_ANALOGMODEM) {
cp = capiconn_connect(ctx,
controller, /* contr */
4, /* cipvalue */
opt_channels ? 0 : number,
opt_channels ? 0 : opt_msn,
7, 7, 7,
0, 0, 0,
opt_channels ? AdditionalInfo : 0,
0);
} else {
fatal("capiplugin: unknown protocol \"%s\"", opt_proto);
return 0;