Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've skimmed google on this but haven't found anything too useful.

Is there a way to use Google Contacts with a HardPhone supported by Asterisk PBX?

Google contacts is exposed thru a MSExchange server


share|improve this question

I saw that you tagged Cisco in our question, so I am guessing you are using Cisco phones, I have only used Cisco phones with Asterisk, so that is all I will be able to cover in my answer.

The first thing you will need to do is add a directory entry to your SIPDefault.cnf file (inside the TFTP directory your phone points to. Here is the line you need to add:

directory_url: "http://yourWebsiteOrIp/directory.xml";

The url must be a web server that is accessible to the phone, not the server. That line can go anywhere in the SIPDefault.cnf file

The file on the server should follow this format:


   <Title>Directory name (will appear in menu)</Title>
   <Prompt>Select a person to call</Prompt>                    

     <Name>My Phone</Name>         


Unfortunately I am not all that experienced with exchange or gmail. What I gan tell you is that you will need to create a cron job that will run a program every x amount of time that will generate this XML file and put it on the server. Every time the phone accesses the directory it will download the XML file.

EDIT: Here is a link that provides a lot of useful information, including a section on creating the XML file with PHP:

Hope that helps some!

share|improve this answer
cool, now all thats left is google contacts to xml. – Scott Cowan Jun 1 '09 at 15:12

This is going to depend on the hardphone in question. Polycom phones will pick up files of a certain name (00000000-directory.xml, I think) from the ftp/tftp/http server that they get their config from. You could conceivably snag the contacts and periodically regenerate that file. This manual has details; see page 4-10 (p64 in the pdf) for details on the 'Local Contact Directory File Format'. Oh, looks like there's a new feature since I last looked: Corporate Directory (p4-34/p88) that is a way to point the phone directly at an LDAP server.

share|improve this answer
so there's directory listings are seperate from asterisk and vendor specific? – Scott Cowan May 6 '09 at 11:12
Yes, because they're accessed directly from the phone, not through asterisk. Asterisk also has a 'dial the first 4 letters of the last name of the person you wish to reach'-style directory suitable for being an option from an auto-attendant, but I didn't think that was what you were asking about. – pjz May 6 '09 at 12:58
that's pretty cool, does asterisk use a similar xml directory for that? – Scott Cowan Jun 1 '09 at 15:11
I think asterisk's only real directory is the users.conf one, which is more like a .ini file than like xml. – pjz Jun 1 '09 at 16:08
  1. Log into Google Contacts and Export your contacts. There's a link in the top-right to do this, and will offer a choice of three formats: Google CSV, Outlook CSV, or vCard. Choose vCard.

  2. When the "Downloads" box pops up with contacts.vcf, right-click and choose "Copy Download Link." It should look something like this:

    http //

  3. Go install the vcardcmxml script.

  4. Feed the output of your Google contacts export to the vcardcmxml script.

  5. Use cron to lather, rinse, repeat for updates to the Contacts list as frequently as necessary.

share|improve this answer
that sounds like the solution – Scott Cowan Aug 11 '09 at 19:15

All VoIP phones that support directory XML can be made to work with arbitrary data. You just have to program that functionality. You can provide the XML data from a database on the fly via some scripting engine running on the server, or just a static XML file generated at some time. Nothing out of the box I'm afraid.

share|improve this answer
thanks, guess I'm going to have to roll my own on this one – Scott Cowan Jun 1 '09 at 15:09

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.