Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Create 'calling card' numbers for iPhone contacts iOS devices
I use a another provider for international calls from my mobile: OneTel (although, this hint should work great with others). This service allows me to dial a local number, then, when prompted, enter the international number I wish to connect to and it connects me as usual. This works fine on the iPhone, in that I can use this plan as described. But my previous mobiles allowed me to set-up 'calling cards' which, when turned on, allowed me to dial the international number directly. The phone would then intercept this and dial the local number for me, then enter my destination number. This is, to me, indispensable on a mobile phone, because without it, you have to either memorize the destination number (or write it down again) so you can enter it after the prompt -- a cumbersome task while you're on the go.

Until Apple starts to more properly support calling cards, I improvised by writing an AppleScript which will create 'onetel' versions of the numbers I am interested in. I first created a group in my Address Book called OneTel, and placed within this group all the numbers that I am interested in dialing on my iPhone -- even if they're international.

I then ran the following AppleScript...
set dialerGroup to "OneTel"
set dialerPrefix to "+442070180001pp"
set dialerSufix to "#"
set dialerLabelPrefix to "onetel "
set IDP to "00"
set CC to "44"

to searchReplace(thisText, searchTerm, replacement)
  set AppleScript's text item delimiters to searchTerm
  set thisText to thisText's text items
  set AppleScript's text item delimiters to replacement
  set thisText to "" & thisText
  set AppleScript's text item delimiters to {""}
  return thisText
end searchReplace

tell application "Address Book"
  
  -- Update all the records in the group "OneTel"
  set ThePeople to the people in group "OneTel"
  
  repeat with ThePerson in ThePeople
    
    -- First, we'll clear the old ones
    set PhoneNumbers to the phones of ThePerson
    repeat with ThePhone in PhoneNumbers
      set TheLabel to the label of ThePhone
      if (TheLabel begins with dialerLabelPrefix) then
        -- Effectively delete the old ones
        set the value of ThePhone to ""
      end if
    end repeat
    
    -- OK, make the new ones!
    set PhoneNumbers to the phones of ThePerson
    repeat with ThePhone in PhoneNumbers
      set TheLabel to the label of ThePhone
      if (TheLabel begins with dialerLabelPrefix) then
        -- We can ignore these now...
      else if (TheLabel contains "fax") then
        -- ignore fax numbers
      else
        -- OK, this looks like a good candidate
        set TheNumber to the value of ThePhone as text
        
        if TheNumber begins with (IDP & CC) or TheNumber begins with "+" & CC then
          -- Ignore numbers which are for our local country
        else
          
          if the first character of (TheNumber as text) is "+" then
            set AppleScript's text item delimiters to "+"
            set thisText to TheNumber's text items
            set AppleScript's text item delimiters to IDP
            set TheNumber to "" & thisText
            set AppleScript's text item delimiters to {""}
          end if
          
          set NewNumber to dialerPrefix & TheNumber & dialerSufix
          set NewLabel to dialerLabelPrefix & TheLabel
          
          -- Locate the right phone to update...
          set myPhone to null
          repeat with tmpPhone in PhoneNumbers
            if the label of tmpPhone is NewLabel then
              set myPhone to tmpPhone
            end if
          end repeat
          
          if myPhone is not null then
            set the value of myPhone to NewNumber
          else
            make new phone at the end of phones of ThePerson with properties {label:NewLabel, value:NewNumber}
          end if
        end if
      end if
    end repeat
  end repeat
  
end tell
The above script does the following: For every person in the group OneTel, it checks each number for the person and if it is not a fax number, but contains a number that starts with either + or the international dialling code (you set this) and a country code other than yours, it will create a new phone entry for the person. The number's label is prepended with "onetel " and it includes the full dialing sequence required for the card and phone number.

For example, if a number has the number home as +331234567890, then a number number onetel home with the digits xxxxxxxxxxpp00331234567890 will be created, where xxxxxxxxxx is the local dialing number for OneTel and each p is a two-second pause

I added this script (which I named Add OneTel Numbers) to the ~/Library » Scripts » Applications » Address Book folder, and this now shows up in my AppleScript menu when I'm in Address Book. When I've made some changes to some of the relevant cards, I run this script, then, next time I sync my iPhone, I'm all set. There's lots of room for improvement, but I felt it was good enough to share. Enjoy!
    •    
  • Currently 2.86 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (7 votes cast)
 
