• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
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.

Reverse Lookup MMM-FRITZ-Box-Callmonitor - help needed

Scheduled Pinned Locked Moved Development
16 Posts 4 Posters 6.3k Views 3 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.
  • A Offline
    AxLed Module Developer
    last edited by Mar 1, 2018, 12:27 PM

    I almost made it, for debugging i went this way (as i dont know any better so far):

    • Clientside: Browser with debugging feature
    • Serverside (like node_helper.js): console.log on every important location in the code

    My workaround (so far):
    I cloned the function getName to getName2 and use Reverselookup of phonenumbers only in getName2.
    I changed the call of getName to getName2 in following places:
    Line 80-98:

    //Incoming call
    		monitor.on("inbound", function(call) {
    			//If caller is not empty
    			if (call.caller != "") {
    				self.sendSocketNotification("call", self.getName2(call.caller));
    			};
    		});
    
    		//Call accepted
    		monitor.on("connected", function(call) {
    			self.sendSocketNotification("connected", self.getName2(call.caller));
    		});
    
    		//Caller disconnected
    		monitor.on("disconnected", function(call) {
    			//send clear command to interface
    			self.sendSocketNotification("disconnected", {"caller": self.getName2(call.caller), "duration": call.duration});
    		});
    console.log(this.name + " is waiting for incoming calls.");
    

    Reasons why i did this workaround: loadCallList
    This function is called initialy, when you start MM and everytime you get a call. I dont understand, why loadCallList goes through all calls from the fritzbox journal in the past (infinitely), no matter what configuration options of the module you choosed. This gives me an "Socket hang up" error on reverse lookup after 100 requests. Now you know why i did this workaround.

    Regards

    AxLED

    1 Reply Last reply Reply Quote 0
    • B Offline
      barnosch
      last edited by Mar 1, 2018, 2:11 PM

      cool feature, i will definitely upgrade to that version, if it is running well
      thumbsup
      and now the but…
      is this really necessary these days?
      I don’t know any of my friends or our generation who really publicate their phonenumber in the public phonebook.
      Mobile numbers especially not.
      So it is only helpful for bigger companies, right?

      Y 1 Reply Last reply Mar 1, 2018, 2:26 PM Reply Quote 0
      • Y Offline
        yawns Moderator @barnosch
        last edited by Mar 1, 2018, 2:26 PM

        @barnosch
        Not necessarily. Even smaller companies (those without one base number and dozens of extensions) do add their phone number to public phonebooks. My phone solution does use online lookup and lots of craftspeople who called during our house building phase where identified on the phone showing “Dachdecker Hildebrandt” (for example).

        1 Reply Last reply Reply Quote 1
        • A Offline
          AxLed Module Developer
          last edited by Mar 4, 2018, 5:42 PM

          @pinsdorf
          i created a fork, i am not sure if i did everything right (i checked some readme before and keeped on that), details see: https://github.com/Ax-LED/MMM-FRITZ-Box-Callmonitor/pull/1/files

          There is also a working beta of the reverse lookup feature.

          I know the code is still quick n dirty.

          AxLED

          1 Reply Last reply Reply Quote 0
          • P Offline
            pinsdorf Module Developer
            last edited by Mar 8, 2018, 8:34 PM

            Hey @AxLed, sorry for the late reply. I’ve had a look at your code. It looks very good. Well done, man! Functionality is there. Certainly, you can do some cleanup as you say, but that is secondary. It is great that you have extended this module with such nice magic.

            One suggestion I made earlier is putting the lookup at the online phone book (dasoertliche.de) & parsing into its own module. This would allow others to write phonebook lookup modules for their own country. I’m happy to do this change on your code base.

            You did all the (sometimes confusing) Git stuff right: you forked from the original repository, checked out your repository, made changes, committed and pushed them back into your repository. There was just one step too much, which is the pull request. You typically make a pull request in the person’s repository that you have forked from to tell the original author ‘hey, here is cool new stuff that you may want to have in the original repository’. I would suggest that you accept or remove your own pull request.

            If you want me to extract a module for the phonebook lookup & parsing, I can work on the latest version of your repository and either push directly to your repo (if you grant me write access) or I send my own pull request to you.

            1 Reply Last reply Reply Quote 0
            • A Offline
              AxLed Module Developer
              last edited by Mar 9, 2018, 6:14 PM

              Hi pinsdorf,

              thanks for your reply, here are some answers to your questions:

              • putting the lookup in a own module.
                => Feel free, you just have to tell me, how i can grant write permissions to you (maybe via PN)
              • i closed my own pull request, as i didnt find any other option

              Maybe you can also help in fixing this issue: https://github.com/paviro/MMM-FRITZ-Box-Callmonitor/issues/30

              Regards

              AxLED

              1 Reply Last reply Reply Quote 0
              • 1
              • 2
              • 2 / 2
              2 / 2
              • First post
                13/16
                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