View Full Version : Caller display nearly there!
Hi,
I've installed Max's caller display pluging on Fedora 2 linux. (excellent
instructions). Got the modem installed, caller id & displaying on the sb
from running cid.pl directly. Also in a shell if I call
/sbin/mgetty -x0 -n 2 -s 57600 ttyS1Everything works perfectly, however if
I put T3:23:respawn:/sbin/mgetty -x0 -n 2 -s 57600 ttyS1 in inittab file
then telinit -q the incoming calls are ignored and the debug file is not
updated.Any ideas?regardsWaldyps Great plugin Max, many thanks.
max.spicer
2005-11-20, 12:13
Have a look in /var/log/mgetty/ to see if any of the files in there contain any useful errors. If in doubt, do "ls -ltr" in that directory and look in the file that is listed last (i.e. the last one that was written to). Also try setting -x5 to get more debug info from mgetty.
Max
Hi,
I've installed Max's caller display pluging on Fedora 2 linux. (excellent
instructions). Got the modem installed, caller id & displaying on the sb
from running cid.pl directly. Also in a shell if I call
/sbin/mgetty -x0 -n 2 -s 57600 ttyS1Everything works perfectly, however if
I put T3:23:respawn:/sbin/mgetty -x0 -n 2 -s 57600 ttyS1 in inittab file
then telinit -q the incoming calls are ignored and the debug file is not
updated.Any ideas?regardsWaldyps Great plugin Max, many thanks.
Hi Max,
Doesnt write a log file at all (I've set a the debug level) so I guess its
being ignored in inittab (if I run it in a shell it puts down a debug file.)
Tried moving it up a line removing & adding a line feed at the end but no
joy.
here's the end of inittab
# Run gettys in standard runlevels
1:2345:respawn:/sbin/mingetty tty1
2:2345:respawn:/sbin/mingetty tty2
3:2345:respawn:/sbin/mingetty tty3
4:2345:respawn:/sbin/mingetty tty4
5:2345:respawn:/sbin/mingetty tty5
6:2345:respawn:/sbin/mingetty tty6
# Run xdm in runlevel 5
T3:23:respawn:/sbin/mgetty -x5 -n 2 -s 57600 ttyS1
x:5:respawn:/etc/X11/prefdm -nodaemon
regards
Waldy
malsbury
2005-11-21, 06:25
I put T3:23:respawn:/sbin/mgetty -x0 -n 2 -s 57600 ttyS1 in inittab file then telinit -q the incoming calls are ignored and the debug file is not updated.Waldy,
I think I was having a similar problem when I first was setting up Max great callerid plugin. I was installing it on a CentOS distro which is RedHat based like you Fedora system.
I ended up changing the inittab line a little:
# Put a getty on a modem line to monitor after two rings.
#
S1:2345:respawn:/sbin/mgetty -x0 -n 2 -s 57600 ttyS1You can read my full install instructions/experiences in this post:
http://forums.slimdevices.com/showpost.php?p=63114&postcount=5
--Tom Malsbury
The numbers after T3 (23 in this case) denote in which runlevel you want the mgetty to run. As runlevel 5 is the default one (it launches the login manager xdm on the line just below) mgetty won't get started.
What Tom is suggesting will work because he's asking for mgetty to get started in runlevels 2, 3, 4 and 5.
Regards,
Koen.
max.spicer
2005-11-21, 11:29
Doh! I'd completely forgotten that Redhat uses runlevel 5 for graphical startups. I'll change my docs accordingly.
waldy: Let me know if this sorts you out.
Thanks,
Max
The numbers after T3 (23 in this case) denote in which runlevel you want the mgetty to run. As runlevel 5 is the default one (it launches the login manager xdm on the line just below) mgetty won't get started.
What Tom is suggesting will work because he's asking for mgetty to get started in runlevels 2, 3, 4 and 5.
Regards,
Koen.
Hi Max,
Kinda sorted it out, starts up automatically now (thanks Tom & Koen)
number displays beautifuly on the sb, but alas number unknown. Doesnt seem
to be reading the contacts file. reads it if I call cid.pl directly from
the command line. Seems like it might be a rights thing so given the
contacts file chmod 777, no joy.
cheers
Waldy
Hi Max,
Should have run debug on this earlier (sorry). Think it might be the way
its parsing/ receeiving the incoming number thats giving it a problem
recognising the no.
Here's a trace from cid from the command line & correctly finding the no.
Sending: 00%3A04%3A20%3A05%3Ab5%3A2e display
Incoming%20call:%200208%209938899\
Konrad 120Sent 00%3A04%3A20%3A05%3Ab5%3A2e display
Incoming%20call:%200208%20\
notice %20 character between the incoming call number
Here's the trace with cid auto startup
Incoming%20call:%2007962-403885 Unknown:%2007962-444444 30 to server
Server replied: 00%3A04%3A20%3A05%3Ab5%3A2e display
Incoming%20call%3A%2007962\
-403885 Unknown%3A%2007962-44444 30
nb the hyphen seperating the incoming number & the 30 afterwards
regards
Waldy
max.spicer
2005-11-22, 14:57
Afraid I have no time to look at this right now. Feel free to jog my memory in a week if you haven't heard anything by then!
Max
Hi Max,
Should have run debug on this earlier (sorry). Think it might be the way
its parsing/ receeiving the incoming number thats giving it a problem
recognising the no.
Here's a trace from cid from the command line & correctly finding the no.
Sending: 00%3A04%3A20%3A05%3Ab5%3A2e display
Incoming%20call:%200208%209938899\
Konrad 120Sent 00%3A04%3A20%3A05%3Ab5%3A2e display
Incoming%20call:%200208%20\
notice %20 character between the incoming call number
Here's the trace with cid auto startup
Incoming%20call:%2007962-403885 Unknown:%2007962-444444 30 to server
Server replied: 00%3A04%3A20%3A05%3Ab5%3A2e display
Incoming%20call%3A%2007962\
-403885 Unknown%3A%2007962-44444 30
nb the hyphen seperating the incoming number & the 30 afterwards
regards
Waldy
Max,
First, thanks for the plugin -- now I've read it I see how the display stuff is done, whereas before I had no clue!
Second, there's a small bug on line 140: the 'sendAndReceive' call uses the literal value 30 instead of $displayTime.
Third, I've managed to get NCID (http://ncid.sourceforge.net/) working through your script, with some modifications. The client program (http://ncid.sourceforge.net/ncid/ncid.html) can be set to call any external program when a call comes in, passing date, time, number and name on separate lines of stdin. It can also use an aliases file to match up names to numbers, so that all clients can use the same data.
I modified the script to not take arguments from ARGV, but to read the four lines from stdin. I replaced this:
# Number that's calling
my $number = $ARGV[1];...with this (although I ignore the date/time):
my $incoming_date = <STDIN>; chomp($incoming_date);
my $incoming_time = <STDIN>; chomp($incoming_time);
# Number that's calling
my $number = <STDIN>; chomp($number); $number = uri_escape($number);
if ($debug && $debugLog) {
open(STDOUT, ">>$debugLog");
}
The use of 'uri_escape' was to deal with spaces etc in the data passed in by NCID; it requires the following near the top of the file:
use URI::Escape;
Because I don't use the CSV feature of the script, I removed that whole section:
# Read the phone number csv file
...
$debug && print "Caller: $name\n";...and replaced it with this:
my $name = <STDIN>; chomp($name);
if($name eq "NO NAME") {
$name = "Unknown: $number";
}
$name = uri_escape($name);
$debug && print "Caller: $name\n";
To invoke this, one should first get ncidd (the daemon) running and confirmed working. Then run this:
ncid --no-gui --all --call-prog --program /usr/local/bin/ncid-slim.pl &...where "ncid-slim.pl" is the modified "cid.pl", living in "/usr/local/bin" and given execute permissions. (The trailing ampersand is to make this a background process when launching from a terminal; I don't know what the best way is to launch this automatically, but I think the ampersand is not required then.)
I have this setup running on an old P90 with a cheap ISA modem (which I bought when I saw your original script available!), which also acts as my firewall etc. SlimServer is on a separate box, so of course I modified $serverAddress appropriately (tip there for anyone else who may find it doesn't work initially, as I did)...
max.spicer
2005-12-12, 11:30
Hi,
Sorry for the long delay in responding, and thanks for the fix. What's the advantage in using ncid? What does it do for you?
Cheers,
Max
Max,
First, thanks for the plugin -- now I've read it I see how the display stuff is done, whereas before I had no clue!
Second, there's a small bug on line 140: the 'sendAndReceive' call uses the literal value 30 instead of $displayTime.
Third, I've managed to get NCID (http://ncid.sourceforge.net/) working through your script, with some modifications. The client program (http://ncid.sourceforge.net/ncid/ncid.html) can be set to call any external program when a call comes in, passing date, time, number and name on separate lines of stdin. It can also use an aliases file to match up names to numbers, so that all clients can use the same data.
I modified the script to not take arguments from ARGV, but to read the four lines from stdin. I replaced this:
# Number that's calling
my $number = $ARGV[1];...with this (although I ignore the date/time):
my $incoming_date = <STDIN>; chomp($incoming_date);
my $incoming_time = <STDIN>; chomp($incoming_time);
# Number that's calling
my $number = <STDIN>; chomp($number); $number = uri_escape($number);
if ($debug && $debugLog) {
open(STDOUT, ">>$debugLog");
}
The use of 'uri_escape' was to deal with spaces etc in the data passed in by NCID; it requires the following near the top of the file:
use URI::Escape;
Because I don't use the CSV feature of the script, I removed that whole section:
# Read the phone number csv file
...
$debug && print "Caller: $name\n";...and replaced it with this:
my $name = <STDIN>; chomp($name);
if($name eq "NO NAME") {
$name = "Unknown: $number";
}
$name = uri_escape($name);
$debug && print "Caller: $name\n";
To invoke this, one should first get ncidd (the daemon) running and confirmed working. Then run this:
ncid --no-gui --all --call-prog --program /usr/local/bin/ncid-slim.pl &...where "ncid-slim.pl" is the modified "cid.pl", living in "/usr/local/bin" and given execute permissions. (The trailing ampersand is to make this a background process when launching from a terminal; I don't know what the best way is to launch this automatically, but I think the ampersand is not required then.)
I have this setup running on an old P90 with a cheap ISA modem (which I bought when I saw your original script available!), which also acts as my firewall etc. SlimServer is on a separate box, so of course I modified $serverAddress appropriately (tip there for anyone else who may find it doesn't work initially, as I did)...
max.spicer
2005-12-12, 11:59
I'm afraid that I'm having trouble following your logs. Could you please post the complete log for running it manually and automatically, starting with the line with the date and time, and ending with the blank line? If you're using the forums, please put it within
... blocks.
Where's the hyphen coming from? Is this being sent by the modem, or is it in your address book?
I've uploaded a new version of the plugin that adds a log of receieved calls and also removes all non-numeric characters from numbers before trying to match against them. The latter may fix your problem. If it doesn't I'll need those logs!
Thanks,
Max
Hi Max,
Should have run debug on this earlier (sorry). Think it might be the way
its parsing/ receeiving the incoming number thats giving it a problem
recognising the no.
Here's a trace from cid from the command line & correctly finding the no.
Sending: 00%3A04%3A20%3A05%3Ab5%3A2e display
Incoming%20call:%200208%209938899\
Konrad 120Sent 00%3A04%3A20%3A05%3Ab5%3A2e display
Incoming%20call:%200208%20\
notice %20 character between the incoming call number
Here's the trace with cid auto startup
Incoming%20call:%2007962-403885 Unknown:%2007962-444444 30 to server
Server replied: 00%3A04%3A20%3A05%3Ab5%3A2e display
Incoming%20call%3A%2007962\
-403885 Unknown%3A%2007962-44444 30
nb the hyphen seperating the incoming number & the 30 afterwards
regards
Waldy
max.spicer
2005-12-12, 12:07
I give up! How do you include bbcode in a posting without it being interpreted as bbcode? If it was html, I'd just do <code> etc.
waldy: Please include your logs within bbcode code blocks. For info on bbcode, see the forum help.
Max
Sorry for the long delay in responding, and thanks for the fix. What's the advantage in using ncid? What does it do for you?Its got a client-server architecture which is designed for plugging other clients into: the daemon runs as a server and clients all over the network can register an interest in notification of caller ID. This allows me to run NCIDpop on my Windows laptop, a client app which sits in the notification area and pops up a balloon with name and number whenever there's a call.
(NCID is bundled with example clients for speaking the caller ID over a soundcard, sending a message to a pager and notification through a TiVo, as well as the simple desktop client.)
In other words, I just need the one app listening for caller ID data and different clients can all have access to it.
Another consideration is that I can maintain a single file of aliases for all clients: the NCID daemon reads that file and passes on both the name and number to the clients. (Downside: if I change the aliases file, which involves a syntax I have to get right (no simple CSV here), I have to restart the daemon. Nothing which couldn't be fixed with suitable scripts, of course.)
BTW Max, I really do appreciate you supplying this plugin -- one recent guest, already a fan of my SqueezeBox, was rather taken aback when the phone rang and the display changed!
max.spicer
2005-12-12, 14:59
So you basically want an ncid client for the squeezebox, but are using my plugin until one comes around? I assume ncid is quite capabable of watching the modem itself. Either way, glad you're finding it of use!
Max
Its got a client-server architecture which is designed for plugging other clients into: the daemon runs as a server and clients all over the network can register an interest in notification of caller ID. This allows me to run NCIDpop on my Windows laptop, a client app which sits in the notification area and pops up a balloon with name and number whenever there's a call.
(NCID is bundled with example clients for speaking the caller ID over a soundcard, sending a message to a pager and notification through a TiVo, as well as the simple desktop client.)
In other words, I just need the one app listening for caller ID data and different clients can all have access to it.
Another consideration is that I can maintain a single file of aliases for all clients: the NCID daemon reads that file and passes on both the name and number to the clients. (Downside: if I change the aliases file, which involves a syntax I have to get right (no simple CSV here), I have to restart the daemon. Nothing which couldn't be fixed with suitable scripts, of course.)
BTW Max, I really do appreciate you supplying this plugin -- one recent guest, already a fan of my SqueezeBox, was rather taken aback when the phone rang and the display changed!
So you basically want an ncid client for the squeezebox, but are using my plugin until one comes around? I assume ncid is quite capabable of watching the modem itself. Either way, glad you're finding it of use!Yes indeed -- the ncid daemon does watch the modem (part of the reason I went looking for something like ncid was that I didn't have mgetty on my box, and wasn't able to install it).
I see your plugin as providing two pieces of functionality: getting caller ID info from the modem, and communicating that to the SqueezeBox in an effective way (good display primarily, and pausing and volume lowering if desired). Rather than re-implement those good player-facing ideas, I re-used yours and modified the means of obtaining the caller ID (it's still being pushed from an external process, so the architecture is essentially the same).
BTW, by bigging up ncid I certainly don't mean to belittle your own ingenious mgetty solution -- and on a system which already has mgetty, it's a solution which requires minimal software installation.
Cheers,
Steve
Okay i use cc3.2 slimserver and ncid all on the same box
ncidd runs fine when i try and run the following command NOT IN A TERMINAL i end up with 100% processor usage does any one have any suggestions? if i run it in a termnal it runs fine if i try and run it as a cron job (with options set) i get the same problem (near 100% processor usage) the full command is:-
[root@compaq2 ~]# ncid --no-gui --all --call-prog --program /usr/local/sbin/slim.pl
anyone advise how to run this properly?
I took Max's original script, then most of Steve's suggested changes (since I'm also using ncid), and then finally made a few changes of my own and the whole thing is working perfectly now. I'm also using the yac plug-in for ncid so pop-ups with Caller ID info appear on my Windows laptops when a call comes in.
I think the biggest change I made was to switch from a "display" CLI call to a "show" call, so I could dictate the text size and brightness, too (since I normally have the display dimmed and in the largest text size when the power is off).
I was able to find a Linux-compatible modem with Caller ID capability at PacificGeek.com for $1.99 (plus $8.86 shipping!), in case anyone is looking for such a thing.
Anyway, I just wanted to say thanks to the two of you.
I haven't had Caller ID functionality for a while now, unfortunately -- last year I bought a LinkStation to run SS (and other low-powered home server things), so I retired the (noisy, power-guzzling) old P90 with the modem in. I miss Caller ID!
Anyway, glad my modifications were helpful. Max did all the real work. :)
Powered by vBulletin® Version 4.1.12 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.