Asterisk

Connecting my OS X Address Book

[index] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16]

Playing with the XML Menus

I've never been optimistic that the XML menu capability of these Cisco phones would prove to be valuable. It's a clever thing and I'm sure there are some useful edge cases, but for nearly all imagined uses it's difficult to imagine the phone being handier or more useful than the real computer sitting 8 inches away from most Cisco IP phones.

Still, I've been playing around with the XML since I got the phone. I've got a little services menu with an "order food" directory of places that will deliver to my house. (I can never seem to remember those phone numbers and they don't really deserve a place in my address book.

Inspired by scottstuff's ab2vcard tool, I wrote an OS X Address Book based phone directory for my phone. Scott had already implemented a similar tool but his is written in ruby and didn't behave quite how I wanted, so I just rolled my own in perl. The code is on github of course, if you want it.

Entering a search string The user selects the external directory of the Cisco phone and is prompted to enter a partial string for searching. This will search through a directory of common .vcf card files (exported from OS X Address Book or Outlook) and also through a directory specific to the MAC address of that particular SIP phone.

In this way, you could provide a common company address book but still allow users to add their own semi-private entries as well. A match is made if any word in the contact name (or company name) matches the supplied string. ("pa" matches "Paul Simon" and also "Ru Paul" for example).

I limited the input to only lower-case letters, which seems to simplify the data entry process a lot. It's still a little akward keying in letters using a number pad, but it's passable and even with several hundred contacts, I usually only need two or three letters to get a useful result.

Matching Names If only one contact matches the search string, this step is skipped. Otherwise, the phone will then present a listing of all matching contacts and allow the user to select which contact they intended to look up. Only contacts which have a phone number are included in the results. This saves me from having to manually filter out all the non-phone entries in my address book. (iChat, for instance, loves to create otherwise empty entries with only the AIM account info for a person)

I have had a little difficulty with non-ascii characters at this step. OS X exports vCards as 16 bit unicode if there are foreign characters in the entry. FreeBSD's grep is unable to acommodate this, so it's not possible to search within the file, excluding those vCards from the search results.

Single Record Finally, after step two (or if step one only yielded a single hit) the directory presents the user with all the phone numbers listed for that contact.

If a phone number is flagged in the vCard as "Preferred" then it is promoted to the top of the listing. I am also pulling any custom labels (like the VoIP label shown) if present. The user can then scroll down and select the target number and the phone will dial.

 

Overall I think it's a success

Despite my reservations, I think that this might actually prove to be useful. At least until I rig up a way to do automated dialing from my Powerbook. This actually does turn out to be more convenient than looking up a phone number on my computer and then dialing it by hand on the phone.

I had to do some context-sensitive number forwarding. In a vain grasp at cosmetics, I extended my asterisk dialplan with some ugly, ugly extensions which permit my phone to dial "pretty format" numbers like you see in the photos. This way I can avoid having to strip down the numbers and the display can show them as "+1 NNN NNN-NNNN" which is much more pleasing to the eye. For any number which doesn't match this syntax (there are a few imported records in my address book) the directory code will just strip it down to only digits so that asterisk can dial it without confusion. International country codes, also, are prefixed with "011" if they're spotted.

Possibly my favorite aspect of this directory is that it completely eliminates any pain over dialing people with URI based addressing. It's obviously a total pain in the ass to try to dial "nugget@macnugget.org" into a phone to place a SIP URI call. But with the directory I need only add a "VoIP" phone number in their address book entry and it becomes trivial to call asterisk-to-asterisk.

Next: More resiliant outbound dialing failover

contacts comments