From 02187ec81375cb4cc2396f9e2a2da1dbc2448e13 Mon Sep 17 00:00:00 2001 From: zefie Date: Sun, 23 Feb 2025 08:45:06 -0500 Subject: [PATCH] bf0app fully generated --- .../bf0app/bf0app.normal.template.txt | 107 ++++++++++++++++++ .../ServiceVault/wtv-1800/preregister.js | 8 +- 2 files changed, 112 insertions(+), 3 deletions(-) create mode 100644 zefie_wtvp_minisrv/includes/ServiceDeps/wtv-1800/tellyscripts/bf0app/bf0app.normal.template.txt diff --git a/zefie_wtvp_minisrv/includes/ServiceDeps/wtv-1800/tellyscripts/bf0app/bf0app.normal.template.txt b/zefie_wtvp_minisrv/includes/ServiceDeps/wtv-1800/tellyscripts/bf0app/bf0app.normal.template.txt new file mode 100644 index 00000000..bba65402 --- /dev/null +++ b/zefie_wtvp_minisrv/includes/ServiceDeps/wtv-1800/tellyscripts/bf0app/bf0app.normal.template.txt @@ -0,0 +1,107 @@ +InitGeneratedValues() +{ + printf("TS: %ServiceName% minisrv Generated Artemis TellyScript"); + setani(""); + setlocalpopcount(1); + gNVRAMMayBeInvalid = 0; + gDisguiseRate = 1; + + gUsingOpenISP = 0; + gEnable56K = 0; + printf("TS: Setting NameServers: %DNSIP1%, %DNSIP2%"); + setnameservice(%DNS1%, %DNS2%); + gBlock911 = 1; + gWantsVideoAd = 1; + + gUsername = getserialnumber(); + gPAPPassword = "dummy"; + gCHAPSecret = "=1lpHL>=bTVKh1Z?26"; + return 0; +} + +LoginToPOP(int Fb, int Gb) +{ + return PAPChat("wtv_%s", 0); +} + +ChatWithIndexedProvider(int idx) +{ + if (idx == 48) { + return LoginToPOP(71, 100); + } + + return 16; +} + +DialIndexedPOP(char *staticConfig, char *dynamicConfig, int seq_idx, int idx, +int *err) +{ + char *accessNumber, *accessProvider, *Lb = ""; + int ka; + + if (seq_idx == 48) { + accessNumber = "%DialinNumber%"; + accessProvider = "artemis"; + ka = 1; + } else { + printf("BUG!"); + *err = 16; + return 2; + } + + setfullpopnumber(Lb); + return DialIAP(staticConfig, dynamicConfig, accessProvider, accessNumber, ka, err); +} + + +PatternDial(char* staticConfig, char* dynamicConfig) +{ + int pMinute, pHour, pMonth, pYear, pDayOfWeek; + int Rb, Sb; + + WhatTimeIsIt(&pMinute, &pHour, &pMonth, &pYear, &pDayOfWeek); + Rb = pYear * 100 + pMonth; + Sb = pHour * 100 + pMinute; + + printf("TS: using set for %d %d:%02d %d", + Rb, pHour, pMinute, pDayOfWeek); + + { + { + { + return DialByIndex(staticConfig, dynamicConfig, "00"); + } + } + } + + return 1; + +} + + +AccessDial(char* staticConfig, char* dynamicConfig, char* accessNumber) +{ + int tb, ub, vb; + + if (version() >= 8) { + vb = getconnectretrycount(); + } else { + vb = 0; + } + + printf("TS: next=%d", vb); + + if (vb) + return 13; + + tb = DialIAP(staticConfig, dynamicConfig, + "-access-", accessNumber, 1, &ub); + if (tb) { + setdtr(0); + return ub; + } + ub = LoginToPOP(71, 100); + + return ub; +} + diff --git a/zefie_wtvp_minisrv/includes/ServiceVault/wtv-1800/preregister.js b/zefie_wtvp_minisrv/includes/ServiceVault/wtv-1800/preregister.js index b3b3c8f3..3b2dce53 100644 --- a/zefie_wtvp_minisrv/includes/ServiceVault/wtv-1800/preregister.js +++ b/zefie_wtvp_minisrv/includes/ServiceVault/wtv-1800/preregister.js @@ -109,8 +109,10 @@ if (session_data.data_store.wtvsec_login) { case "bf0app": prereg_contype = "text/tellyscript"; // if wtv-open-access: true then client expects OpenISP - if (session_data.get("wtv-open-access")) template = wtvshared.getServiceDep("/wtv-1800/tellyscripts/bf0app/bf0app.base.template.txt") + wtvshared.getServiceDep("/wtv-1800/tellyscripts/bf0app/bf0app.openisp.template.txt"); - else file_path = wtvshared.getServiceDep("/wtv-1800/tellyscripts/bf0app/bf0app_WTV_18006138199.tok", true); + template = wtvshared.getServiceDep("/wtv-1800/tellyscripts/bf0app/bf0app.base.template.txt") + if (session_data.get("wtv-open-access")) template += wtvshared.getServiceDep("/wtv-1800/tellyscripts/bf0app/bf0app.openisp.template.txt"); + else template += wtvshared.getServiceDep("/wtv-1800/tellyscripts/bf0app/bf0app.normal.template.txt"); + //else file_path = wtvshared.getServiceDep("/wtv-1800/tellyscripts/bf0app/bf0app_WTV_18006138199.tok", true); break; // the following are not yet zefie generated and may have an unknown username/password attached @@ -203,7 +205,7 @@ if (session_data.data_store.wtvsec_login) { telly.setTemplateVars(minisrv_config.config.service_name, minisrv_config.services[service_name].dialin_number, minisrv_config.services[service_name].dns1ip, minisrv_config.services[service_name].dns2ip); telly.minify(); telly.tokenize(); - telly.pack(); + telly.pack((session_data.get("wtv-open-access")) ? 3 : 1); sendToClient(socket, headers, telly.packed_data); } } else {