|
|
|
@ -389,7 +389,10 @@ bool CQnetGateway::read_config(char *cfgFile)
|
|
|
|
if (! get_value(cfg, path+"dtmf", dtmf_dir, 2,FILENAME_MAX, "/tmp"))
|
|
|
|
if (! get_value(cfg, path+"dtmf", dtmf_dir, 2,FILENAME_MAX, "/tmp"))
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
|
|
if (! get_value(cfg, path+"status", status_file, 1, FILENAME_MAX, "/usr/local/etc/RPTR_STATUS.txt"))
|
|
|
|
if (! get_value(cfg, path+"status", status_file, 2, FILENAME_MAX, "/usr/local/etc/RPTR_STATUS.txt"))
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (! get_value(cfg, path+"qnvoicefile", qnvoicefile, 2, FILENAME_MAX, ".tmp/qnvoice.txt"))
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
|
|
// link
|
|
|
|
// link
|
|
|
|
@ -478,10 +481,36 @@ void CQnetGateway::GetIRCDataThread()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
short threshold = 0;
|
|
|
|
short threshold = 0;
|
|
|
|
|
|
|
|
bool not_announced[3];
|
|
|
|
|
|
|
|
for (int i=0; i<3; i++)
|
|
|
|
|
|
|
|
not_announced[i] = this->rptr.mod[i].defined; // announce to all modules that are defined!
|
|
|
|
|
|
|
|
bool is_quadnet = (0 == ircddb.ip.compare("rr.openquad.net"));
|
|
|
|
while (keep_running) {
|
|
|
|
while (keep_running) {
|
|
|
|
threshold++;
|
|
|
|
threshold++;
|
|
|
|
if (threshold >= 100) {
|
|
|
|
if (threshold >= 100) {
|
|
|
|
int rc = ii->getConnectionState();
|
|
|
|
int rc = ii->getConnectionState();
|
|
|
|
|
|
|
|
if (rc > 5 && rc < 8 && is_quadnet) {
|
|
|
|
|
|
|
|
char ch = '\0';
|
|
|
|
|
|
|
|
if (not_announced[0])
|
|
|
|
|
|
|
|
ch = 'A';
|
|
|
|
|
|
|
|
else if (not_announced[1])
|
|
|
|
|
|
|
|
ch = 'B';
|
|
|
|
|
|
|
|
else if (not_announced[2])
|
|
|
|
|
|
|
|
ch = 'C';
|
|
|
|
|
|
|
|
if (ch) {
|
|
|
|
|
|
|
|
// we need to announce, but can we?
|
|
|
|
|
|
|
|
struct stat sbuf;
|
|
|
|
|
|
|
|
if (stat(qnvoicefile.c_str(), &sbuf)) {
|
|
|
|
|
|
|
|
// yes, there is no qnvoicefile, so create it
|
|
|
|
|
|
|
|
FILE *fp = fopen(qnvoicefile.c_str(), "w");
|
|
|
|
|
|
|
|
if (fp) {
|
|
|
|
|
|
|
|
fprintf(fp, "%c_connected2network.dat_WELCOME_TO_QUADNET", ch);
|
|
|
|
|
|
|
|
fclose(fp);
|
|
|
|
|
|
|
|
not_announced[ch - 'A'] = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
if ((rc == 0) || (rc == 10)) {
|
|
|
|
if ((rc == 0) || (rc == 10)) {
|
|
|
|
if (last_status != 0) {
|
|
|
|
if (last_status != 0) {
|
|
|
|
printf("irc status=%d, probable disconnect...\n", rc);
|
|
|
|
printf("irc status=%d, probable disconnect...\n", rc);
|
|
|
|
@ -1664,6 +1693,14 @@ void CQnetGateway::Process()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{ // Not in cache, please try again!
|
|
|
|
|
|
|
|
FILE *fp = fopen(qnvoicefile.c_str(), "w");
|
|
|
|
|
|
|
|
if (fp) {
|
|
|
|
|
|
|
|
fprintf(fp, "%c_notincache.dat_NOT_IN_CACHE\n", rptrbuf.vpkt.hdr.r1[7]);
|
|
|
|
|
|
|
|
fclose(fp);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (0 == memcmp(rptrbuf.vpkt.hdr.ur, " C0", 8)) {
|
|
|
|
else if (0 == memcmp(rptrbuf.vpkt.hdr.ur, " C0", 8)) {
|
|
|
|
|