1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

NO JOY Ready: Asteridex - Outlook sync

Discussion in 'Help' started by jlrichar, Aug 18, 2008.

  1. jlrichar

    jlrichar New Member

    Joined:
    May 5, 2008
    Messages:
    22
    Likes Received:
    0
    A sync between Outlook and Asteridex would be Fantastic. In the business world, and the consumer iphone-with-windows world--outlook is the ONLY contact manager.

    So, since it is practically the standard contact management application it makes sense to be able to sync it with asteridex.

    Of course syncing with asteridex implies updating asteridex so that it can import all the information outlook can export, such as multiple phone numbers, contact photos and IM address--just to name a few, into the same mapped fields in asteridex.

    This would mary the killer application for outlook (contact management) with the killer applications for asteridex (asterisk integration, cnam lookup, etc.)


    Jason
     
  2. wardmundy

    wardmundy Nerd Uno

    Joined:
    Oct 12, 2007
    Messages:
    13,931
    Likes Received:
    2,327
    Get me an export with a few sample records of information, and we'll see what we can do. :wink5:
     
  3. TDF

    TDF New Member

    Joined:
    Jul 16, 2008
    Messages:
    207
    Likes Received:
    0
    Outlook can be set to export as many or as few fields as you want, I've attached one with all and one with just 3 fields, work, home, mobile (expanded fields in other thread ;)).

    Instead of export/import how about a straight import from Outlook to Asteridex.

    I wonder if its worth looking at the MAPI folder in outcall, its open source and imports from outlook, maybe the code in that will be a help.

    http://outcall.googlecode.com/files/outcall-src-1.55.zip
     

    Attached Files:

    • 1.txt
      File size:
      1.5 KB
      Views:
      37
    • 2.txt
      File size:
      187 bytes
      Views:
      18
  4. wardmundy

    wardmundy Nerd Uno

    Joined:
    Oct 12, 2007
    Messages:
    13,931
    Likes Received:
    2,327
    I don't see a Name field in 1.txt, but it's in 2.txt. How does that work??
     
  5. TDF

    TDF New Member

    Joined:
    Jul 16, 2008
    Messages:
    207
    Likes Received:
    0
    Its just the way Outlook can export, either as first, middle and last name or putting them all together in one field.

    Its a relatively simple task to export like that, on the way through the screens it give you the option to choose what fields you want to export, it does involve around 20 mouse clicks though :lol: making a direct import a more desirable option.

    I just had a idea, instead of expanding the database and reworking the index.php to display the 3 phone numbers associated with a name, maybe it would be simpler to import the names and numbers and automagically prefix the name with home, work or cell, making a new entry for each. Not such a eloquent solution but maybe easier.
     
  6. wardmundy

    wardmundy Nerd Uno

    Joined:
    Oct 12, 2007
    Messages:
    13,931
    Likes Received:
    2,327
    Good idea. That would move things along much more quickly. ;)
     
  7. wardmundy

    wardmundy Nerd Uno

    Joined:
    Oct 12, 2007
    Messages:
    13,931
    Likes Received:
    2,327
    TDF: Please upload another file in the 2.txt format with at least 30 or 40 records in it so I can run a good test. Getting closer. Thanks.
     
  8. wardmundy

    wardmundy Nerd Uno

    Joined:
    Oct 12, 2007
    Messages:
    13,931
    Likes Received:
    2,327
    TDF: I got them. Thanks. Actually, the .txt extension was a break because PHP croaks with .csv. So, when we write this up, step B is to rename outlook.csv to outlook.txt before copying it over to your AsteriDex directory.

    If you have a few minutes, write up a simple HOW-TO on preparation of the export to get it into the format of "Name","Home Phone","Business Phone","Mobile Phone". Thanks again.
     
  9. TDF

    TDF New Member

    Joined:
    Jul 16, 2008
    Messages:
    207
    Likes Received:
    0
    I wasn't sure if the order they get exported in is important, if its not then you can remove that bit.
     

    Attached Files:

  10. wardmundy

    wardmundy Nerd Uno

    Joined:
    Oct 12, 2007
    Messages:
    13,931
    Likes Received:
    2,327
    Writeup looks good. Thanks. The order of the fields (for now) must be Name, Home Phone, Business Phone, and Mobile Phone. Also the export needs to be in CSV format as your samples were. Then the file must be renamed and copied to the AsteriDex web directory as outlook.txt. By this weekend, I hope to have a new outlook.php application which also goes in the AsteriDex web folder. Then, using a web browser, you run the outlook.php app. You must have AsteriDex ADMIN privileges to run it. Here is the sample user interface you would get to process the export from Outlook for the following data in the outlook.txt export file. My plan is support a real sync, meaning existing AsteriDex entries would be updated from the new file or new entries would be added where appropriate. If an entry is blank in the CSV file but already exists in the AsteriDex database, it would be deleted. Does this sound about right??

    "Name","Home Phone","Business Phone","Mobile Phone"
    "Dillon, ","01212692777",,"07987362293"
    "Reg Skimper, ","01212626220","1234567","07763626116"
    "Richy Greenwood, ","01242271926",,"07532173127"
    "Rodney Korn, ",,"2345678","07806926727"
    "Steve Willfred, ","01202877779",,"07919861719"
    "Sarah Mate, ","01202656220",,"07775723063"
    "Addy Walkalot, ","01205262127",,"07927576722"
    "Alan Jones, ",,,"07969957906"


    [​IMG]
     
  11. TDF

    TDF New Member

    Joined:
    Jul 16, 2008
    Messages:
    207
    Likes Received:
    0
    I love it.

    The part about renaming it to .txt when saving the export just seemed easier, your average windows box hides the extension for commonly used files, meaning we have to open explorer navigate to show hidden and system files, rename it to .txt then turn the hidden files off again. It seemed easiest to rename it right there, the output is the same just with the right extension.

    Something occurred to me as I'm in the UK I wonder if the terms are the same on a US set up Outlook, I imagine Cell is used in place of Mobile and wonder about the others. Not sure if its important but thought I'd bring it up just in case.

    redid the notes to stress the importance of getting the fields in the right order.
     

    Attached Files:

  12. wardmundy

    wardmundy Nerd Uno

    Joined:
    Oct 12, 2007
    Messages:
    13,931
    Likes Received:
    2,327
    Guinea Pig Alert

    OK. I think we're ready for a few testers.

    WARNING: To be safe, make a backup of your AsteriDex database before you use this!!! Just run phpMyAdmin and do an export of the user1 table in the asteridex database.

    1. Follow the directions above to create your Outlook export.
    2. Rename it to outlook.txt and copy it to /var/www directory
    3. Unzip the attached outlook.zip file into the same directory and then delete outlook.zip.
    4. Run the app with your browser. Click the button at the bottom to sync your Outlook contacts with AsteriDex: http://ipaddress/asteridex4/outlook.php
    5. Review the results using either the AsteriDex interface or phpMyAdmin browse function.


    Let us know how it goes. :wink5:
     

    Attached Files:

  13. TDF

    TDF New Member

    Joined:
    Jul 16, 2008
    Messages:
    207
    Likes Received:
    0
    Ive found a problem but cant see where it is

    along the top of the list of imports in Asteridex it says

    Name Home Phone Business Phone Mobile Phon (should be Mobile Phone)

    at the bottom of the list

    Realign and/or rename the input fields before proceeding with sync operation.

    If I add a extra 'e' to mobile phone in the outlook.txt making phonee it sees it ok, I looked in outlook.php for a spelling mistake but there isnt one.

    I had a little trouble with the import, telling me a error on line x and timing out after 90 seconds and having only imported 11 or so contacts, I cant see anything obvious wrong with my contact list, but I split the list where it had stopped and it imported instantly, as far as I can see my whole list is in there although it took 2 imports to do it. I'll see if I can pinpoint where its stopping, but would be handy if someone else could try.
     
  14. wardmundy

    wardmundy Nerd Uno

    Joined:
    Oct 12, 2007
    Messages:
    13,931
    Likes Received:
    2,327
    In /etc/php.ini, you can bump up the maximum execution time and then restart Apache: apachectl restart

    max_execution_time = 300


    But you shouldn't have to do this without a really HUGE export file... meaning thousands and thousands of records. The performance is really puzzling. I used your sample file with about 30 entries, and it completes on 2 WalMart specials and on an Atom in hundredths of a second. What kind of hardware are you using?

    Please post the entries just before and just after where the file bombs and let me have a look. If you can pinpoint the entry that it's on when it blows up (it should be the last entry on the screen of your browser after you click the sync button), that would be very helpful. Microsoft does some funny stuff in their CSV format, and it may be that there's an entry type that wasn't in your sample data which the application simply doesn't recognize.

    As for the missing "e"... what kind of OS is this? I used the file you sent, and it works fine for me on pure CentOS Linux machines. PBX in a Flash 1.1, 1.2, and 1.3 don't exhibit this behavior, and that covers CentOS 5.0, 5.1, and 5.2. So what's different at your end??

    Is there any incorrect data in the actual table display once you add the missing e?? If not, adding another 'e' wouldn't be much to worry about.

    I noticed you also mentioned a timeout at 90 seconds. I wouldn't swear to is, but I think all PBX in a Flash systems are set to timeout at 30 by default unless Tom has modified this in update fixes (which is certainly possible).
     
  15. TDF

    TDF New Member

    Joined:
    Jul 16, 2008
    Messages:
    207
    Likes Received:
    0
    I tracked the problem down to a entry that had a name with just 2 characters, it just didn't like it, 3 characters is fine.

    Other than that is seems perfect, its importing in the blink of a eye.

    The 'e' though is a puzzler, I have to change "Name","Home Phone","Business Phone","Mobile Phone" to "Name","Home Phone","Business Phone","Mobile Phonee"

    I'm using it on Trixbox 2.6.0.7 brought right up to date with the exception of that re branding malarky.
     
  16. wardmundy

    wardmundy Nerd Uno

    Joined:
    Oct 12, 2007
    Messages:
    13,931
    Likes Received:
    2,327
    Yep. The 2-character name probably sends some of the string manipulation into the ozone. That's good to know, and I'll warn everybody when I write this up.

    We won't hold trixbox against you either. I'll change the string test to accommodate the weirdness. Probably just another trixbox feature that we don't fully understand. :wink5:
     
  17. TDF

    TDF New Member

    Joined:
    Jul 16, 2008
    Messages:
    207
    Likes Received:
    0
    It was only 1 contact 'Me' would you believe, Ive been meaning to change it to my name anyway as 'Me' isnt too usefull to other people if I send them a Vcard or whatever lol.

    The database is happy with it though, I imported it as 'Mee' then edited it back to 'Me'.

    I see you added automatic dial code insertion, I'll have to get the robodialer on the go now.

    The huge bonus for me and anyone else that is in a country where theres no caller id lookup, is using it for internal lookups, now I know if its someone I want to talk to. I just couldn't face entering all my contacts before, now its simple.

    Thanks Ward.
     
  18. wardmundy

    wardmundy Nerd Uno

    Joined:
    Oct 12, 2007
    Messages:
    13,931
    Likes Received:
    2,327
    I've made a few changes in the code above to get rid of the 2-character name problem so you might want to download again and give it a whirl. The problem was in generating a 3-character DialCode which obviously was difficult when there was only a 2-character name. Now you can have a 2-character name. It just won't have a DialCode. Names without a dialcode will show up in red. The complete dialcode list will also display after the sync operation.

    Finally, I've also moved the location to store the export to /var/www which will protect it from snoops.

    In addition to the RoboDialer, there's also a CallWho module which you'll find in this forum. It lets you dial 4-1-2 and key in the first three letters and get a spoken directory of matching entries by phone. Then it'll dial your choice. Our kids use it all the time... and so do I.
     

    Attached Files:

  19. TDF

    TDF New Member

    Joined:
    Jul 16, 2008
    Messages:
    207
    Likes Received:
    0
    I deleted all my entries and started again, worked like a champ.

    CallWho was exactly what I needed so thanks again.

    Now all I need is a couple of buttons on the admin screen for outlook.php and dialcode.php :wink5: I know, Microsoft have ruined me.
     
  20. wardmundy

    wardmundy Nerd Uno

    Joined:
    Oct 12, 2007
    Messages:
    13,931
    Likes Received:
    2,327
    heh heh... Your bill for today comes to $1,000 unless you switch distributions. ;)

    This'll get you started if you're using PBX in a Flash with the new UI3:

    Plug this code into /var/www/html/welcome/.htindex.cfg:

    2,outlook,./asteridex4/outlook.php,AsteriDex Outlook Sync,ico_outlook.png

    Then unzip the attached icon in the same folder.

    [​IMG]

    And Voila...

    [​IMG]
     

    Attached Files:

Share This Page