Gingerlime

who’s calling? 27 February, 2010

Filed under: Uncategorized — Yoav Aner @ 1:43 am

Caller ID is a wonderful feature. Don’t we love getting a call from someone we like, and perhaps more importantly, ignore those annoying callers who we really don’t want to talk to.

But this is yesterday’s news. We all have caller IDs. It just works. Well, yes. It does. But what if we get a call on our landline? We get the caller ID there too, but do we know who it is?? All our contacts are on our mobile phones. Standard phones don’t usually have the capacity to hold more than 10 names on average. And even if they did. Who’s got the energy to key in those numbers?

Enters Asterisk. Asterisk supports name as well as numbers for caller ID. But how do you get your asterisk to know the name of the caller? How can we inject the caller’s name into the caller ID string sent to our voip phones?

I’ve seen some online posts (like this one) about setting up look-up through online phone directories. I wanted something simpler. Why can’t I have my asterisk know who’s calling, based on my contacts on my iphone address book??

So here’s what I did. It can work on any address book format, as long as you can get it out as a csv (examples for iphone here and here). I created a simple CSV file, with two columns: Name and Number, which looks like this:

“Tony Blair”,07392838482
“Gordon Brown”,07893420393
“Kate Moss”,07393837732

I then created a little python script to run on my asterisk box, and pull the name based on the number. It’s an AGI script, but it’s so basic it doesn’t actually need any AGI libraries:

#!/usr/bin/env python

import sys
import csv

if len(sys.argv) <= 1:    
    exit()
   
cid = sys.argv[1].replace("-","").replace(" ","").strip()

# accepting AGI input (but there’s nothing to do with it)
while 1:
    line = sys.stdin.readline()
    if not line:
        break
    if line=="\n":
        break

fd = file("/usr/share/asterisk/agi-bin/my_iphone_address_book.csv")

print ‘VERBOSE "STATUS: Looking up %s" 2′ % cid
for line in csv.reader(fd):
    # note: comparing the number back-to-front, and only comparing 8 rightmost digits.
    #           This helps dealing with different prefix, e.g. +44, 00, 001 etc. and still getting
    #           an accurate match.
    if line[1].replace("-","").replace(" ","").strip()[::-1][:8] == cid[::-1][:8]:
        print ‘VERBOSE "STATUS: Found %s : %s" 2′ % (cid, line[0].strip())
        print ‘SET VARIABLE CALLERID(name) "%s"’ % line[0].strip()
        exit()
print ‘VERBOSE "STATUS: %s Not Found" 2′ % cid

It can be invoked in the same way as described here, i.e.:

exten => s,n,Gosub(cidname-lookup,s,1)
exten => s,n,dial(${PHONE},30,t)

[cidname-lookup]
exten => s,1,NoOp(looking up callerid name)
exten => s,n,GotoIf($["foo${CALLERID(NAME)}" = "foo" ]?getname)
exten => s,n,GotoIf($["${CALLERID(NAME)}" = "${CALLERID(NUM)}" ]?getname)
exten => s,n,NoOp(caller id name exists as ${CALLERID(NAME)})
exten => s,n,Return
exten => s,n(getname),AGI(calleridname.py,${CALLERID(NUM)})
exten => s,n,NoOp(Caller ID Name is now ${CALLERID(NAME)})
exten => s,n,Return

Note that it’s currently only working with full matches. The caller ID number must match the record on the address book precisely. Let me know if you have any simple ideas for partial matches (e.g. to avoid non matches of numbers, e.g. +447771110006 != 07771110006). I’ll do some more research when I get a chance.

Update: code now deals with partial matches rather effectively.

Another benefit is with voicemails. I started forwarding my voicemail straight to my asterisk box. My mobile provider doesn’t support visual voicemail yet, and I find it frustrating to use the old fashioned voicemail system. Now when I get an email with the voicemail message, I not only see the number of the caller, and can call them back with a click. I also see their name.

del.icio.us:who's calling? digg:who's calling? reddit:who's calling?
 

Get in shape 20 January, 2010

Filed under: Uncategorized — Yoav Aner @ 9:56 pm

ISPs are a strange breed. They’re supposed to give a very straight-forward service – plug me in to the Internet please. That’s all. Plain and simple. It seems like some ISPs have different ideas as to their roles and responsibilities. Traffic shaping is one of those. Port/Service blocking is its ugly cousin. I don’t like either. You’re not my Big Brother. If I wanted one I’d move to China.

