| 1   2   | Next
maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N900 (https://talk.maemo.org/forumdisplay.php?f=44)
-   -   [ANNOUNCE] Caller ID application for N900 (https://talk.maemo.org/showthread.php?t=70738)

ovekaaven 2011-03-06 17:42

[ANNOUNCE] Caller ID application for N900
 
I've just uploaded to extras-devel my package called "callerid", which can automatically look phone numbers up on the web to find who they belong to. It primarily uses XML configuration files to find out which web server to use for any particular country code and area code. Once the name has been looked up, it's displayed as a Hildon banner. (Yes, you need a working Internet connection for this to work. Also note that in many cases, 2G doesn't allow you to use voice and data simultaneously, so if you're using 2G and don't have WiFi, you may be in trouble...)

Added Mar 13: As a fallback, it can show an approximate geographical location based on the phone number itself. For that to work, the program must have information about your country's numbering plan (in the form of a text file, described below).

Currently, you can use it in immediate mode (callerid <number> from a shell) or in daemon mode (callerid --daemon). In daemon mode, it sits and waits for incoming calls, and then looks up the number of the caller. I haven't yet researched a way to make the daemon start on boot. And there's not yet any GUI.

I'd like people to 1) test it and let me know whether it works, 2) create XML files that I can put into future versions so that the program will be able to look up phone numbers in your country.

Configuration instructions: The program looks in /opt/callerid for a regions.xml to find the country, and then in <country>.xml for details. (I have files for two countries there already.) If you need to use different services for different area codes (which probably at least North America will), you can add area codes like this:

<config>
<area code="555" id="west"/>
<area code="666" id="east"/>
<directory id="west">...</directory>
<directory id="east">...</directory>
</config>

Otherwise you can keep it simple:
<config>
<directory>...</directory>
</config>

Tags which can be used inside <directory> are:
<prefix> = remove prefix before lookup (optional)
<query> = HTTP query to make; the phone number, without prefixes, is appended to the end of the URL
<name> = how to find the name in the returned HTML
<address> = how to find the address in the returned HTML
Sub-tags of name and address are:
<find> = find a tag, further processing only works on what's inside this tag. You can use tag="" to find a particular type of tag, and/or you can search on particular attributes, such as class. You can have more than one <find> in sequence if you need to descend into a hierarchy (though maybe there's still work to be done here).
<delete> = once you're inside the tag that has the name in it, you can use this to delete tags for ads etc. Otherwise works same way as <find>

Added Mar 13: Numbering plan file: If the phone numbers in your country is related to where you live, you can create a <country>.txt file (or if your country is very big, <country>_<firstdigit>.txt file) with details about the numbering plan. The file format is a simple tab-delimited file, with the first field being the number prefix (e.g., area code and exchange), and the second field being the location. If several entries match (e.g. both 4578 and 457 would match the number 4578313), then the first match is used.

Once you've created working config files for your country, you could post them so it can be included in future versions. (Perhaps I'll also add new features later, like address display, offline directories, call blocking, and whatnot...)

There are probably bugs (for example, the area code feature has never been tested). If possible, give me the terminal output when things don't work...

Updated Mar 13: Added address tag and numbering plan information

jacktanner 2011-03-06 18:11

Re: [ANNOUNCE] Caller ID application for N900
 
Sounds neat. Could also be fun to run this in batch mode over the call log to see if there are numbers without names and to look them up.

MohammadAG 2011-03-06 18:16

Re: [ANNOUNCE] Caller ID application for N900
 
/etc/event.d/callerid (assuming it's actually in /usr/bin).
Code:

start on started hildon-desktop

respawn

script
  exec su - user -c "exec /usr/bin/callerid --daemon"
end script

Add the file to the deb and make it install to the location I mentioned above.
This way it'll auto start and you can start/stop callerid from terminal

hypoxic 2011-03-06 20:25

Re: [ANNOUNCE] Caller ID application for N900
 
been looking for something like this for a long time, thanks for getting the ball rolling!

i'm curious however on what sort of search site would provide the right kind of response for the US. i've yet to find any lookup sites for american numbers that are straightforward reverse lookups with simple outputs to queries. most seem to be trying to sell their services or are more of a community based response to telemarketing (whocalled.us, etc)

is the program able to pase/scrape webpage outputs?

thanks again!

MeeGoExperts 2011-03-06 20:34

Re: [ANNOUNCE] Caller ID application for N900
 
Sounds good. Will install tomorrow :-)

colm.smyth 2011-03-06 22:44

Re: [ANNOUNCE] Caller ID application for N900
 
I agree this is brilliant, if you can get it to a stage where it can be started/stoped/configured from the top menu on your home screen that would be brilliant

epitaph 2011-03-06 23:13

Re: [ANNOUNCE] Caller ID application for N900
 
Quote:

Originally Posted by MohammadAG (Post 961941)
/etc/event.d/callerid (assuming it's actually in /usr/bin).
Code:

start on started hildon-desktop

respawn

script
  exec su - user -c "exec /usr/bin/callerid --daemon"
end script

Add the file to the deb and make it install to the location I mentioned above.
This way it'll auto start and you can start/stop callerid from terminal

What do respawn mean? Does it mean waiting for a some time because I use a pause command in my startup script?

Saturn 2011-03-06 23:17

Re: [ANNOUNCE] Caller ID application for N900
 
Quote:

Originally Posted by epitaph (Post 962077)
What do respawn mean? Does it mean waiting for a some time because I use a pause command in my startup script?

In short, the process will be restarted whenever it terminates.

mga 2011-03-07 16:22

Re: [ANNOUNCE] Caller ID application for N900
 
Great job @ovekaaven!

Here the ch.xml for switzerland:

Code:

<config>
  <directory>
    <query>http://tel.search.ch/?tel=</query>
    <name>
      <find class="fn"/>
    </name>
  </directory>
</config>

best regards,
Martin

worrior 2011-03-07 19:01

Re: [ANNOUNCE] Caller ID application for N900
 
Does this app use any directories to locate the numbers or it just searching the Web like google search?

ceroberts75 2011-03-07 19:29

Re: [ANNOUNCE] Caller ID application for N900
 
i used privus mobile for my e90 here in the usa.


not sure how they got the caller info, but it worked without fail!

if someone knows how to open that software, maybe they can see what they were using.

here is where i got it.

http://www.privusmobile.com/mobile-caller-id.html

edit: sorry, i poste the wrong link first time.

cutehunk04 2011-03-08 15:13

Re: [ANNOUNCE] Caller ID application for N900
 
i hav installed it...but dunno how it works...:( am from india..does this caller id shows result in india...??

ejasmudar 2011-03-08 17:13

Re: [ANNOUNCE] Caller ID application for N900
 
Hmm, this can be used for another application. One of my requirement/dream was to have the 'note' field of the contact be shown when the contact calls.
This app can probably be adapted to read the notes data and show it as a banner. Anybody?

tuncy 2011-03-10 08:30

Re: [ANNOUNCE] Caller ID application for N900
 
Quote:

Originally Posted by mga (Post 962574)
Great job @ovekaaven!

Here the ch.xml for switzerland:

Code:

<config>
  <directory>
    <query>http://tel.search.ch/?tel=</query>
    <name>
      <find class="fn"/>
    </name>
  </directory>
</config>

best regards,
Martin

What should I do to the address customer?

<config>
<directory>
<query>http://tel.search.ch/?tel=</query>
<name>
<find class="fn"/>
</name>
<adr>
<find class="adrgroup street-address">
</adr>
</directory>
</config>

so, it doesn't do you have me a tip

AgentZ 2011-03-12 00:33

Re: [ANNOUNCE] Caller ID application for N900
 
So this would be similar to a service called Flytrap or Beartrap, but we need to find a services that has the database to get the info from is that correct?
Would tnid.org be of any use, it give location and provider info, but not name of caller.

ovekaaven 2011-03-12 13:45

Re: [ANNOUNCE] Caller ID application for N900
 
Quote:

Originally Posted by MohammadAG (Post 961941)
Add the file to the deb and make it install to the location I mentioned above.
This way it'll auto start and you can start/stop callerid from terminal

Yes, using upstart was an option I considered, but I'm not sure whether connecting to X (in order to show user interface) would be possible that way (i.e., is it possible that upstart starts my stuff before it starts the X server?).

Certainly on a desktop computer doing this would be an extremely bad idea (it should run from the X init stuff instead, i.e. started along with your desktop environment), but whether it's OK on the N900, I don't know yet.

ovekaaven 2011-03-12 13:57

Re: [ANNOUNCE] Caller ID application for N900
 
Quote:

Originally Posted by tuncy (Post 964692)
What should I do to the address customer

It's not supported yet, although I've been considering adding it at some point. If you want to add it to the config now, I'd suggest <address>, but it'll just be ignored by the code, until I've finally implemented support for showing addresses.

But it's not at the top of my list, I have more important stuff to add first, and I don't have much spare time to do it. I have to work a lot to be able to pay my bills, and stuff...

ovekaaven 2011-03-12 14:29

Re: [ANNOUNCE] Caller ID application for N900
 
Quote:

Originally Posted by AgentZ (Post 966135)
So this would be similar to a service called Flytrap or Beartrap, but we need to find a services that has the database to get the info from is that correct?

I'm not familiar with those, do you have links to what they can do?

My program cannot currently unmask hidden numbers (I wouldn't know how, and Nokia's cellular modem stuff is quite closed and locked down anyway), though I wouldn't say no to seeing technical details about how to do so.

Yes, it's correct that someone needs to find some service that can do a reverse directory lookup online, but if that person shares their config file, everyone else should be able to use it, I'll happily drop them into future versions of the program.

Quote:

Originally Posted by AgentZ (Post 966135)
Would tnid.org be of any use, it give location and provider info, but not name of caller.

It apparently just does a numbering plan lookup, not an actual directory lookup. The numbering plan could probably be stored in the program's own XML files if such information is of interest. For example, the us_ca.xml might contain things like

<area code="202" id="dc">Washington DC</area>
...
<area code="613203" id="on">Ottawa, ON</area>
<area code="613204" id="on">Ottawa, ON</area>
<area code="613205" id="on">Smiths Falls, ON</area>
...
<area code="684" id="as">American Samoa</area>
...
<area code="815500" id="il">Chicago, IL</area>
<area code="815501" id="il">Dekalb, IL</area>

This kind of lookup could then always be done by the program even if you do not have an Internet connection. (No, I haven't implemented this yet, but it could be done if people want it.)

Update: I've decided that such a database would be too massive to put into the main XML like this, since the program would keep the whole thing in RAM permanently. For city lookup I'll probably add a separate file, probably plaintext (not XML) for now.

khuong 2011-03-12 15:06

Re: [ANNOUNCE] Caller ID application for N900
 
a local stored area code directory db for usa and perhaps worldwide would be more ideal and much faster response for this type of app than pulling from internet.

mga 2011-03-13 15:28

Re: [ANNOUNCE] Caller ID application for N900
 
Quote:

Originally Posted by tuncy (Post 964692)
What should I do to the address customer?

<config>
<directory>
<query>http://tel.search.ch/?tel=</query>
<name>
<find class="fn"/>
</name>
<adr>
<find class="adrgroup street-address">
</adr>
</directory>
</config>

so, it doesn't do you have me a tip

how about:
Code:

<config>
<directory>
<query>http://tel.search.ch/?tel=</query>
<name>
<find class="fn"/>
</name>
<adr>
<find class="adrgroup">
</adr>
</directory>
</config>

how can i test adress results with 'callerid'? Is it made to search for adresses at all? or just for Name of caller?

n900-dk 2011-03-13 15:35

Re: [ANNOUNCE] Caller ID application for N900
 
Quote:

Originally Posted by ovekaaven (Post 961925)
Once you've created a working XML file for your country, you could post it so it can be included in future versions.

Here is the content of a working XML file (dk.xml) for Denmark:
Code:

<config>
  <directory>
    <query>http://www.krak.dk/person/resultat/</query>
    <name>
      <find class="fn n"/>
    </name>
  </directory>
</config>


AgentZ 2011-03-13 17:21

Re: [ANNOUNCE] Caller ID application for N900
 
This is what I was thinking of www.trapcall.com they have 2 services one is free service Flytrap an the other is a paid service Beartrap; but they actually reveal blocked id's, which if you could build that into your would be Awesome!!!

ovekaaven 2011-03-13 18:27

Re: [ANNOUNCE] Caller ID application for N900
 
Quote:

Originally Posted by AgentZ (Post 966933)
This is what I was thinking of www.trapcall.com they have 2 services one is free service Flytrap an the other is a paid service Beartrap; but they actually reveal blocked id's, which if you could build that into your would be Awesome!!!

http://news.cnet.com/8301-1035_3-10166455-94.html

It appears they accomplish unmasking not with their program, but by asking you to forward all your calls through their toll-free service, thereby exploiting loopholes in your carrier's policies. Operating such a service would cost money, of course.

So this is not possible with my program (but maybe not necessary either - I'm guessing that if you get a TrapCall subscription and manage to set up call forwarding to it, then the N900, and hence my program, would probably see the unmasked number once it receives the rerouted call, depending on how they do it).

AgentZ 2011-03-13 18:48

Re: [ANNOUNCE] Caller ID application for N900
 
Cool link thanks for that, it's been many years since I used it was a beta tester and I forgot about the conditional calling set up. I always thought it was some database they used to find the number and then redirect the call back to you. Still would be a cool feature if you could add it to your app, without the subsription fees.

Anyone got a good config file for North America:D

This could be a great app keep up the good work.

x61 2011-03-13 19:11

Re: [ANNOUNCE] Caller ID application for N900
 
I installed this but still don't know how it works. I received calls but nothing showed up besides the number of the caller or the number of the caller. Nothing new. I am doing something wrong?

AgentZ 2011-03-13 20:33

Re: [ANNOUNCE] Caller ID application for N900
 
What XML file are you using?

x61 2011-03-13 22:31

Re: [ANNOUNCE] Caller ID application for N900
 
Quote:

Originally Posted by AgentZ (Post 967021)
What XML file are you using?

I live in the USA so I guess there is no need for me to modify any xml file. Is that correct? Do we have add an xml file for each and every country codes, states codes and county codes?

ovekaaven 2011-03-13 22:50

Re: [ANNOUNCE] Caller ID application for N900
 
I've just uploaded callerid 0.3 to extras-devel, with some new features.

* Now able to show addresses, if you use <address>.
* Added numbering plan database for North America. If anyone in USA or Canada calls you, you'll know in what city they live. (Nobody has yet provided a directory config file for North America, though, so you still won't know their name and street address...)
* Now tries to find the phone number in the N900's own addressbook first. If it's there, don't bother showing the caller's identity, since the phone's own call dialog would be good enough. However, if there's a note in the contact, show that instead (suggested by ejasmudar)

I've edited my original post to explain how to add address and numbering plan support for your country.

ovekaaven 2011-03-14 00:00

Re: [ANNOUNCE] Caller ID application for N900
 
Quote:

Originally Posted by x61 (Post 967108)
I live in the USA so I guess there is no need for me to modify any xml file. Is that correct? Do we have add an xml file for each and every country codes, states codes and county codes?

Someone needs to create an xml file. Whether volunteers have to create a separate config for every state, or if it's possible to get away with a single config for the whole country, is something only the Americans themselves would know, I wouldn't know.

But as I've said before, it only takes one volunteer to create something that might work for every other American. Similarly for all other countries.

Also, in response to your other question: Though I generally don't answer questions that people could answer themselves by actually reading my first post, I'll repeat here that the program does not yet start automatically. Once it's installed, you must either come up with something to autostart it in the background (like how MohammadAG suggested), or just do it the way I recommend for testing: go to a terminal, type "callerid --daemon", and keep that terminal window open forever. The terminal will then show errors and diagnostic output when someone calls, kind of like a log.

I'll add something to autostart the program in the background once I'm sure the program is stable enough, and that the diagnostic output isn't needed anymore.

tuncy 2011-03-14 00:12

Re: [ANNOUNCE] Caller ID application for N900
 
this ist the code from Switzerland ch.xml for Caller Name and Adress

PHP Code:

<config>
<
directory>
<
query>http://tel.search.ch/?tel=</query>
<name>
<
find class="fn"/>
</
name>
<
address>
<
find class="adr"/>
</
address>
</
directory>
</
config


n900-dk 2011-03-14 07:24

Re: [ANNOUNCE] Caller ID application for N900
 
Code for Denmark dk.xml for Caller Name and Adress:

Code:

<config>
  <directory>
    <query>http://www.krak.dk/person/resultat/</query>
    <name>
      <find class="fn n"/>
    </name>
    <address>
      <find class="adr"/>
      <delete class="geo"/>
    </address>
  </directory>
</config>


n900-dk 2011-03-14 16:28

Re: [ANNOUNCE] Caller ID application for N900
 
After last update, I always get this error, when I try 'callerid +4588888888' from commandline:

"Could not open system addressbook"

And when I receive a call, the yellow popup message with name/adr, doesn't go away.

ovekaaven 2011-03-14 16:49

Re: [ANNOUNCE] Caller ID application for N900
 
Quote:

Originally Posted by n900-dk (Post 967593)
After last update, I always get this error, when I try 'callerid +4588888888' from commandline:

"Could not open system addressbook"

Hm. Strange, works for me. You run it from the xterm, right? (Oh, and you must not run as root.) Does it help to use run-standalone.sh, like "run-standalone.sh callerid +45..."?

Quote:

Originally Posted by n900-dk (Post 967593)
And when I receive a call, the yellow popup message with name/adr, doesn't go away.

It staying up is intentional, since I wouldn't want the banner to disappear while fumbling to get the phone out of my pocket or whatever. Even if the caller hangs up, I want it to stay up so I can read it afterwards.

So, like with many other Hildon questions, you must tap on it or above it to make it go away. I've considered adding a dbus listener so it would go away on its own if you click answer or reject, but don't know when that'll happen.

n900-dk 2011-03-14 17:03

Re: [ANNOUNCE] Caller ID application for N900
 
Quote:

Originally Posted by ovekaaven (Post 967610)
(Oh, and you must not run as root.)

Oh, my bad - did run as root - no problem as normal user!

Thanks for explaining the use of the banner

n900-dk 2011-03-14 17:11

Re: [ANNOUNCE] Caller ID application for N900
 
Would it be possible to make the application use a defined accesspoint for looking up numbers with a predefined pattern?
I would like to use it to look up numbers in intranet database, that can only be accessed by special APN

ejasmudar 2011-03-14 17:22

Re: [ANNOUNCE] Caller ID application for N900
 
First of all, thanks a lot for adding my feature request for notes.

I am trying to create a in.txt file for India. I have a few requests to you:
1. Could you please create a wiki page with more details and examples on creating xml and txt files?

2. Right now, even though I have a in.txt file, When trying the app, I get a Warning, no in.xml file, before showing the result. Is this intentional?

3. Also, if I try to have in_9.txt, in_4.txt, etc without having a in.txt file, the program returns with error "no in.xml file" and exits. but I can see from us_ca files that they have no us_ca.xml or us_ca.txt file and it works without errors. What am I doing wrong?

4th, in the regions.xml file, what is the mcc tag?

Thanks a lot.

ovekaaven 2011-03-14 20:42

Re: [ANNOUNCE] Caller ID application for N900
 
Quote:

Originally Posted by n900-dk (Post 967628)
Would it be possible to make the application use a defined accesspoint for looking up numbers with a predefined pattern?
I would like to use it to look up numbers in intranet database, that can only be accessed by special APN

Hmm. So you'd want it to use a connection you've created with fAPN, then? While it would be possible to ask the N900 to switch Internet connections, I have no idea what would happen if someone tries that with an incoming phone call in progress. It might not work, possibly the N900 would refuse to even try.

And it would not be possible to do this without switching Internet connections, because Fremantle can only use one APN at a time. (That's the reason MMS is such a pain on the N900.) From what I understand, this is not possible to fix on the old Linux kernel used in Fremantle (and upgrading to a newer Linux kernel is difficult because of Nokia's closed-source stuff). So you'd be forcibly disconnected from the Internet whenever someone calls.

But I suppose I could keep the idea in mind.

EDIT: There'll probably be a different solution, though. I do plan to add a possibility of searching on-device text files before going online. Hence, you'd simply download your intranet database into a text file, copy it to the N900, and hey presto, my program could look in that file to find out who's calling. Soon, I hope...

ovekaaven 2011-03-14 21:03

Re: [ANNOUNCE] Caller ID application for N900
 
Quote:

Originally Posted by ejasmudar (Post 967634)
1. Could you please create a wiki page with more details and examples on creating xml and txt files?

Perhaps. Where should it be?

(The existing xml and txt files are the examples, though...)

Quote:

Originally Posted by ejasmudar (Post 967634)
2. Right now, even though I have a in.txt file, When trying the app, I get a Warning, no in.xml file, before showing the result. Is this intentional?

Yes, if you haven't created an .xml file, then this is normal. The program wants to try a directory lookup first, and will use the .txt only if that fails. Since it can't do a lookup if the .xml file does not exist, that means it will fall back to the .txt instead. Essentially, it's just telling you why it can't look up the caller name, you can ignore the warning if you like.

Quote:

Originally Posted by ejasmudar (Post 967634)
3. Also, if I try to have in_9.txt, in_4.txt, etc without having a in.txt file, the program returns with error "no in.xml file" and exits. but I can see from us_ca files that they have no us_ca.xml or us_ca.txt file and it works without errors. What am I doing wrong?

I'm not sure what you mean. The "no in.xml file" is a warning, not an error, and since it complains about the .xml file, not the .txt file, the message should appear regardless of what you do with the .txt files. And the warning currently also appears if you try to look up a North American number, so that does not "work without errors" either, but it does work.

Quote:

Originally Posted by ejasmudar (Post 967634)
4th, in the regions.xml file, what is the mcc tag?

Mobile Country Code. It's used to find out what country the phone is roaming in. You don't need to change it, I pulled a complete list from wikipedia when I created regions.xml.

cutehunk04 2011-03-14 21:08

Re: [ANNOUNCE] Caller ID application for N900
 
not workin for me...

ejasmudar 2011-03-15 07:24

Re: [ANNOUNCE] Caller ID application for N900
 
1 Attachment(s)
Quote:

Originally Posted by ovekaaven (Post 967774)
Perhaps. Where should it be?

(The existing xml and txt files are the examples, though...)


Yes, if you haven't created an .xml file, then this is normal. The program wants to try a directory lookup first, and will use the .txt only if that fails. Since it can't do a lookup if the .xml file does not exist, that means it will fall back to the .txt instead. Essentially, it's just telling you why it can't look up the caller name, you can ignore the warning if you like.

understood.

Quote:

Originally Posted by ovekaaven (Post 967774)
I'm not sure what you mean. The "no in.xml file" is a warning, not an error, and since it complains about the .xml file, not the .txt file, the message should appear regardless of what you do with the .txt files. And the warning currently also appears if you try to look up a North American number, so that does not "work without errors" either, but it does work.

You are right. I got it working now.

I am uploading the txt files for landline numbers in India. I'll add mobile numbers and some landline online lookups later on. Mobile is a problem, especially with the current number portability system implemented all over India.

BTW we have some lookup servers but it works only for particular regions. So how do I make xml file for that? in_4.xml?


EDIT: uploaded complete in.txt fies including mobile numbers. I still need an answer about the lookup

EDIT2: Cleared errors with Arunachal/Andra


| 1   2   | Next
All times are GMT. The time now is 08:01.

vBulletin® Version 3.8.8