diff --git a/_locales/de/messages.json b/_locales/de/messages.json
index 41dc3f4..ffc50ea 100644
--- a/_locales/de/messages.json
+++ b/_locales/de/messages.json
@@ -197,7 +197,7 @@
},
"test_CallMon": {
- "message": "Teste CallMon",
+ "message": "Teste CallMonitor",
"description": ""
},
@@ -360,7 +360,7 @@
}
},
- "pop_callingNumberText_Number": {
+ "pop_callingNumberText_Number_out": {
"message": "Nummer $number$ wird angerufen",
"description": "",
"placeholders": {
@@ -370,7 +370,7 @@
}
},
- "pop_callingNumberText_Name": {
+ "pop_callingNumberText_Name_out": {
"message": "'$name$' ($number$) wird angerufen",
"description": "",
"placeholders": {
@@ -383,6 +383,30 @@
}
},
+ "pop_callingNumberText_Number_in": {
+ "message": "Nummer $number$ ruft dich an",
+ "description": "",
+ "placeholders": {
+ "number" : {
+ "content" : "$1"
+ }
+ }
+ },
+
+ "pop_callingNumberText_Name_in": {
+ "message": "'$name$' ($number$) ruft dich an",
+ "description": "",
+ "placeholders": {
+ "number" : {
+ "content" : "$1"
+ },
+ "name" : {
+ "content" : "$2"
+ }
+ }
+ },
+
+
"pop_connectingNumberText_Number": {
"message": "Verbindung zur Nummer $number$ wird aufgebaut",
"description": "",
diff --git a/_locales/en/messages.json b/_locales/en/messages.json
index aa1b930..4cbd026 100644
--- a/_locales/en/messages.json
+++ b/_locales/en/messages.json
@@ -197,7 +197,7 @@
},
"test_CallMon": {
- "message": "Testing CallMon",
+ "message": "Testing CallMonitor",
"description": ""
},
@@ -360,7 +360,7 @@
}
},
- "pop_callingNumberText_Number": {
+ "pop_callingNumberText_Number_out": {
"message": "Calling number $number$",
"description": "",
"placeholders": {
@@ -370,7 +370,7 @@
}
},
- "pop_callingNumberText_Name": {
+ "pop_callingNumberText_Name_out": {
"message": "Calling '$name$' ($number$)",
"description": "",
"placeholders": {
@@ -383,6 +383,29 @@
}
},
+ "pop_callingNumberText_Number_in": {
+ "message": "Number $number$ is calling",
+ "description": "",
+ "placeholders": {
+ "number" : {
+ "content" : "$1"
+ }
+ }
+ },
+
+ "pop_callingNumberText_Name_in": {
+ "message": "'$name$' ($number$) is calling",
+ "description": "",
+ "placeholders": {
+ "number" : {
+ "content" : "$1"
+ },
+ "name" : {
+ "content" : "$2"
+ }
+ }
+ },
+
"pop_connectingNumberText_Number": {
"message": "Establishing connection to number $number$",
"description": "",
diff --git a/background.js b/background.js
index a243202..7235bb4 100644
--- a/background.js
+++ b/background.js
@@ -403,6 +403,8 @@ function work(info){
//note(wer + " ruft" + extra + " an");
note( browser.i18n.getMessage("ring_text", [wer, extra]) );
ruf(true);
+ Listener_Dial = [2, info[4]];
+ blink_connecting("on", 2);
}
break;
@@ -627,7 +629,7 @@ function callNumber(number, sendResponse){
}).then(function(){
console.info("Calling number: " + number);
Listener_Dial = [0, number];
- blink_connecting("on");
+ blink_connecting("on", 1);
if(GL_PythonListen.isRunning() == false){
//console.log("set Time connectingStopped");
@@ -733,10 +735,14 @@ function blink_missed(x){
let blink_connecting_toggle = 0;
let blink_connecting_interval = 0;
-function blink_connecting(x){
-
+function blink_connecting(x, out_in){
+ //out_in 1=du rufst an; 2=du wirst angerufen
+
if(blink_connecting_toggle){
- browser.browserAction.setBadgeBackgroundColor({color: "#00CC00"});
+ if(out_in == 1) browser.browserAction.setBadgeBackgroundColor({color: "#00CC00"});
+ else if(out_in == 2) browser.browserAction.setBadgeBackgroundColor({color: "#0000CC"});
+ console.info("out_in", out_in)
+
browser.browserAction.setBadgeText({text: "📞"});
blink_connecting_toggle = 0;
}
@@ -748,9 +754,10 @@ function blink_connecting(x){
if(x != ""){
if(x == "on"){
+
clearInterval(blink_connecting_interval);
blink_connecting_interval = setInterval(() => {
- blink_connecting();
+ blink_connecting("", out_in);
}, 1000);
}
else if(x == "off"){
diff --git a/help/help.html b/help/help.html
index fd8edf9..f164d57 100644
--- a/help/help.html
+++ b/help/help.html
@@ -28,8 +28,8 @@
FritzBox
- To view the call log, the following is needed:
- - A user account is needed, which has access to the call list (see here)
-
- In order for the addon to be able to interact with the FritzBox, TR-064 must be activated (see here at "FRITZ!Box für Zugriff von Anwendungen einrichten")
+
- A user account is needed, which has access to the call list (see here)
+
- In order for the addon to be able to interact with the FritzBox, TR-064 must be activated (see here at "Configuring the FRITZ!Box to allow access for applications")
- For the CallMonitor, the port 1012 must be enabled on the FritzBox. This can be done by dialing #96*5* by phone. With the number #96*4* you can block it again.
diff --git a/help/help_de.html b/help/help_de.html
index fc438f7..8191c50 100644
--- a/help/help_de.html
+++ b/help/help_de.html
@@ -28,7 +28,7 @@
FritzBox
- Zum Anzeigen der Anrufliste wird folgendes benötigt:
- - Es wird ein Benutzerkonto benötigt, welches auf die Anrufliste Zugriff hat (s. hier)
+
- Es wird ein Benutzerkonto benötigt, welches auf die Anrufliste Zugriff hat (s. hier)
- Damit das Addon mit der FritzBox interagieren kann, muss TR-064 aktiviert sein (s. hier unter den Punkt "FRITZ!Box für Zugriff von Anwendungen einrichten")
diff --git a/popup.html b/popup.html
index d42d33d..c1ab265 100644
--- a/popup.html
+++ b/popup.html
@@ -211,7 +211,7 @@
diff --git a/popup.js b/popup.js
index 098ca7e..3312bc8 100644
--- a/popup.js
+++ b/popup.js
@@ -214,6 +214,8 @@ function connecting(obj){
return 0;
}
+ document.getElementById("callSymbol").style.color = "green";
+ document.getElementById("hangup").style.display = "inline-block";
let name = callingName.innerText;
let number = callingNumber.innerText;
@@ -247,18 +249,39 @@ function connecting(obj){
let calling_inter;
function calling(obj){
+ //obj: 1=du rufst an; 2=du wirst angerufen
+
//Es wird gerade jemand angerufen
change_Window(1);
change_sonder(1);
let name = callingName.innerText;
let number = callingNumber.innerText;
-
+
+ if(obj == 1){
+ document.getElementById("callSymbol").style.color = "green";
+ }
+ else if(obj == 2){
+ document.getElementById("callSymbol").style.color = "blue";
+ document.getElementById("hangup").style.display = "none";
+ }
+
+
if(callingName.innerText == ""){
- document.getElementById("callingNumberText").innerText = browser.i18n.getMessage("pop_callingNumberText_Number", [number]);
+ if(obj == 1){
+ document.getElementById("callingNumberText").innerText = browser.i18n.getMessage("pop_callingNumberText_Number_out", [number]);
+ }
+ else if(obj == 2){
+ document.getElementById("callingNumberText").innerText = browser.i18n.getMessage("pop_callingNumberText_Number_in", [number]);
+ }
}
else{
- document.getElementById("callingNumberText").innerText = browser.i18n.getMessage("pop_callingNumberText_Name", [number, name]);
+ if(obj == 1){
+ document.getElementById("callingNumberText").innerText = browser.i18n.getMessage("pop_callingNumberText_Name_out", [number, name]);
+ }
+ else if(obj == 2){
+ document.getElementById("callingNumberText").innerText = browser.i18n.getMessage("pop_callingNumberText_Name_in", [number, name]);
+ }
}
@@ -356,8 +379,9 @@ function checkCalling(obj){
callingName.innerText = obj["Listener_Dial"][2];
callingNumber.innerText = obj["Listener_Dial"][1];
- if(obj["Listener_Dial"][0] == 1) calling();
- else connecting();
+ if(obj["Listener_Dial"][0] == 0) connecting();
+ else if(obj["Listener_Dial"][0] == 1) calling(1);
+ else if(obj["Listener_Dial"][0] == 2) calling(2);
}
}
diff --git a/tools.js b/tools.js
index cbd9aed..07f0f2e 100644
--- a/tools.js
+++ b/tools.js
@@ -181,9 +181,10 @@ class PythonListen{
#port = null;
#state = 0;
#running = false;
+ #thisTimeout = 0;
- #PyVer = 0;
- #CallMonVer = 0
+ #PyVer = "?.?";
+ #CallMonVer = "?.?";
isRunning(){
@@ -245,6 +246,17 @@ class PythonListen{
start(){
if(this.connect() == true){
if(this.send("version") == true){
+
+ const self = this; //Bezug herstellen
+ this.#thisTimeout = setTimeout(() => {
+ //es dauert aufällig lange. evtl noch ne alte Version
+ self.errorEvent({
+ "state": 0,
+ "code": 0,
+ "message": "\n" + browser.i18n.getMessage("CallMon_alt", [CallMon_Version, self.getCallMonVer()])
+ });
+ }, 5*1000);
+
return true;
}
else{
@@ -300,6 +312,7 @@ class PythonListen{
break;
case "state":
+ clearTimeout(self.#thisTimeout);
if(info[1]) self.#state = Number(info[1]);
self.statechange(self.#state);
break;