(more…)

del.icio.us:Get in shape digg:Get in shape reddit:Get in shape
 

Guilty Pleasures 25 March, 2009

Filed under: Technology — Yoav Aner @ 3:23 pm

Perhaps yet another misleading title for this post, but bear with me. When I was a child we used to play outside a lot. I always remember the neighbours complaining if we made too much noise. Such is life. There was one period of time that I knew I would get in trouble though. We would get told off big time!! When?? Every day between 2 and 4 in the afternoon. There was even a sign in big red letters telling us all to keep quiet at ‘rest time’ (loosely translated). There was no sign about making noise after 11pm, but there was one for the afternoon nap. It was THAT important.

These days seem long gone now. Does anybody have time for an afternoon nap?? I certainly don’t recall seeing any such signs around.
(more…)

del.icio.us:Guilty Pleasures digg:Guilty Pleasures reddit:Guilty Pleasures
 

GoDaddy taking european domains hostage prior to expiration 23 February, 2009

Filed under: Technology — Yoav Aner @ 3:17 am

This is something I never thought would concern me. All those domain ownership issues, I thought, were with people who just aren’t organised enough to renew their domains, forget their passwords, or pick domains that others try to steal.

I’m currently managing a couple of .DE and one .CO.UK domains on Godaddy. The .co.uk domain was bought for a fairly long period, so no problems there, but recently, both the .de domains were up for renewal. I received a couple of email reminders from GoDaddy, but when I logged into my account I noticed they are only due to expire on 26th March. More than a month away. On the last email I received on the 20th, I decided it’s probably time to renew, so clicked on the link and was getting my credit card ready.

To my surprise, the GoDaddy domain portal did not allow me to renew them, and marked them as ‘pending expiration’. hmmm… weird. Oh well, I emailed GoDaddy and asked to renew, not even worrying too much. Maybe a system glitch of some sort.
(more…)

del.icio.us:GoDaddy taking european domains hostage prior to expiration digg:GoDaddy taking european domains hostage prior to expiration reddit:GoDaddy taking european domains hostage prior to expiration
 

Postcode, Barcode and python code 30 January, 2009

Filed under: Technology — Yoav Aner @ 4:22 pm

I’ve had a strange thing happening a while ago. I sent a CD in a padded envelope to someone, and it was returned to me. Well, it didn’t look like it was returned, more like they actually delivered it to me instead of to the person I sent it to.

Then I noticed something. I was re-using an old envelope. For environmental reasons of course (read: being so tight-assed, saving money on padded envelopes). I did write the destination address on the right side, so my address was nowhere on the envelope. What was left there however was this tiny printed barcode used by the previous sender with my address.
(more…)

del.icio.us:Postcode, Barcode and python code digg:Postcode, Barcode and python code reddit:Postcode, Barcode and python code
 

sniffing some fresh tomatoes 3 September, 2008

Filed under: Technology — Yoav Aner @ 10:31 pm

Perhaps the title is a little misleading, but it’s an opportunity to combine two of my greatest loves: food and computers. I suppose even this intro is misleading. Oh. Forget it. Lets get down to business. And this time our business is rather short (and sweet).

Running tcpdump on my Linksys router (well, Buffalo WHR-54GS to be precise, but the same famous WRT54G clone that runs open source firmware).

(more…)

del.icio.us:sniffing some fresh tomatoes digg:sniffing some fresh tomatoes reddit:sniffing some fresh tomatoes
 

cron woes – file timsetamp monitoring plugin for munin 2 July, 2008

Filed under: Uncategorized — Yoav Aner @ 2:53 pm

I don’t like being late. It runs in the family. My dad is so obsessed with being late that he’s always early. How embarrassing. Unfortunately I seemed to have inherited it from him. I do however try to compensate. I am deliberately late on-time. I usually plan to be a bit late.

Anyway, enough about me.
(more…)

del.icio.us:cron woes - file timsetamp monitoring plugin for munin digg:cron woes - file timsetamp monitoring plugin for munin reddit:cron woes - file timsetamp monitoring plugin for munin
 

JDK 5 Debian etch Virtuozzo installation oddities 3 April, 2008

Filed under: Technology — Yoav Aner @ 3:42 pm

Not a particularly interesting post, unless you happen to be running Debian 4.0 etch running on Virtuozzo host and are trying to install JDK5. I saw a post with a user reporting the same error on the parallels forum , but couldn’t find a clear solution, until I bumped onto a weird forum in German, which luckily linked to a related bug report (in English).
(more…)

