Category : BBS Programs+Doors
Archive   : TONSMOD.ZIP
Filename : CALLBACK.MOD
Mon Mar 26 17:24:25 1990
Ok, here's my second set of mods in only a few months. I'm rapidly running out
of ideas for any future mods, so if you have any please send them to me. As
long as I think it's something worthwhile I should be able to code it up. I'll
probably be releasing my future mods on WWIVnet since it's a little quicker
getting them out, and they will probably be a lot farther in between.
Tony "Goose" Geisler
January 2, 1989
==============================================================================
Callback Validation Mod
This is an idea I originally got from some of the old Commodore boards, in
which the BBS calls back a new user to validate the phone number that he gave
when logging on. This mod is based on one I saw on WWIVnet by Carpenter that
did something very similar, but I think this one is a little more flexible as
the sysop can define the area codes and phone prefixes that are allowed to have
callback validation. In metro areas like DC a call to another area code can be
local, while in most places there are calls inside your area code that are
charged as long distance.
NOTE: One thing this mod assumes is that even if the area code is different,
that there is no need to dial it as a prefix since the number is local.
This is the way the DC area works, but I'm not sure about some others.
If this causes problems for you, let me know and I'll change it (or you
can do it yourself if you know how - I don't mind people changing my
mods, and even redistributing it as long as my name stays in the credits
somewhere).
OK, first for the source mods. Load up NEWUSER.C and read in the following
code just before void newuser():
void check_auto_validate() /* mod - add entire void */
{
int ok,f,i;
char s[161],s1[81];
long p,l;
ok=0;
strncpy(s1,thisuser.phone,7);
s1[7]=0;
strcpy(s,syscfg.gfilesdir);
strcat(s,"CALLBACK.TXT");
f=open(s,O_RDWR | O_BINARY);
if (f<0)
return;
lseek(f,0L,SEEK_SET);
l=filelength(f);
p=0;
while ((p
read(f,(void *)s,150);
i=0;
while ((i<150) && (s[i])) {
if (s[i]==13)
s[i]=0;
else
++i;
}
s[150]=0;
p += (long) (i+2);
if (s[i-1]==1)
s[i-1]=0;
if (!strncmp(s1,s,7))
ok=1;
}
close(f);
if (ok) {
printfile("CALLBACK");
prt(5,"Do you wish to do this? ");
if (yn()) {
nl();
pl("The system will now hang up and attempt to call. Please be prepared to have");
pl("your modem answer the phone.");
delay(3000);
dtr(0);
wait1(9);
dtr(1);
for (i=0; i<8; i++) {
s1[i]=thisuser.phone[i+4];
}
s1[8]=0;
sprintf(s,"Attempting Callback Validation to %s.",s1);
outs(s);
sprintf(s,"~~~~ATDT%s{",s1);
pr1(s);
ok=1;
i=0;
do {
if (!cdet()) wait1(100);
} while ((!cdet()) && (i++<4));
if ((cdet()) && (!hangup)) {
i=0;
do { } while (inkey()!=0);
do {
ok=0;
nl();
pl("Enter your password.");
outstr("PW:");
input(s,8);
if (!strcmp(s,thisuser.pw))
ok=1;
} while ((!ok) && (!hangup) && (i++<4));
} else
ok=0;
if (ok) {
nl();
pl("Callback validation completed. Your account has been upgraded.");
sysoplog("### User validated by CALLBACK validation");
thisuser.sl=50; /* change these to whatever you give */
thisuser.dsl=30; /* to validated new users */
realsl=thiuser.sl;
pausescr();
} else {
nl();
pl("Callback validation failed. Deleting your account.");
sysoplog("### User failed CALLBACK validation.");
deluser(usernum);
delay(3000);
dtr(0);
hangup=1;
}
} else {
nl();
pl("Callback validation skipped. You will have to wait for the sysop to");
pl("validate your account.");
sysoplog("### User did not want CALLBACK validation.");
pausescr();
}
}
}
Then, at the bottom of the file, at the very end of void newuser(), add the
following line to call the previous void:
- if (syscfg.newuser_c[0]) {
- stuff_in(s,syscfg.newuser_c,create_chain_file("CHAIN.TXT"),"","","","");
- full_external(s,0,1);
- }
+ if (incom) check_auto_validate(); /* mod - add */
- }
- }
Now you must update FCNS.H (argh!) to show the new void:
- void input_screensize();
- void input_pw();
- void input_ansistat();
+ void check_auto_validate(); /* mod - add */
- void newuser();
That's it for the source mods. You'll need to recompile the entire BBS because
of the changes to FCNS.H. When that's complete, you'll need to create two
files to put into your GFILES directory. The first is CALLBACK.TXT, and should
include a one line entry for each valid area code/dialing prefix combination in
your local area. These should be listed in the front of the phone book. For
example, for Manassas Virginia the following entries are valid.
703-221
703-330
703-335
703-361
703-367
703-368
703-369
703-490
703-491
703-494
703-497
703-590
703-594
703-640
703-670
703-680
703-690
703-754
703-791
703-878
Finally, you'll need to create a file called CALLBACK.MSG. This describes to
the user what is required from them if they want to be validated using
callback. Mine is as follows:
******************************************************************************
The phone number you gave in the registration has been determined to be in the
local area. If you wish, you may now have the BBS call you back to validate
your account here.
To do this, tell your modem to answer the phone by issuing the command "ATA"
(without the quotes) once the phone starts ringing. Note that if you have a
non-Hayes compatible modem, this commands will be different. Do not answer
the phone voice, or the modem will hang up.
You will then be asked for your password. If you fail to enter the password
correctly, or if no connection is made on callback, your account will be
deleted and you will have to re-register.
If you do not wish to do this, or you are at a different number than that
given in the logon information, then you may proceed and be validated normally
by the sysop within the next day or so.
******************************************************************************
That's it. Now your new callers won't have to wait so long before being
validated, and you'll have the satisfaction of knowing that the number that
they gave in their logon is valid (and have a reason to be cautious if they
decided to skip the validation).
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/