[24,238 views]  

Create 'calling card' numbers for iPhone contacts | 9 comments | Create New Account
Click here to return to the 'Create 'calling card' numbers for iPhone contacts' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Only feature that is stopping me from buying an iPhone now!
Authored by: alexmathew on May 23, '08 08:46:16PM

The only thing that stops me from getting an iPhone is not 3g, not the keyboard but the lack of a Calling Card feature. On my SE P900, I can store many different calling cards and their calling sequence (Phone+Pin or pin+phone) and before every call, I can choose to use the Calling Card or not. This saves me hundreds of dollars and enormous amount of time as I call overseas numbers.

This script is a good idea but with my existing 2000+ contacts - I would have over 4000 contacts !! This is very un-Applelike and I'm hoping iPhone 2.0 has this feature. I refuse to buy an iPhone without this feature.




[ Reply to This | # ]
Only feature that is stopping me from buying an iPhone now!
Authored by: vocaro on Jul 29, '08 06:33:29PM
with my existing 2000+ contacts - I would have over 4000 contacts !!

The script does not duplicate contacts; it only adds phone numbers within contacts. So you will have the same number of contacts after running this script.



[ Reply to This | # ]
Only feature that is stopping me from buying an iPhone now!
Authored by: marigoholdings on Nov 16, '08 11:23:00AM
MarigoHoldings has created a native Application for theiPhone that allows you to setup and manage Calling Cards, the 1-1800 numbers, and pins associated with them etc. You can then place a call to any of your contacts using any of the Calling Cards that you set up. This application also allows you to set up favorite contacts, see recent calls made through the application, etc.

Here are more details: http://www.callingcard.marigoholdings.com/

[ Reply to This | # ]
CardCaller - A Calling Card Management Application for the iPhone
Authored by: marigoholdings on Nov 16, '08 12:19:22PM
While you can append 1800 numbers, pauses etc yourself ... it is a better idea to use one of the iPhone calling card applications.

The best one is CardCaller - a native iPhone application for the iPhone that allows you to add, and manage multiple Calling Cards and the 1-800 numbers, PIN, Dial Settings for them. This Application resembles the Phone application in design, and functionality and offers you the ability to manage Favorites, Recents, etc.

Here is more information about this application:
http://www.callingcard.marigoholdings.com/

[ Reply to This | # ]
Alternate version of this script
Authored by: vocaro on Jul 29, '08 06:37:24PM
I've created a variation on this script and posted it to my AppleScript page:

http://vocaro.com/trevor/software/applescript/

It's the one called "Create Calling Card Phone Numbers".

My version is similar to the one shown here, but it's a bit simpler and thus easier to debug and modify. It also doesn't require you to create a special group for the phone numbers. It will operate on all your contacts automatically.

[ Reply to This | # ]
Create 'calling card' numbers for iPhone contacts
Authored by: aamann on Oct 16, '08 09:34:53AM
In order to to have to add additional phone number entries for all your contacts I decided to write a native iPhone calling card application - it also allows for definition of multiple cards and easily switching between them:
Calling Card iPhone application website

[ Reply to This | # ]
Native iPhone Calling Card Applications
Authored by: marigoholdings on Nov 16, '08 12:26:23PM
While you can append 1800 numbers, pauses etc yourself ... it is a better idea to use one of the iPhone calling card applications.

The best one is CardCaller - a native iPhone application for the iPhone that allows you to add, and manage multiple Calling Cards and the 1-800 numbers, PIN, Dial Settings for them. This Application resembles the Phone application in design, and functionality and offers you the ability to manage Favorites, Recents, etc.

Here is more information about this application:
http://www.callingcard.marigoholdings.com/
Ratings Error - Need to create Rating first.


[ Reply to This | # ]
Smart Caller for iPhone integrates calling cards
Authored by: markofjohnson on Dec 04, '08 08:01:09PM
Smart Caller is the new FREE iPhone app that fully integrates calling cards into the iPhone for great rates on international calls. Smart Caller has a zero config option - we set up the calling card for you, so its really easy to get started.

[ Reply to This | # ]
Create 'calling card' numbers for iPhone contacts
Authored by: jane90 on Jun 22, '09 12:56:26PM

You might want to check out IsaDial. It is an app that allow you to store your calling cards and use them to place a call. without modifying the contacts



[ Reply to This | # ]