del.icio.us:JDK 5 Debian etch Virtuozzo installation oddities digg:JDK 5 Debian etch Virtuozzo installation oddities reddit:JDK 5 Debian etch Virtuozzo installation oddities
 

Nico on jcom radio 5 November, 2007

Filed under: Music — Yoav Aner @ 11:13 am

Download the file here

del.icio.us:Nico on jcom radio digg:Nico on jcom radio reddit:Nico on jcom radio
 

Turbogears, Lighttpd and WSGI for real dummies 14 September, 2007

Filed under: Technology — Yoav Aner @ 4:49 pm

Just so to set the records straight, I’m the real dummy here, as you would obviously see.

I absolutely have no experience with python, lighttpd, turbogears or wsgi, fcgi but I was given a task to set it up on a server. All I used was some online posts and common sense. Normally I wouldn’t have to post a blog entry about it, most of the stuff is already out there. On this occasion however, I felt there’s some missing documentation, or else – simply because I don’t know anything about any of these it was more tricky than it usually is. Perhaps it’s one indicator how this all seems from the sysadmin perspective, as opposed to a turbogears developer.
(more…)

del.icio.us:Turbogears, Lighttpd and WSGI for real dummies digg:Turbogears, Lighttpd and WSGI for real dummies reddit:Turbogears, Lighttpd and WSGI for real dummies
 

Windows 2003 split DNS 14 July, 2007

Filed under: Technology — Yoav Aner @ 12:37 pm

[Migrated from tuzig.com]

This is something I thought would be simple. Then I began scratching my head reading all the posts on the web, thinking I might actually need to get a proper book. Finally I realised it was actually quite simple…
(more…)

del.icio.us:Windows 2003 split DNS digg:Windows 2003 split DNS reddit:Windows 2003 split DNS
 

iCal on Mac with Apache on Windows

Filed under: Technology — Yoav Aner @ 12:36 pm

[Migrated from tuzig.com]

I’ve been struggling with getting the iCal app on Mac OS X to use a shared calendar on Apache installed on Windows and using domain authentication (SSPI). It is all supposed to be so simple, yet it didn’t work. Authentication failed with this message:

Access is denied at http://server.com/file.ics with this login and password

When using Safari and accessing the same webDAV url authentication works just fine. I could even download the calendar file from Safari and it would open it in iCal, but for some bizarre reason – neither Subscribing nor publishing worked

I’ll leave out all my trials and errors. Eventually it came down to SSPI authentication not working well with iCal, even with SSPIOfferBasic On and SSPIBasicPreferred On. Only when I added SSPIOfferSSPI Off did it start working…

I’m still slightly confused why no modification is allowed to subscribed calendars in iCal, as it does let you do it in Sunbird, but at least you can publish your own calendar and subscribe to other’s

del.icio.us:iCal on Mac with Apache on Windows digg:iCal on Mac with Apache on Windows reddit:iCal on Mac with Apache on Windows
 

Rsnapshot Server on Windows

Filed under: Technology — Yoav Aner @ 12:36 pm

[Migrated from tuzig.com]

2009 Aug 14 Update: Looks like rsnapshot is now packaged in cygwin! Thanks to pseudo-anonymous coward for the comment! Some of the information below may still be of interest, so it’s left unchanged.

Rsnapshot is a great tool for backing up data, keeping versions and using relatively minimal disk space. From the rsnapshot website:

“rsnapshot is a filesystem snapshot utility for making backups of local and remote systems. (more…)

del.icio.us:Rsnapshot Server on Windows digg:Rsnapshot Server on Windows reddit:Rsnapshot Server on Windows
 

Trac on Windows 10 July, 2007

Filed under: Technology — Yoav Aner @ 8:06 pm

[Migrated from tuzig.com]

As gooli suggested, I should share my experience on installing the development environment. It’s still work in progress, so I will update this post as appropriate. If anybody’s actually trying to follow these steps please note this is quite specific to Tuzig’s setup. Particularly the fact that I was trying to import an already-installed system running on http://www.svn-hosting.com/. However, I hope this may be useful for other people struggling with similar problems I encountered.
(more…)

del.icio.us:Trac on Windows digg:Trac on Windows reddit:Trac on Windows
 

First post 6 May, 2006

Filed under: Uncategorized — yoav @ 3:05 pm

Welcome to the gingerlime blog

del.icio.us:First post digg:First post reddit:First post