MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    MMM-FRITZ-Box-Callmonitor-py3 and MMM-Callmonitor-Current-Call

    Scheduled Pinned Locked Moved Utilities
    69 Posts 7 Posters 14.3k Views 8 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S Offline
      sdetweil @xIExodusIx
      last edited by

      @xIExodusIx you did use the token as the password, right?

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      X 3 Replies Last reply Reply Quote 0
      • X Offline
        xIExodusIx @sdetweil
        last edited by

        @sdetweil

        Yes, when I type git push, I have to type in my username and next I have to type in the “userpassword” for that I take the “Personal-Access-Toke” I got from github.

        Thats what I do:
        git push
        Username for ‘https://github.com’: xIExodusIx
        Password for ‘https://xIExodusIx@github.com’:
        remote: Permission to xIExodusIx/MMM-FRITZ-Box-Callmonitor-py3.git denied to xIExodusIx.
        Schwerwiegend: konnte nicht auf ‘https://github.com/xIExodusIx/MMM-FRITZ-Box-Callmonitor-py3.git/’ zugreifen: The requested URL returned error: 403

        The Problem is, that the “password” aka “Personal-Access-Token” is not showed in Linux (RaspiOS). I copy the “PAT (Personal-Access.-Token)” that I stored in Keepass on my PC and insert it using a klick with the right mouse-button in RaspiOS.

        1 Reply Last reply Reply Quote 0
        • X Offline
          xIExodusIx @sdetweil
          last edited by

          @sdetweil

          I got it, I made a new “Personal-Access-Token (classic)” giving it write access permissons for repositories and could now successful make “git push”.

          1 Reply Last reply Reply Quote 0
          • X Offline
            xIExodusIx @sdetweil
            last edited by

            @sdetweil

            What have I to do next?
            Can I edit my commit? I would like to give mor information and correct some typing errors.

            S 1 Reply Last reply Reply Quote 0
            • S Offline
              sdetweil @xIExodusIx
              last edited by

              @xIExodusIx no , cannot edit a “commit”

              you can make another

              change files
              test
              git status
              git add
              git commit
              git push

              same workflow each time

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              X 1 Reply Last reply Reply Quote 0
              • X Offline
                xIExodusIx @sdetweil
                last edited by

                @sdetweil

                okay :-)

                Thank you very, very much for your help.

                R 1 Reply Last reply Reply Quote 0
                • R Offline
                  rkorell Module Developer @xIExodusIx
                  last edited by

                  Dear @xIExodusIx ,
                  do you think it’s possible to get your re-compiled code?
                  I’m really curious - because the current call monitor is “nice” but the improvements you had described seemed to be really promising…

                  Thanks a lot.
                  Warmest regards,
                  Ralf

                  X 1 Reply Last reply Reply Quote 0
                  • X Offline
                    xIExodusIx @rkorell
                    last edited by

                    @rkorell

                    Hi Ralf,
                    if you search within the MM2 modules for “armybean” and find the module “MMM-Callmonitor-Current-Call” click on the right side in the description on “MMM-FRITZ-Box-Callmonitor”.
                    On the next screen click on the right side on “25 Forks” there you will find my Fork “xIExodusIx / MMM-FRITZ-Box-Callmonitor-py3”.
                    You can “git clone it” using “git clone https://github.com/xIExodusIx/MMM-FRITZ-Box-Callmonitor-py3.git” in the /MagicMirror/modules folder. That should do all for you. After that follow th instrucktions given by “Paviro or Dr.Torchwood” they are almost the same.
                    I havs only merged the Versions from Paviro and armybeen and drtorchwood together, I did not compile the module new. Paviro did the aase Module, armybean added the (colored) direction arrows and drtorchwood made the module work with python3.
                    If you wnt to have the colored direction arrows you have to add “showOutgoing: true, and colorEnabled: true,” at the modulesection “MMM-FRITZ-Box-Callmonitor.py” in the /MagicMirror/config/config.js. Same if you use armybeans “MMM-Callmonitor-Current-Call”.
                    I hope this is understanding for you.

                    Have fun with it.
                    Carsten

                    R 2 Replies Last reply Reply Quote 0
                    • R Offline
                      rkorell Module Developer @xIExodusIx
                      last edited by

                      @xIExodusIx said

                      Have fun with it.

                      Dear Carsten, indeed - I DO have fun!

                      It’s really, really nice and works like a charm!
                      Thanks a LOT for your great work.

                      For future releases (if I interpret the above thread and Sam’s (@sdetweil 's) hints and advices correctly) you can edit the “README.md” file locally in your directory.
                      There you can include your own input/changes and own hints for installing (e.g. correct the git clone-link) - and AFTER these changes in documentation do the git push-thing …

                      Thank you very much for your effort!

                      Warmest regards,
                      Ralf

                      1 Reply Last reply Reply Quote 0
                      • R Offline
                        rkorell Module Developer @xIExodusIx
                        last edited by rkorell

                        @xIExodusIx
                        Short additional information (may useful for others who would like to use Carsten’s modification):
                        If one already have “MMM-FRITZ-Box-Callmonitor-py3” installed and up-and-running:
                        In this special case a git pull “git clone https://github.com/xIExodusIx/MMM-FRITZ-Box-Callmonitor-py3.git” will not work - because the target directory $HOME/MagicMirror/modules/MMM-FRITZ-Box-Callmonitor-py3 already exists!

                        So it is neccessary to put the existing direcotry away.
                        You can do this simply with “rm -rf MMM-FRITZ-Box-Callmonitor-py3”.
                        Because I’m a friend of “security” I had decided to simply rename the old directory to keep it for recovering purposes if something bad happens…
                        “mv MMM-FRITZ-Box-Callmonitor-py3 MMM-FRITZ-Box-Callmonitor-py3.old” will do the trick.

                        (both commands are valid if you are in the $HOME/MagicMirror/modules directory …)

                        Regards,
                        Ralf

                        X M 2 Replies Last reply Reply Quote 0
                        • X Offline
                          xIExodusIx @rkorell
                          last edited by

                          @rkorell

                          Hi Ralf,
                          I’m glad to read this, I thoght it could only work for me.

                          I will try to do what you said and edit the READ.ME file to put my changes in to it. I’m sadly could not code, what I did was only compare the different versions and merge the differences in a, for me, logical way together, and surprisingly, it worked.

                          I personally own a FritzBox 7590AX that distinguishes between 4 types of calls, “incomming, outgoing, missed and blocked”. I would like to have the “blocked” calls also been handled and showed up in the module “MMM-FRITZ-Box-Callmonitor-py3” but I don’t know how to do this. I want these blocked calls handled by the module, because I have a large blocklist of callers that I don’t want to get in touch with. They try to cheat me for mony or peronal data. I got up to 15 calls a day of these unwanted calls.

                          Do you have any Ideas?

                          Regards
                          Carsten

                          R 1 Reply Last reply Reply Quote 0
                          • R Offline
                            rkorell Module Developer @xIExodusIx
                            last edited by rkorell

                            @xIExodusIx Dear Carsten,

                            I’m not that good in object-oriented programming…
                            The main problem for me in this module is the three-layer approach - so I’m not sure what happens when and where.
                            In addition I’m not familiar with the used libraries…

                            From my understanding the base layer “fritz_access.py” should handle your request.
                            In this python program you can find the class FritzAccess which handles the queries to AVM Fritzbox.
                            One of the calls used is “GetCallList” - in the second definition of the object:

                                def download_recent_calls(self, directory = "data"):
                                    result = self.fc.call_action("X_AVM-DE_OnTel", "GetCallList")
                                    filename = os.path.join(directory, "calls.xml")
                                    self.forward_file(result["NewCallListURL"], filename)
                            

                            I can imagine (I don’t know!) that there is another call-function “GetBlockedCallList” or something similar.

                            This has to be clarified.
                            If such a call exists, you need an entry in the FritzAccess class for this and than a function which takes care about.

                            In the second layer “node-helper.js” line 13ff

                            const CALL_TYPE = Object.freeze({
                            	INCOMING: "1",
                            	MISSED: "2",
                            	OUTGOING: "3"
                            })
                            

                            Must be extended for fourth call_type - “BLOCKED”
                            and the function setupMonitor() (line 73ff) must get an additional "monitor.on(“blocked” … "

                            In the third layer (“MMM-FRITZ-Box-Callmonitor-py3.js”) you have to adopt the “socketNotificationReceived:” function (line 90ff) and handle the “BLOCKED” condition.

                            This all from my very basic understanding, how theses modules are impelmented in general.

                            Unfortunately my knowledge is currently not deep enough to be more concrete, sorry for this!

                            May another user can step in here.
                            Because you at least was able to reconfigure code out of three different repositories - may these little hints are enough for you…

                            Warmest regards and good luck!
                            Ralf

                            X 1 Reply Last reply Reply Quote 0
                            • X Offline
                              xIExodusIx @rkorell
                              last edited by

                              @rkorell
                              Hi Ralf,

                              I did not touch the file “fritz_access.py” by now, but what I already did was edeting the files “MMM-FRITZ-Box-Callmonitor-py3.js” and “node-helper.js”.
                              In the file “node-helper.js” I already added:
                              const CALL_TYPE = Object.freeze({
                              INCOMING: “1”,
                              MISSED: “2”,
                              OUTGOING: “3”,
                              BLOCKED: “4”
                              })
                              and tried this (now comented out because it did not work):
                              //Call blocked
                              //monitor.on(“blocked”, function (call) {
                              // var name = self.ownNumbers.includes(call.caller) ? self.getName(call.called) : self.getName(call.caller);
                              // var direction = self.ownNumbers.includes(call.caller) ? “out” : “in”;
                              // self.sendSocketNotification(“blocked”, { “caller”: name, “direction”: direction });
                              //});
                              and this (also now comented out):
                              for (var index in callArray) {
                              var call = callArray[index];
                              var type = call.Type[0];
                              //Try to handle blocked calls this is new from “if to else” delete all lines from “if to else” if it not works!
                              //if var name = type == CALL_TYPE.BLOCKED || type == CALL_TYPE.INCOMING ? self.getName(call.Caller[0]) : self.getName(call.Called[0]);
                              // var duration = call.Duration[0];
                              // if (type == CALL_TYPE.INCOMING && self.config.deviceFilter && self.config.deviceFilter.indexOf(call.Device[0]) > -1) {
                              // continue;
                              //} else
                              //From here the original script is ongoing
                              var name = type == CALL_TYPE.MISSED || type == CALL_TYPE.INCOMING ? self.getName(call.Caller[0]) : self.getName(call.Called[0]);
                              var duration = call.Duration[0];
                              if (type == CALL_TYPE.INCOMING && self.config.deviceFilter && self.config.deviceFilter.indexOf(call.Device[0]) > -1) {
                              continue;
                              }
                              In the file “MMM-FRITZ-Box-Callmonitor-py3” I did already this:
                              const CALL_TYPE = Object.freeze({
                              INCOMING: “1”,
                              MISSED: “2”,
                              OUTGOING: “3”,
                              BLOCKED: “4” //New entry! to handle blocked calls
                              })
                              and tried this:
                              //Handle blocked calls
                              //if (notification === “blocked”) {
                              //Send notification for currentCall module
                              // this.sendNotification(“CALL_BLOCKED”, payload.caller);
                              //Remove alert from UI when call is connected
                              // this.sendNotification(“HIDE_ALERT”);
                              // this.activeAlert = null;
                              //}
                              But that all does not work so I comented it out again.
                              Thats my problem I can’t code and I dont really understand what I’m doing, all I can do is “Try and Error”!

                              But thanks a lot for your help. :-)

                              Carsten

                              R 1 Reply Last reply Reply Quote 0
                              • R Offline
                                rkorell Module Developer @xIExodusIx
                                last edited by rkorell

                                @xIExodusIx Yeahh…
                                You figured out the exact same idea and made more out of this than I’m able to do.
                                But for sure you have to start at the python script - the python script “feeds” node-helper.
                                And if node-helper don’t get info about “blocked” - your If-clause is never true so your new code couldn’t be reached.
                                And for setting the python script correctly you have to identify how the AVM/Fritz interface works…

                                Regards,
                                Ralf

                                X 1 Reply Last reply Reply Quote 0
                                • X Offline
                                  xIExodusIx @rkorell
                                  last edited by

                                  @rkorell

                                  I have almost 2 hours googled for the right name of the function for the blocked calls, but did not find anythig about that.
                                  And I found some smaller errors in the funktion of the module. E.g. it should delete the alert (the big popup on the gui of the MM when a call comes in) when I answer this call. But that does not work.
                                  This should do the job in the "MMM-FRITZ-Box-Callmonitor-py3:
                                  if (notification === “connected”) {
                                  //Send notification for currentCall module
                                  this.sendNotification(“CALL_CONNECTED”, payload);

                                  		//Remove alert only on connect if it is the current alert shown
                                  		if (this.activeAlert === payload) {
                                  			//Remove alert from UI when call is connected
                                  			this.sendNotification("HIDE_ALERT");
                                  			this.activeAlert = null;
                                  		}
                                  	}
                                  

                                  but it dosn’t work.

                                  As I already said: I can’t code :-(

                                  Regards,
                                  Carsten

                                  R 1 Reply Last reply Reply Quote 0
                                  • R Offline
                                    rkorell Module Developer @xIExodusIx
                                    last edited by

                                    @xIExodusIx Yes, I identified this “bug” as well and couldn’t find the mistake…
                                    As I mentioned - I couldn’t code (this) as well …

                                    Regards,
                                    Ralf

                                    X 1 Reply Last reply Reply Quote 0
                                    • X Offline
                                      xIExodusIx @rkorell
                                      last edited by

                                      @rkorell

                                      I think it is something with the syntax, maybe it has changed somehow in python3, or a wrong set “,” or “;” so the modulescript could not run correct, but it is enough to let the module almost run as expected.
                                      For that I have not enough experience to figure that out.

                                      Would be nice if there were the possebility of a testing enviroment for MS-Windows, so that I could test the scripts. For editing I could use VS-Code.

                                      R 1 Reply Last reply Reply Quote 0
                                      • R Offline
                                        rkorell Module Developer @xIExodusIx
                                        last edited by

                                        @xIExodusIx said in MMM-FRITZ-Box-Callmonitor-py3 and MMM-Callmonitor-Current-Call:

                                        testing enviroment for MS-Windows,

                                        For Python you can use this …

                                        Regards,
                                        Ralf

                                        X 1 Reply Last reply Reply Quote 0
                                        • X Offline
                                          xIExodusIx @rkorell
                                          last edited by

                                          @rkorell

                                          Hi Ralf,
                                          I found out that the correct entry for handle “blocked calls” is “10”, not “4”, I found that on “https://fritzconnection.readthedocs.io/en/1.14.0/sources/library_modules.html”
                                          Slowly I understand how the module works and what the entire entries do, but without understandig the syntax and how to code. I will not come further.

                                          Regards
                                          Carsten

                                          R 1 Reply Last reply Reply Quote 1
                                          • R Offline
                                            rkorell Module Developer @xIExodusIx
                                            last edited by

                                            @xIExodusIx
                                            Dear Carsten,

                                            quick question: For several reasons yesterday I had checked the log files during startup of my MagicMirror.

                                            Unfortunately there is an error related to your pimped module:

                                            [ERROR] ERROR! Could not find main module js file for MMM-FRITZ-Box-Callmonitor-py3_drtorchwood
                                            

                                            The module works (!?) but may there is something that don’t work?

                                            Is there a submodule which is not loaded to git?

                                            Thanks for any hint!

                                            X 1 Reply Last reply Reply Quote 0

                                            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                            With your input, this post could be even better 💗

                                            Register Login
                                            • 1
                                            • 2
                                            • 3
                                            • 4
                                            • 2 / 4
                                            • First post
                                              Last post
                                            Enjoying MagicMirror? Please consider a donation!
                                            MagicMirror created by Michael Teeuw.
                                            Forum managed by Sam, technical setup by Karsten.
                                            This forum is using NodeBB as its core | Contributors
                                            Contact | Privacy Policy