-
Notifications
You must be signed in to change notification settings - Fork 0
/
ckudia.c
8248 lines (7863 loc) · 235 KB
/
ckudia.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#include "ckcsym.h"
char *dialv = "Dial Command, 9.0.161, 4 Feb 2016";
/* C K U D I A -- Module for automatic modem dialing. */
/*
Copyright (C) 1985, 2016,
Trustees of Columbia University in the City of New York.
All rights reserved. See the C-Kermit COPYING.TXT file or the
copyright text in the ckcmai.c module for disclaimer and permissions.
*/
/*
Authors:
Original (version 1, 1985) author: Herm Fischer, Encino, CA.
Contributed to Columbia University in 1985 for inclusion in C-Kermit 4.0.
Author and maintainer since 1985: Frank da Cruz, fdc@columbia.edu.
Contributions by many others throughout the years, including: Jeffrey
Altman, Mark Berryman, Fernando Cabral, John Chmielewski, Joe Doupnik,
Richard Hill, Larry Jacobs, Eric Jones, Tom Kloos, Bob Larson, Peter Mauzey,
Joe Orost, Kevin O'Gorman, Kai Uwe Rommel, Dan Schullman, Warren Tucker, and
many others.
*/
/*
Entry points:
ckdial(char * number) Dial a number or answer a call
dialhup() Hang up a dialed connection
mdmhup() Use modem commands to hang up
All other routines are static.
Don't call dialhup() or mdmhup() without first calling ckdial().
*/
/*
This module calls externally defined system-dependent functions for
communications i/o, as described in CKCPLM.DOC, the C-Kermit Program Logic
Manual, and thus should be portable to all systems that implement those
functions, and where alarm() and signal() work.
HOW TO ADD SUPPORT FOR ANOTHER MODEM:
1. In ckuusr.h, define a modem-type number symbol (n_XXX) for the new modem,
the next highest one.
2. In ckuusr.h, adjust MAX_MDM to the new number of modem types.
The remaining steps are in this module:
3. Create a MDMINF structure for it. NOTE: The wake_str should include
all invariant setup info, e.g. enable result codes, BREAK transparency,
modulation negotiation, etc. See ckcker.h for MDMINF struct definition.
4. Add the address of the MDMINF structure to the modemp[] array,
according to the numerical value of the modem-type number.
5. Add the user-visible (SET MODEM) name and corresponding modem number
to the mdmtab[] array, in alphabetical order by modem-name string.
6. If this falls into a class like is_rockwell, is_supra, etc, add the new
one to the definition of the class.
7. Adjust the gethrn() routine to account for any special numeric result
codes (if it's a Hayes compatible modem).
8. Read through the code and add any modem-specific sections as necessary.
For most modern Hayes-compatible modems, no specific code will be
needed.
NOTE: The MINIDIAL symbol is used to build this module to include support
for only a minimum number of standard and/or generally useful modem types,
namely Hayes 1200 and 2400, ITU-T (CCITT) V.25bis and V.25ter (V.250),
Generic-High-Speed, "Unknown", and None. When adding support for a new
modem type, keep it outside of the MINIDIAL sections unless it deserves to
be in it.
*/
#include "ckcdeb.h"
#ifndef NOLOCAL
#ifndef NODIAL
#ifndef NOICP
#ifndef CK_ATDT
#define CK_ATDT
#endif /* CK_ATDT */
#ifndef NOOLDMODEMS /* Unless instructed otherwise, */
#define OLDMODEMS /* keep support for old modems. */
#endif /* NOOLDMODEMS */
#ifndef M_OLD /* Hide old modem keywords in SET MODEM table. */
#define M_OLD 0 /* Define as CM_INV to make them invisible. */
#endif /* M_OLD */
#ifndef M_ALIAS
#define M_ALIAS 64
#endif /* M_ALIAS */
#ifndef MAC
#include <signal.h>
#endif /* MAC */
#include "ckcasc.h"
#include "ckcker.h"
#include "ckucmd.h"
#include "ckcnet.h"
#include "ckuusr.h"
#ifdef OS2ONLY
#define INCL_VIO /* Needed for ckocon.h */
#include <os2.h>
#undef COMMENT
#include "ckocon.h"
#endif /* OS2ONLY */
#ifdef NT
#include <windows.h>
#include <tapi.h>
#include "cknwin.h"
#include "ckntap.h"
#endif /* NT */
#ifdef OS2
#include "ckowin.h"
#endif /* OS2 */
#ifndef ZILOG
#ifdef NT
#include <setjmpex.h>
#else /* NT */
#include <setjmp.h>
#endif /* NT */
#else
#include <setret.h>
#endif /* ZILOG */
#include "ckcsig.h" /* C-Kermit signal processing */
#ifdef MAC
#define signal msignal
#define SIGTYP long
#define alarm malarm
#define SIG_IGN 0
#define SIGALRM 1
#define SIGINT 2
SIGTYP (*msignal(int type, SIGTYP (*func)(int)))(int);
#endif /* MAC */
#ifdef AMIGA
#define signal asignal
#define alarm aalarm
#define SIGALRM (_NUMSIG+1)
#define SIGTYP void
SIGTYP (*asignal(int type, SIGTYP (*func)(int)))(int);
unsigned aalarm(unsigned);
#endif /* AMIGA */
#ifdef STRATUS
/*
VOS doesn't have alarm(), but it does have some things we can work with.
However, we have to catch all the signals in one place to do this, so
we intercept the signal() routine and call it from our own replacement.
*/
#define signal vsignal
#define alarm valarm
SIGTYP (*vsignal(int type, SIGTYP (*func)(int)))(int);
int valarm(int interval);
#ifdef putchar
#undef putchar
#endif /* putchar */
#define putchar(x) conoc(x)
#ifdef getchar
#undef getchar
#endif /* getchar */
#define getchar(x) coninc(0)
#endif /* STRATUS */
#ifdef OS2
#ifdef putchar
#undef putchar
#endif /* putchar */
#define putchar(x) conoc(x)
#endif /* OS2 */
#ifndef NOHINTS
extern int hints;
#endif /* NOHINTS */
#ifdef CK_TAPI
extern int tttapi;
extern int tapipass;
#endif /* CK_TAPI */
#ifdef CKLOGDIAL
extern int dialog;
#endif /* CKLOGDIAL */
char * dialmsg[] = { /* DIAL status strings */
/* Keyed to numbers defined in ckcker.h -- keep in sync! */
"DIAL succeeded", /* 0 DIA_OK */
"Modem type not specified", /* 1 DIA_NOMO */
"Communication device not specified", /* 2 DIA_NOLI */
"Communication device can't be opened", /* 3 DIA_OPEN */
"Speed not specified", /* 4 DIA_NOSP */
"Pre-DIAL hangup failed", /* 5 DIA_HANG */
"Internal error", /* 6 DIA_IE */
"Device input/output error", /* 7 DIA_IO */
"DIAL TIMEOUT expired", /* 8 DIA_TIMO */
"Interrupted by user", /* 9 DIA_INTR */
"Modem not ready", /* 10 DIA_NRDY */
"Partial dial OK", /* 11 DIA_PART */
"Dial directory lookup error", /* 12 DIA_DIR */
"Hangup OK", /* 13 DIA_HUP */
NULL, /* 14 (undef) */
NULL, /* 15 (undef) */
NULL, /* 16 (undef) */
NULL, /* 17 (undef) */
NULL, /* 18 (undef) */
"No response from modem", /* 19 DIA_NRSP */
"Modem command error", /* 20 DIA_ERR */
"Failure to initialize modem", /* 21 DIA_NOIN */
"Phone busy", /* 22 DIA_BUSY */
"No carrier", /* 23 DIA_NOCA */
"No dialtone", /* 24 DIA_NODT */
"Incoming call", /* 25 DIA_RING */
"No answer", /* 26 DIA_NOAN */
"Disconnected", /* 27 DIA_DISC */
"Answered by voice", /* 28 DIA_VOIC */
"Access denied / forbidden call", /* 29 DIA_NOAC */
"Blacklisted", /* 30 DIA_BLCK */
"Delayed", /* 31 DIA_DELA */
"Fax connection", /* 32 DIA_FAX */
"Digital line", /* 33 DIA_DIGI */
"TAPI dialing failure", /* 34 DIA_TAPI */
NULL /* 34 */
};
#ifdef COMMENT
#ifdef NOSPL
static
#endif /* NOSPL */
char modemmsg[128] = { NUL, NUL }; /* DIAL response from modem */
#endif /* COMMENT */
#ifdef NTSIG
extern int TlsIndex;
#endif /* NTSIG */
int mdmtyp = n_GENERIC; /* Default modem type */
int mdmset = 0; /* User explicitly set a modem type */
int /* SET DIAL parameters */
dialhng = 1, /* DIAL HANGUP, default is ON */
dialdpy = 0, /* DIAL DISPLAY, default is OFF */
mdmspd = 0, /* DIAL SPEED-MATCHING (0 = OFF) */
mdmspk = 1, /* MODEM SPEAKER */
mdmvol = 2, /* MODEM VOLUME */
dialtmo = 0, /* DIAL TIMEOUT */
dialatmo = -1, /* ANSWER TIMEOUT */
dialksp = 0, /* DIAL KERMIT-SPOOF, 0 = OFF */
dialidt = 0, /* DIAL IGNORE-DIALTONE */
#ifndef CK_RTSCTS
/* If we can't do RTS/CTS then there's no flow control at first. */
/* So we might easily lose the echo to the init string and the OK */
/* and then give "No response from modem" errors. */
dialpace = 150, /* DIAL PACING */
#else
dialpace = -1,
#endif /* CK_RTSCTS */
/* 0 = RS232 (drop DTR); 1 = MODEM-COMMAND (e.g. <sec>+++<sec>ATH0) */
dialmhu = DEFMDMHUP; /* MODEM HANGUP-METHOD */
int
dialec = 1, /* DIAL ERROR-CORRECTION */
dialdc = 1, /* DIAL COMPRESSION */
#ifdef VMS
/* VMS can only use Xon/Xoff */
dialfc = FLO_XONX, /* DIAL FLOW-CONTROL */
#else
dialfc = FLO_AUTO,
#endif /* VMS */
dialmth = XYDM_D, /* DIAL METHOD (Tone, Pulse, Defalt) */
dialmauto = 1, /* DIAL METHOD is AUTO */
dialesc = 0; /* DIAL ESCAPE */
int telephony = 0; /* Command-line '-T' option */
long dialmax = 0L, /* Modem's max interface speed */
dialcapas = 0L; /* Modem's capabilities */
int dialsta = DIA_UNK; /* Detailed return code (ckuusr.h) */
#ifdef COMMENT
int ans_cid = 0; /* SET ANSWER parameters */
int ans_rings = 0; /* (not used yet...) */
#endif /* COMMENT */
int is_rockwell = 0;
int is_motorola = 0;
int is_supra = 0;
int is_hayeshispd = 0;
/* Dialing directory list */
char *dialdir[MAXDDIR]; /* DIAL DIRECTORY filename array */
int ndialdir = 0; /* How many dial directories */
/* User overrides for built-in modem commands */
char *dialini = NULL; /* MODEM INIT-STRING none */
char *dialmstr = NULL; /* MODEM DIALMODE-STRING */
char *dialmprmt = NULL; /* MODEM DIALMODE-PROMPT */
char *dialcmd = NULL; /* MODEM DIAL-COMMAND, default none */
char *dialname = NULL; /* Descriptive name for modem */
char *dialdcon = NULL; /* DC ON command */
char *dialdcoff = NULL; /* DC OFF command */
char *dialecon = NULL; /* EC ON command */
char *dialecoff = NULL; /* EC OFF command */
char *dialaaon = NULL; /* Autoanswer ON command */
char *dialaaoff = NULL; /* Autoanswer OFF command */
char *dialhcmd = NULL; /* Hangup command */
char *dialhwfc = NULL; /* Hardware flow control command */
char *dialswfc = NULL; /* (Local) software f.c. command */
char *dialnofc = NULL; /* No (Local) flow control command */
char *dialtone = NULL; /* Command to force tone dialing */
char *dialpulse = NULL; /* ..to force pulse dialing */
char *dialx3 = NULL; /* Ignore dialtone */
char *mdmname = NULL;
char *dialspon = NULL; /* Speaker On command */
char *dialspoff = NULL; /* Speaker Off command */
char *dialvol1 = NULL; /* Volume Low command */
char *dialvol2 = NULL; /* Volume Medium command */
char *dialvol3 = NULL; /* Volume High command */
char *dialini2 = NULL; /* Second init string */
/* Phone number options */
char *dialnpr = NULL; /* DIAL PREFIX, ditto */
char *diallac = NULL; /* DIAL LOCAL-AREA-CODE, ditto */
char *diallcc = NULL; /* DIAL LOCAL-COUNTRY-CODE, ditto */
char *dialixp = NULL; /* DIAL INTL-PREFIX */
char *dialixs = NULL; /* DIAL INTL-SUFFIX */
char *dialldp = NULL; /* DIAL LD-PREFIX */
char *diallds = NULL; /* DIAL LD-SUFFIX */
char *diallcp = NULL; /* DIAL LOCAL-PREFIX */
char *diallcs = NULL; /* DIAL LOCAL-SUFFIX */
char *dialpxi = NULL; /* DIAL PBX-INTERNAL-PREFIX */
char *dialpxo = NULL; /* DIAL PBX-OUTSIDE-PREFIX */
char *dialsfx = NULL; /* DIAL SUFFIX */
char *dialtfp = NULL; /* DIAL TOLL-FREE-PREFIX */
char *callid_date = NULL; /* Caller ID strings */
char *callid_time = NULL;
char *callid_name = NULL;
char *callid_nmbr = NULL;
char *callid_mesg = NULL;
extern char * d_name;
extern char * dialtfc[]; /* DIAL TOLL-FREE-AREA-CODE */
extern char * dialpxx[]; /* DIAL PBX-EXCHANGE */
extern int ntollfree;
extern int ndialpxx;
extern char * dialpucc[]; /* DIAL Pulse countries */
extern int ndialpucc;
extern char * dialtocc[]; /* DIAL Tone countries */
extern int ndialtocc;
char *dialmac = NULL; /* DIAL macro */
/* Countries where pulse dialing must be used (tone is not available) */
static char * pulsecc[] = { NULL }; /* (Unknown at present) */
/* Countries where tone dialing may safely be the default. */
/* "+" marks countries where pulse is also allowed. */
/* Both Pulse and Tone are allowed in Austria & Switzerland but it is not */
/* yet known if Tone is universally in those countries. */
static char * tonecc[] = {
"1", /* + North American Numbering Plan */
"31", /* Netherlands */
"32", /* Belgium */
"33", /* France */
"352", /* Luxembourg */
"353", /* Ireland */
"354", /* Iceland */
"358", /* Finland */
"39", /* Italy */
"44", /* + UK */
"45", /* Denmark */
"46", /* Sweden */
"47", /* Norway */
"49", /* + Germany */
NULL
};
#ifndef MINIDIAL
/*
Telebit model codes:
ATI Model Numbers Examples
--- ------------- --------
123 Telebit in "total Hayes-1200" emulation mode
960 Telebit in Conventional Command (Hayes) mode
961 RA12C IBM PC internal original Trailblazer
962 RA12E External original Trailblazer
963 RM12C Rackmount original Trailblazer
964 T18PC IBM PC internal Trailblazer-Plus (TB+)
965 T18SA, T2SAA, T2SAS External TB+, T1600, T2000, T3000, WB, and later
966 T18RMM Rackmount TB+
967 T2MC IBM PS/2 internal TB+
968 T1000 External T1000
969 ? Qblazer
970 Qblazer Plus
971 T2500 External T2500
972 T2500 Rackmount T2500
*/
/* Telebit model codes */
#define TB_UNK 0 /* Unknown Telebit model */
#define TB_BLAZ 1 /* Original TrailBlazer */
#define TB_PLUS 2 /* TrailBlazer Plus */
#define TB_1000 3 /* T1000 */
#define TB_1500 4 /* T1500 */
#define TB_1600 5 /* T1600 */
#define TB_2000 6 /* T2000 */
#define TB_2500 7 /* T2500 */
#define TB_3000 8 /* T3000 */
#define TB_QBLA 9 /* Qblazer */
#define TB_WBLA 10 /* WorldBlazer */
#define TB__MAX 10 /* Highest number */
char *tb_name[] = { /* Array of model names */
"Unknown", /* TB_UNK */
"TrailBlazer", /* TB_BLAZ */
"TrailBlazer-Plus", /* TB_PLUS */
"T1000", /* TB_1000 */
"T1500", /* TB_1500 */
"T1600", /* TB_1600 */
"T2000", /* TB_2000 */
"T2500", /* TB_2500 */
"T3000", /* TB_3000 */
"Qblazer", /* TB_QBLA */
"WorldBlazer", /* TB_WBLA */
""
};
#endif /* MINIDIAL */
extern int flow, local, mdmtyp, quiet, backgrd, parity, seslog, network;
extern int carrier, duplex, mdmsav, reliable, setreliable;
extern int ttnproto, nettype;
extern long speed;
extern char ttname[], sesfil[];
#ifndef NOXFER
extern CHAR stchr;
extern int interrupted;
#endif /* NOXFER */
/* Failure codes */
#define F_TIME 1 /* timeout */
#define F_INT 2 /* interrupt */
#define F_MODEM 3 /* modem-detected failure */
#define F_MINIT 4 /* cannot initialize modem */
#ifndef CK_TAPI
static
#endif /* CK_TAPI */
#ifdef OS2
volatile
#endif /* OS2 */
int fail_code = 0; /* Default failure reason. */
static int xredial = 0;
static int func_code; /* 0 = dialing, nonzero = answering */
static int partial;
static int mymdmtyp = 0;
#define DW_NOTHING 0 /* What we are doing */
#define DW_INIT 1
#define DW_DIAL 2
static int dial_what = DW_NOTHING; /* Nothing at first. */
static int nonverbal = 0; /* Hayes in numeric response mode */
static MDMINF * mp;
static CHAR escbuf[6];
static long mdmcapas;
_PROTOTYP (static VOID dreset, (void) );
_PROTOTYP (static int (*xx_ok), (int,int) );
_PROTOTYP (static int ddinc, (int) );
_PROTOTYP (int dialhup, (void) );
_PROTOTYP (int getok, (int,int) );
_PROTOTYP (char * ck_time, (void) );
_PROTOTYP (static VOID ttslow, (char *, int) );
#ifdef COMMENT
_PROTOTYP (static VOID xcpy, (char *, char *, unsigned int) );
#endif /* COMMENT */
_PROTOTYP (static VOID waitfor, (char *) );
_PROTOTYP (static VOID dialoc, (char) );
_PROTOTYP (static int didweget, (char *, char *) );
_PROTOTYP (static VOID spdchg, (long) );
_PROTOTYP (static int dialfail, (int) );
_PROTOTYP (static VOID gethrw, (void) );
_PROTOTYP (static VOID gethrn, (void) );
int dialudt = n_UDEF; /* Number of user-defined type */
/* BEGIN MDMINF STRUCT DEFINITIONS */
/*
Declare structures containing modem-specific information.
REMEMBER that only the first SEVEN characters of these names are
guaranteed to be unique.
First declare the three types that are allowed for MINIDIAL versions.
*/
static
MDMINF CCITT = /* CCITT / ITU-T V.25bis autodialer */
/*
According to V.25bis:
. Even parity is required for giving commands to the modem.
. Commands might or might not echo.
. Responses ("Indications") from the modem are terminated by CR and LF.
. Call setup is accomplished by:
- DTE raises DTR (V.24 circuit 108) [ttopen() does this]
- Modem raises CTS (V.24 circuit 106) [C-Kermit ignores this]
- DTE issues a call request command ("CRN")
- Modem responds with "VAL" ("command accepted")
- If the call is completed:
modem responds with "CNX" ("call connected");
modem turns CTS (106) OFF;
modem turns DSR (107) ON;
else:
modem responds with "CFI <parameter>" ("call failure indication").
. To clear a call, the DTE turns DTR (108) OFF.
. There is no mention of the Carrier Detect circuit (109) in the standard.
. There is no provision for "escaping back" to the modem's command mode.
It is not known whether there exists in real life a pure V.25bis modem.
If there is, this code has never been tested on it. See the Digitel entry.
*/
{
"Any CCITT / ITU-T V.25bis conformant modem",
"", /* pulse command */
"", /* tone command */
40, /* dial_time -- programmable -- */
",:", /* pause_chars -- "," waits for programmable time */
/* ":" waits for dial tone */
10, /* pause_time (seconds, just a guess) */
"", /* wake_str (none) */
200, /* wake_rate (msec) */
"VAL", /* wake_prompt */
"", /* dmode_str (none) */
"", /* dmode_prompt (none) */
"CRN%s\015", /* dial_str */
200, /* dial_rate (msec) */
0, /* No esc_time */
0, /* No esc_char */
"", /* No hup_str */
"", /* hwfc_str */
"", /* swfc_str */
"", /* nofc_str */
"", /* ec_on_str */
"", /* ec_off_str */
"", /* dc_on_str */
"", /* dc_off_str */
"CIC\015", /* aa_on_str */
"DIC\015", /* aa_off_str */
"", /* sb_on_str */
"", /* sb_off_str */
"", /* sp_off_str */
"", /* sp_on_str */
"", /* vol1_str */
"", /* vol2_str */
"", /* vol3_str */
"", /* ignoredt */
"", /* ini2 */
0L, /* max_speed */
CKD_V25, /* capas */
NULL /* No ok_fn */
};
static
MDMINF HAYES = /* Hayes 2400 and compatible modems */
{
"Hayes Smartmodem 2400 and compatibles",
"ATP\015", /* pulse command */
"ATT\015", /* tone command */
35, /* dial_time */
",", /* pause_chars */
2, /* pause_time */
#ifdef OS2
"ATE1Q0V1&S0&C1&D2\015", /* wake_str */
#else
#ifdef VMS
"ATQ0&S1\015", /* wake_str */
#else
"ATQ0\015", /* wake_str */
#endif /* VMS */
#endif /* OS2 */
0, /* wake_rate */
"OK\015", /* wake_prompt */
"", /* dmode_str */
"", /* dmode_prompt */
"ATD%s\015", /* dial_str, user supplies D or T */
0, /* dial_rate */
1100, /* esc_time */
43, /* esc_char */
"ATQ0H0\015", /* hup_str */
"", /* hwfc_str */
"", /* swfc_str */
"", /* nofc_str */
"", /* ec_on_str */
"", /* ec_off_str */
"", /* dc_on_str */
"", /* dc_off_str */
"ATS0=1\015", /* aa_on_str */
"ATS0=0\015", /* aa_off_str */
"", /* sb_on_str */
"", /* sb_off_str */
"ATM1\015", /* sp_on_str */
"ATM0\015", /* sp_off_str */
"ATL1\015", /* vol1_str */
"ATL2\015", /* vol2_str */
"ATL3\015", /* vol3_str */
"ATX3\015", /* ignoredt */
"", /* ini2 */
2400L, /* max_speed */
CKD_AT, /* capas */
getok /* ok_fn */
};
/*
The intent of the "unknown" modem is to allow KERMIT to support
unknown modems by having the user type the entire autodial sequence
(possibly including control characters, etc.) as the "phone number".
The protocol and other characteristics of this modem are unknown, with
some "reasonable" values being chosen for some of them. The only way to
detect if a connection is made is to look for carrier.
*/
static
MDMINF UNKNOWN = /* Information for "Unknown" modem */
{
"Unknown", /* name */
"", /* pulse command */
"", /* tone command */
30, /* dial_time */
"", /* pause_chars */
0, /* pause_time */
"", /* wake_str */
0, /* wake_rate */
"", /* wake_prompt */
"", /* dmode_str */
NULL, /* dmode_prompt */
"%s\015", /* dial_str */
0, /* dial_rate */
0, /* esc_time */
0, /* esc_char */
"", /* hup_str */
"", /* hwfc_str */
"", /* swfc_str */
"", /* nofc_str */
"", /* ec_on_str */
"", /* ec_off_str */
"", /* dc_on_str */
"", /* dc_off_str */
"", /* aa_on_str */
"", /* aa_off_str */
"", /* sb_on_str */
"", /* sb_off_str */
"", /* sp_off_str */
"", /* sp_on_str */
"", /* vol1_str */
"", /* vol2_str */
"", /* vol3_str */
"", /* ignoredt */
"", /* ini2 */
0L, /* max_speed */
0, /* capas */
NULL /* ok_fn */
};
#ifndef MINIDIAL
static
MDMINF ATTISN = /* AT&T ISN Network */
{
"", /* pulse command */
"", /* tone command */
"AT&T ISN Network",
30, /* Dial time */
"", /* Pause characters */
0, /* Pause time */
"\015\015\015\015", /* Wake string */
900, /* Wake rate */
"DIAL", /* Wake prompt */
"", /* dmode_str */
"", /* dmode_prompt */
"%s\015", /* dial_str */
0, /* dial_rate */
0, /* esc_time */
0, /* esc_char */
"", /* hup_str */
"", /* hwfc_str */
"", /* swfc_str */
"", /* nofc_str */
"", /* ec_on_str */
"", /* ec_off_str */
"", /* dc_on_str */
"", /* dc_off_str */
"", /* aa_on_str */
"", /* aa_off_str */
"", /* sb_on_str */
"", /* sb_off_str */
"", /* sp_off_str */
"", /* sp_on_str */
"", /* vol1_str */
"", /* vol2_str */
"", /* vol3_str */
"", /* ignoredt */
"", /* ini2 */
0L, /* max_speed */
0, /* capas */
NULL /* ok_fn */
};
static
MDMINF ATTMODEM = /* information for AT&T switched-network modems */
/* "Number" following "dial" can include: p's and
* t's to indicate pulse or tone (default) dialing,
* + for wait for dial tone, , for pause, r for
* last number dialed, and, except for 2224B, some
* comma-delimited options like o12=y, before number.
* "Important" options for the modems:
*
* All: Except for 2224B, enable option 12 for "transparent
* data," o12=y. If a computer port used for both
* incoming and outgoing calls is connected to the
* modem, disable "enter interactive mode on carriage
* return," EICR. The Kermit "dial" command can
* function with EIA leads standard, EIAS.
*
* 2212C: Internal hardware switches at their default
* positions (four rockers down away from numbers)
* unless EICR is not wanted (rocker down at the 4).
* For EIAS, rocker down at the 1.
*
* 2224B: Front-panel switch position 1 must be up (at the 1,
* closed). Disable EICR with position 2 down.
* For EIAS, position 4 down.
* All switches on the back panel down.
*
* 2224CEO: All front-panel switches down except either 5 or 6.
* Enable interactive flow control with o16=y.
* Select normal asynchronous mode with o34=0 (zero).
* Disable EICR with position 3 up. For EIAS, 1 up.
* Reset the modem after changing switches.
*
* 2296A: If option 00 (zeros) is present, use o00=0.
* Enable interactive flow control with o16=y.
* Select normal asynchronous mode with o34=0 (zero).
* (available in Microcom Networking version, but
* not necessarily other models of the 2296A).
* Enable modem-port flow control (if available) with
* o42=y. Enable asynchronous operation with o50=y.
* Disable EICR with o69=n. For EIAS, o66=n, using
* front panel.
*/
{
"AT&T switched-network modems",
"", /* pulse command */
"", /* tone command */
20, /* dial_time */
",", /* pause_chars */
2, /* pause_time */
"+", /* wake_str */
0, /* wake_rate */
"", /* wake_prompt */
"", /* dmode_str */
"", /* dmode_prompt */
"at%s\015", /* dial_str */
0, /* dial_rate */
0, /* esc_time */
0, /* esc_char */
"", /* hup_str */
"", /* hwfc_str */
"", /* swfc_str */
"", /* nofc_str */
"", /* ec_on_str */
"", /* ec_off_str */
"", /* dc_on_str */
"", /* dc_off_str */
"", /* aa_on_str */
"", /* aa_off_str */
"", /* sb_on_str */
"", /* sb_off_str */
"", /* sp_off_str */
"", /* sp_on_str */
"", /* vol1_str */
"", /* vol2_str */
"", /* vol3_str */
"", /* ignoredt */
"", /* ini2 */
0L, /* max_speed */
CKD_AT, /* capas */
NULL /* ok_fn */
};
static
MDMINF ATTDTDM = /* AT&T Digital Terminal Data Module */
/* For dialing: KYBD switch down, others usually up. */
{
"AT&T Digital Terminal Data Module",
"", /* pulse command */
"", /* tone command */
20, /* dial_time */
"", /* pause_chars */
0, /* pause_time */
"", /* wake_str */
0, /* wake_rate */
"", /* wake_prompt */
"", /* dmode_str */
"", /* dmode_prompt */
"%s\015", /* dial_str */
0, /* dial_rate */
0, /* esc_time */
0, /* esc_char */
"", /* hup_str */
"", /* hwfc_str */
"", /* swfc_str */
"", /* nofc_str */
"", /* ec_on_str */
"", /* ec_off_str */
"", /* dc_on_str */
"", /* dc_off_str */
"", /* aa_on_str */
"", /* aa_off_str */
"", /* sb_on_str */
"", /* sb_off_str */
"", /* sp_off_str */
"", /* sp_on_str */
"", /* vol1_str */
"", /* vol2_str */
"", /* vol3_str */
"", /* ignoredt */
"", /* ini2 */
0L, /* max_speed */
0, /* capas */
NULL /* ok_fn */
};
static
MDMINF DIGITEL = /* Digitel DT-22 CCITT variant used in Brazil */
/*
Attempts to adhere strictly to the V.25bis specification do not produce good
results in real life. The modem for which this code was developed: (a)
ignores parity; (b) sometimes terminates responses with LF CR instead of CR
LF; (c) has a Hayes-like escape sequence; (d) supports a hangup ("HUP")
command. Information from Fernando Cabral in Brasilia.
*/
{
"Digitel DT-22 CCITT dialer",
"", /* pulse command */
"", /* tone command */
40, /* dial_time -- programmable -- */
",:", /* pause_chars -- "," waits for programmable time */
/* ":" waits for dial tone */
10, /* pause_time (seconds, just a guess) */
"HUP\015", /* wake_str (Not Standard CCITT) */
200, /* wake_rate (msec) */
"VAL", /* wake_prompt */
"", /* dmode_str (none) */
"", /* dmode_prompt (none) */
"CRN%s\015", /* dial_str */
200, /* dial_rate (msec) */
1100, /* esc_time (Not Standard CCITT) */
43, /* esc_char (Not Standard CCITT) */
"HUP\015", /* hup_str (Not Standard CCITT) */
"", /* hwfc_str */
"", /* swfc_str */
"", /* nofc_str */
"", /* ec_on_str */
"", /* ec_off_str */
"", /* dc_on_str */
"", /* dc_off_str */
"CIC\015", /* aa_on_str */
"DIC\015", /* aa_off_str */
"", /* sb_on_str */
"", /* sb_off_str */
"", /* sp_off_str */
"", /* sp_on_str */
"", /* vol1_str */
"", /* vol2_str */
"", /* vol3_str */
"", /* ignoredt */
"", /* ini2 */
0L, /* max_speed */
CKD_V25, /* capas */
getok /* ok_fn */
};
static
MDMINF H_1200 = /* Hayes 1200 and compatible modems */
{
"Hayes Smartmodem 1200 and compatibles",
"ATP\015", /* pulse command */
"ATT\015", /* tone command */
35, /* dial_time */
",", /* pause_chars */
2, /* pause_time */
#ifdef OS2
"ATE1Q0V1\015", /* wake_str */
#else
"ATQ0\015", /* wake_str */
#endif /* OS2 */
0, /* wake_rate */
"OK\015", /* wake_prompt */
"", /* dmode_str */
"", /* dmode_prompt */
"ATD%s\015", /* dial_str */
0, /* dial_rate */
1100, /* esc_time */
43, /* esc_char */
"ATQ0H0\015", /* hup_str */
"", /* hwfc_str */
"", /* swfc_str */
"", /* nofc_str */
"", /* ec_on_str */
"", /* ec_off_str */
"", /* dc_on_str */
"", /* dc_off_str */
"ATS0=1\015", /* aa_on_str */
"ATS0=0\015", /* aa_off_str */
"", /* sb_on_str */
"", /* sb_off_str */
"ATM1\015", /* sp_on_str */
"ATM0\015", /* sp_off_str */
"ATL1\015", /* vol1_str */
"ATL2\015", /* vol2_str */
"ATL3\015", /* vol3_str */
"", /* ignoredt */
"", /* ini2 */
1200L, /* max_speed */
CKD_AT, /* capas */
getok /* ok_fn */
};
static
MDMINF H_ULTRA = /* Hayes high-speed */
{
"Hayes Ultra/Optima/Accura 96/144/288", /* U,O,A */
"ATP\015", /* pulse command */
"ATT\015", /* tone command */
35, /* dial_time */
",", /* pause_chars */
2, /* pause_time */
#ifdef OS2
"ATE1Q0V1X4N1Y0&S0&C1&D2S37=0S82=128\015", /* wake_str */
#else
#ifdef VMS
"ATQ0X4N1Y0&S1S37=0S82=128\015", /* wake_str */
#else
"ATQ0X4N1Y0S37=0S82=128\015", /* wake_str */
#endif /* VMS */
#endif /* OS2 */
0, /* wake_rate */
"OK\015", /* wake_prompt */
"", /* dmode_str */
"", /* dmode_prompt */
"ATD%s\015", /* dial_str */
0, /* dial_rate */
1100, /* esc_time */
43, /* esc_char */
"ATQ0H0\015", /* hup_str */
"AT&K3\015", /* hwfc_str */ /* OK for U,O */
"AT&K4\015", /* swfc_str */ /* OK for U,O */
"AT&K0\015", /* nofc_str */ /* OK for U,O */
"AT&Q5S36=7S48=7\015", /* ec_on_str */ /* OK for U,O */
"AT&Q0\015", /* ec_off_str */ /* OK for U,O */
"ATS46=2\015", /* dc_on_str */
"ATS46=0\015", /* dc_off_str */
"ATS0=1\015", /* aa_on_str */
"ATS0=0\015", /* aa_off_str */
"", /* sb_on_str */
"", /* sb_off_str */
"ATM1\015", /* sp_on_str */
"ATM0\015", /* sp_off_str */
"ATL1\015", /* vol1_str */
"ATL2\015", /* vol2_str */
"ATL3\015", /* vol3_str */
"ATX3\015", /* ignoredt */
"", /* ini2 */
115200L, /* max_speed */ /* (varies) */
CKD_AT|CKD_SB|CKD_EC|CKD_DC|CKD_HW|CKD_SW, /* capas */
getok /* ok_fn */
};