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

Dial with Vonage from the Address Book Apps
The Address Book has the built-in ability to dial a Bluetooth phone (see this hint). If you subscribe to Vonage, you can have the same functionality for your home phone, too.

Browsing the Vonage Forums, I came across a link to the site https://secure.click2callu.com/, which seems to be a Vonage-sponsored beta test of web-initiated calls. It specifies a URL, including your Vonage username, password and phone number, to set up a phone call from your phone to any other phone in the world. I wrapped that URL into an AppleScript, to create an Address Book plugin. To use it, do the following:
  1. Copy the following script (or download it here) into Script Editor.
  2. Change the first three lines of the script to add your Vonage username, password, and phone number
  3. Save the script to the "Address Book Plug-Ins" folder in the Library folder of your home directory.
Read the rest of the hint for the script and additional instructions...

[robg adds: I haven't tested this one, not having access to Vonage...]

In Address Book, click on a phone text label ("work", "home", "mobile", etc.). In the popup menu that appears, choose "Dial with Vonage." Your phone should ring. When you answer it, your phone will then begin to automatically dial the other party.

Caveats: Obviously, you need to be a Vonage customer to make this work. The script will only work on a Vonage line, although you can call to anyone on any type of line, Vonage or not. The "Click2CallU" web site explains that it is a beta test and may not always be around.
(*
  Automatic Vonage Dialer v0.2
  Aaron Freimark, abf@mac.com
  March 16, 2004
	
  Put this script into your "Address Book Plugins" folder in your ~/Library folder.
  Only works in the US with this version

  *** YOU MUST Modify the first three lines below with your info ***
*)

property myVonageLogin : "yourloginhere"
property myVonagePassword : "yourpasshere"
property myVonageNumber : "17185551212"

-- The lines below are correct for the U.S.
property myCountryCode : "1"
property myLongDistanceCode : "1"
property myIntlAccessCode : "011"


using terms from application "Address Book"
  on action property
    return "phone"
  end action property
  
  on action title for pers with fone
    return "Dial with Vonage"
  end action title
  
  on should enable action for pers with fone
    if label of fone contains "fax" then return false
    return true
  end should enable action
  
  on perform action for pers with fone
    set theNumber to (value of fone) as string
    
    -- Add the long distance or international access code if it's not already there.
    set numToDial to InsertLDCodes(theNumber)
    
    --Uncomment the following two lines to confirm the number
    --display dialog "So you want me to call?" default answer numToDial buttons {"OK"}
    --set numToDial to text returned of the result
    
    --Erase everything that's not a digit from the phone number
    set cleanedNumber to CleanTheNumber(numToDial)
    
    set theURL to "https://secure.click2callu.com/tpcc/makecall?"
    set theURL to theURL & "username=" & myVonageLogin
    set theURL to theURL & "&password=" & myVonagePassword
    set theURL to theURL & "&fromnumber=" & myVonageNumber
    set theURL to theURL & "&tonumber=" & cleanedNumber
    
    -- Use curl to hit the URL and dial the number  
    set errorCode to do shell script "curl \"" & theURL & "\""
    
    --If there was an error, return a message.
    if (characters 1 thru 3 of errorCode) as string is not equal to "000" then
      display dialog "Error: " & errorCode buttons {"OK"}
    end if
    
  end perform action
  
end using terms from


on InsertLDCodes(theNumber)
  
  if (characters 1 thru 2 of theNumber) as string = "+" & myCountryCode then
    -- The number was formatted correctly.
    return theNumber
  end if
  
  if character 1 of theNumber = myLongDistanceCode then
    -- Domestic long distance with LD access code
    return theNumber
  end if
  
  if character 1 of theNumber = "+" then
    --  international number, add prefix
    return myIntlAccessCode & " " & theNumber
  end if
  
  --  local number, must add the LD code for Vonage
  return myLongDistanceCode & " " & theNumber
  
end InsertLDCodes

on CleanTheNumber(numToDial) -- remove punctuation from a string, leaving just the number
  set theDigits to {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"}
  set cleanedNumber to ""
  repeat with i from 1 to length of numToDial
    set j to (character i of numToDial)
    if j is in theDigits then set cleanedNumber to cleanedNumber & j
  end repeat
  return cleanedNumber
end CleanTheNumber
    •    
  • Currently 1.50 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)
 
[47,705 views]  

Dial with Vonage from the Address Book | 31 comments | Create New Account
Click here to return to the 'Dial with Vonage from the Address Book' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Dial with Vonage from the Address Book
Authored by: Slash on Mar 22, '04 02:02:32PM

Works like a champ over here.



[ Reply to This | # ]
Dial with Vonage from the Address Book
Authored by: codebowl on Jul 08, '06 05:01:27PM

Is there a way to do this with Entrourage? Would be VERY handy to have in there. I do not use AddressBook for anything other than a middle man for Entourage and .mac for sync.



[ Reply to This | # ]
Dial with Vonage from the Address Book
Authored by: codebowl on Jul 08, '06 05:03:07PM

Is there a way to do this with Entrourage? Would be VERY handy to have in there. I do not use AddressBook for anything other than a middle man for Entourage and .mac for sync.



[ Reply to This | # ]
Dial with Vonage from the Address Book
Authored by: brandonarbini on Mar 22, '04 02:14:50PM

This is excellent. It's working for me after one small change. But first, I am always skeptical to use something like this, especially when it's asking for my account password. So, I looked up the whois record for the domain and it's registered by Vonage and their nameservers are @vonage.net. It seems to be legit, so I tried it.

All that I needed to change was in the curl url. My password has a $ in it, so I needed to encapsulate the url in single quotes rather than double quotes. Thanks!



[ Reply to This | # ]
Security warning
Authored by: hughescr on Mar 22, '04 03:15:29PM

As has been pointed out, WHOIS does confirm that this site is run by Vonage, so you're probably safe giving it your username/password. However, I'd be very very careful about creating some of the recommended applications that Vonage describes/suggests on that page. While the plugin-type applications are probably generally fairly safe (would be nice to have that applescript use the Keychain instead of hardcoding username/password into it -- I'll hack that up and post change later), I'd very strongly advise against the "add this functionality to your website" type stuff. You can make your site do the URL call at the backend (ie not expose your username/password to site visitors), but it's still not a great idea, unless you want to expose yourself to phone DoS attacks.



[ Reply to This | # ]
Security warning
Authored by: hughescr on Mar 22, '04 03:57:56PM

Bah -- the applescript "Keychain Scripting" helper app doesn't let you actually get keys from the keychain, as far as I can tell. Am I going to have to write a scripting helper just to read a key from the keychain?



[ Reply to This | # ]
Security warning
Authored by: blalor on Dec 09, '04 09:01:31AM
got it:

tell application "Keychain Scripting"
	set theKey to first Internet key of current keychain whose server is "www.vonage.com"
	
	display dialog "userid: " & (account of theKey) & "; password: " & (password of theKey)
end tell
That works for me because I let Safari save my userid and password for the form in the upper-right corner of www.vonage.com. I get prompted twice by the keychain, however.
I've got about 200 keychain entries, and this takes a few seconds to run; not terribly zippy.
You could create a new keychain entry just for this little app, but I like to re-use things when possible.

[ Reply to This | # ]
Dial with Vonage from the Address Book
Authored by: the1truestripes on Mar 22, '04 03:16:02PM

Very nice. You might want to make one small change, convert + in phone numbers to 011 so if you have any international numbers they will come out correctly (hmmm, maybe convert +1 to nothing and any remaining +'s to 011). That way you can leave UK numbers stored as +44 blah-blah and your cell phone will dial them OK, and so will Vonage.

A pity I don't have broadband, I really liked Vonage back when I could use it :-)

[ Reply to This | # ]

Dial with Vonage from the Address Book
Authored by: aaronfreimark on Mar 22, '04 04:11:49PM

Good idea. (It does this already :-)



[ Reply to This | # ]
Dial with Vonage from the Address Book
Authored by: the1truestripes on Mar 23, '04 09:40:07AM

Ack! So it does. Wonderful little script then :-)

[ Reply to This | # ]

Use as a bookmarklet from Safari
Authored by: ppatoray on Mar 22, '04 09:44:33PM

You can also use the code to make a bookmarklet that will ask you for the phone number to dial. Use the following, all on one line, and add it to your bookmarks bar:

javascript:promptMsg='Phone%20Number%20to%20Dial:';actionURL='https://secure.click2callu.com/tpcc/makecall?username=USERNAME&password=PASSWORD&fromnumber=YOURNUMBER8&tonumber=';q=prompt(promptMsg,'');window.open(actionURL+escape(q))

If you want to have the 1 and your area code filled in for you, add it to the 'q=prompt(promptMsg,''), like so:

javascript:promptMsg='Phone%20Number%20to%20Dial:';actionURL='https://secure.click2callu.com/tpcc/makecall?username=USERNAME&password=PASSWORD&fromnumber=YOURNUMBER8&tonumber=';q=prompt(promptMsg,'1503');window.open(actionURL+escape(q))

You can also use the character pallette to pull and use the telephone icon, so it takes up almost no space at all in your menu.



[ Reply to This | # ]
I wish I could dial with a normal land line too
Authored by: greggomer on Mar 23, '04 03:13:36PM

Cool hint... does anyone know if there is anyway to do something similar using a normal land line, or regular phone line.

I've always wanted to be able to use the address book to dial calls from my phone, using address book as a speed dialer. But alas, I only can with my Bluetooth phone, which is great, but the the more options the merrier right.



[ Reply to This | # ]
I wish I could dial with a normal land line too
Authored by: jonn8n on Mar 29, '04 06:50:25PM
More Secure Version
Authored by: aaronfreimark on Apr 12, '04 12:12:34AM

I've made a minor update to the script to make it more secure. It now POSTs the name, password, and telephone parameters to get them out of the unencrypted URL.

Download it here: Dial-with-Vonage-0.3



[ Reply to This | # ]
Dial with Vonage from the Address Book
Authored by: las_vegas on Sep 06, '04 04:28:51PM
Great script! But now than Vonage allow us to dial local numbers w/o the prefix & Area Code, I've made the following changes to the script: Add the following after the other personal properties with your own Area Code:
property myAreaCode : "000"
Replace the code:
	--  local number, must add the LD code for Vonage
	return myLongDistanceCode & " " & theNumber
with:
	-- check for area code other than local missing the prefix - remove area code if local
	if character 1 of theNumber = "(" then
		if (characters 2 thru 4 of theNumber) as string = myAreaCode then
			return (characters 6 thru (length of theNumber) of theNumber) as string
		else
			return myLongDistanceCode & " " & theNumber
		end if
	end if
Now it removes the local area code if present and adds the prefix if needed.

[ Reply to This | # ]
Dial with Vonage from the Address Book
Authored by: RobTech on Sep 30, '04 02:10:23PM

Hi,

I am trying to use the Vonage feature to use the web (and my Apple Address Book) to initiate a call to my vonage line.

I keep getting an error 101 telling me "101:Number you are trying to dial from is invalid"

Below is the string I was using (less the password)

https://secure.click2callu.com/tpcc/makecall?username=Rob_CSS&password=mypassword&fromnumber=14403725653&tonumber=5824658:

I have multiple vonage phone numbers all tied to a single account; could that be the problem?

How do I change the default phone number on a Macintosh, if that is the problem?

Any ideas?

Thanks in advance!

Rob



[ Reply to This | # ]
Dial with Vonage CANADA from the Address Book
Authored by: ahamel on Oct 05, '04 11:15:47AM

Do you have any idea on how to make that script work with a Canadian Vonage account. I'm one of those guys living North of the border who login at Vonage.ca and can't use the script which seems to work only with customers who login at Vonage.com.

Thanks
André



[ Reply to This | # ]
Dial with Vonage CANADA from the Address Book
Authored by: arakune on Mar 21, '05 02:49:20PM

Before the script can be made to work with vonage.ca, vonage.ca has to first offer a similar server :( If you experiment with the URIs that https://secure.click2callu.com/ publishes, you'll find that your vonage.ca username and password won't authenticate.

I've already emailed vonage.ca asking it they'll be introducing a similar service for us. If we can get enough people to ask, maybe they will ^_-



[ Reply to This | # ]
Works, but not in any meaningful way
Authored by: brandondrew on Oct 27, '04 09:17:08PM

I've tried this with my Vonage line and my POTS line, and it works, BUT to make it work I have both on the hook. As soon as I submit the URL (I'm not actually using the AppleScript) my Vonage line rings. (Yes, the line I'm supposed to be calling FROM.) I must pick it up DURING THE RING and then wait for it to call the other phone, or I miss the chance to make the connection. If I have it off the hook before submission, it's no-go. If I pick up after the ring is over, it doesn't work either.

Can someone tell me how this can possibly be useful under these circumstances, OR ELSE how you get it to work in some useful way?

Thanks in advance

---
--
Brandon Z



[ Reply to This | # ]
Dial with Vonage from the Address Book
Authored by: andrewik on Mar 30, '05 08:27:29PM
It would be even better to have the autodialer or Vonage softphone to call the number and play a message. Voicent has done that for regular phone lines or use the voip adaptor. Details can be found at: Voicent Smart Autodialer It would be cool the same functionality can be implemented through softphone. Does anyone know some related sample code or link? Thanks in advance. Andrew

[ Reply to This | # ]
Dial with Vonage from the Address Book
Authored by: pat2man on Apr 01, '05 03:00:20PM
Storing your vonage password and username in an applescript is probably a bad idea, these changes make it use the keychain. They also grab your phone number for you.


(*

 Automatic Vonage Dialer v0.5
 Major Changes by Patrick Tescher, pat2man@comcast.net
 
 Based on:
  Automatic Vonage Dialer v0.2
  Aaron Freimark, abf@mac.com
  March 16, 2004
	
  Put this script into your "Address Book Plugins" folder in your ~/Library folder.
  Only works in the US with this version

*)

property keyName : "Vonage"

-- The lines below are correct for the U.S.
property myCountryCode : "1"
property myLongDistanceCode : "1"
property myIntlAccessCode : "011"


using terms from application "Address Book"
	on action property
		return "phone"
	end action property
	
	on action title for pers with fone
		return "Dial with Vonage"
	end action title
	
	on should enable action for pers with fone
		if label of fone contains "fax" then return false
		return true
	end should enable action
	
	on perform action for pers with fone
		set theKey to GetKeyNamed(keyName)
		
		-- set theKey to myVonageKey
		if theKey is null then
			set theKey to CreateKey(keyName)
		end if
		
		tell application "Keychain Scripting"
			set myVonageLogin to account of theKey
			set myVonagePassword to password of theKey
		end tell
		set NumberList to GetNumbers(myVonageLogin, myVonagePassword)
		if (count of NumberList) is greater than 1 then
			set myVonageNumber to GetDefaultNumber(comment of theKey, NumberList)
			if myVonageNumber is null then
				set myVonageNumber to SelectNumber(NumberList)
			end if
		else
			set myVonageNumber to item 1 of NumberList
		end if
		
		set theNumber to (value of fone) as string
		
		-- Add the long distance or international access code if it's not already there.
		set numToDial to InsertLDCodes(theNumber)
		
		--Uncomment the following two lines to confirm the number
		--display dialog "So you want me to call?" default answer numToDial buttons {"OK"}
		--set numToDial to text returned of the result
		
		--Erase everything that's not a digit from the phone number
		set cleanedNumber to CleanTheNumber(numToDial)
		
		set theURL to "https://secure.click2callu.com/tpcc/makecall?"
		set theURL to theURL & "username=" & myVonageLogin
		set theURL to theURL & "&password=" & myVonagePassword
		set theURL to theURL & "&fromnumber=" & myVonageNumber
		set theURL to theURL & "&tonumber=" & cleanedNumber
		
		
		
		-- Use curl to hit the URL and dial the number  
		--set errorCode to do shell script "curl \"" & theURL & "\""
		display dialog "curl \"" & theURL & "\""
		
		--If there was an error, return a message.
		if (characters 1 thru 3 of errorCode) as string is not equal to "000" then
			display dialog "Error: " & errorCode buttons {"OK"}
		end if
		
	end perform action
	
end using terms from


on InsertLDCodes(theNumber)
	
	if (characters 1 thru 2 of theNumber) as string = "+" & myCountryCode then
		-- The number was formatted correctly.
		return theNumber
	end if
	
	if character 1 of theNumber = myLongDistanceCode then
		-- Domestic long distance with LD access code
		return theNumber
	end if
	
	if character 1 of theNumber = "+" then
		--  international number, add prefix
		return myIntlAccessCode & " " & theNumber
	end if
	
	--  local number, must add the LD code for Vonage
	return myLongDistanceCode & " " & theNumber
	
end InsertLDCodes

on CleanTheNumber(numToDial) -- remove punctuation from a string, leaving just the number
	set theDigits to {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"}
	set cleanedNumber to ""
	repeat with i from 1 to length of numToDial
		set j to (character i of numToDial)
		if j is in theDigits then set cleanedNumber to cleanedNumber & j
	end repeat
	return cleanedNumber
end CleanTheNumber

on GetKeyNamed(keyName)
	
	tell application "Keychain Scripting"
		try
			tell current keychain
				get some generic key whose name is keyName
				return result
			end tell
		on error
			return null
		end try
	end tell
end GetKeyNamed

on CreateKey(keyName)
	tell application "Address Book"
		display dialog "Enter Username" default answer "username" buttons {"OK"} default button "OK"
		set myVonageLogin to text returned of the result
		display dialog "Enter Password" default answer "password" buttons {"OK"} default button "OK"
		set myVonagePassword to text returned of the result
		display dialog "Enter Vonage Number" default answer "15555555555" buttons {"OK"} default button "OK"
		set myVonageNumber to text returned of the result
		(* set VonageNumbers to GetNumbers(myVonageLogin, myVonagePassword)
		if (count of VonageNumbers) is 1 then
			set myVonageNumber to item 1 of VonageNumbers
		else
			set myVonageNumber to null
		end if *)
	end tell
	tell application "Keychain Scripting"
		tell current keychain
			make new generic key with properties ¬
				{name:keyName, account:myVonageLogin, password:myVonagePassword, comment:"Default Number: " & myVonageNumber}
			return result
		end tell
	end tell
end CreateKey

on GetDefaultNumber(comments, VonageNumbers)
	set theNumber to null
	repeat with currentWord in VonageNumbers
		if currentWord is in comments then
			set theNumber to currentWord
		end if
	end repeat
	return theNumber
end GetDefaultNumber

on GetNumbers(login, pass)
	set theURL to "https://secure.click2callu.com/tpcc/getnumbers?"
	set theURL to theURL & "username=" & login
	set theURL to theURL & "&password=" & pass
	set errorCode to do shell script "curl \"" & theURL & "\""
	return words in errorCode
end GetNumbers

on SelectNumber(NumberList)
	tell application "Address Book"
		display dialog "Choose a number" buttons NumberList
		return button returned of result
	end tell
end SelectNumber




[ Reply to This | # ]
Dial with Vonage from the Address Book
Authored by: pat2man on Apr 01, '05 03:08:40PM
Sorry, that code was an old version of what I was working on. Try this:



(*

 Automatic Vonage Dialer v0.5
 Major Changes by Patrick Tescher, pat2man@comcast.net
 
 Based on:
  Automatic Vonage Dialer v0.2
  Aaron Freimark, abf@mac.com
  March 16, 2004
	
  Put this script into your "Address Book Plugins" folder in your ~/Library folder.
  Only works in the US with this version

*)

property keyName : "Vonage"

-- The lines below are correct for the U.S.
property myCountryCode : "1"
property myLongDistanceCode : "1"
property myIntlAccessCode : "011"


using terms from application "Address Book"
	on action property
		return "phone"
	end action property
	
	on action title for pers with fone
		return "Dial with Vonage"
	end action title
	
	on should enable action for pers with fone
		if label of fone contains "fax" then return false
		return true
	end should enable action
	
	on perform action for pers with fone
		set theKey to GetKeyNamed(keyName)
		
		-- set theKey to myVonageKey
		if theKey is null then
			set theKey to CreateKey(keyName)
		end if
		
		tell application "Keychain Scripting"
			set myVonageLogin to account of theKey
			set myVonagePassword to password of theKey
		end tell
		set NumberList to GetNumbers(myVonageLogin, myVonagePassword)
		if (count of NumberList) is greater than 1 then
			set myVonageNumber to GetDefaultNumber(comment of theKey, NumberList)
			if myVonageNumber is null then
				set myVonageNumber to SelectNumber(NumberList)
			end if
		else
			set myVonageNumber to item 1 of NumberList
		end if
		
		set theNumber to (value of fone) as string
		
		-- Add the long distance or international access code if it's not already there.
		set numToDial to InsertLDCodes(theNumber)
		
		--Uncomment the following two lines to confirm the number
		--display dialog "So you want me to call?" default answer numToDial buttons {"OK"}
		--set numToDial to text returned of the result
		
		--Erase everything that's not a digit from the phone number
		set cleanedNumber to CleanTheNumber(numToDial)
		
		set theURL to "https://secure.click2callu.com/tpcc/makecall?"
		set theURL to theURL & "username=" & myVonageLogin
		set theURL to theURL & "&password=" & myVonagePassword
		set theURL to theURL & "&fromnumber=" & myVonageNumber
		set theURL to theURL & "&tonumber=" & cleanedNumber
		
		
		
		-- Use curl to hit the URL and dial the number  
		--set errorCode to do shell script "curl \"" & theURL & "\""
		display dialog "curl \"" & theURL & "\""
		
		--If there was an error, return a message.
		if (characters 1 thru 3 of errorCode) as string is not equal to "000" then
			display dialog "Error: " & errorCode buttons {"OK"}
		end if
		
	end perform action
	
end using terms from


on InsertLDCodes(theNumber)
	
	if (characters 1 thru 2 of theNumber) as string = "+" & myCountryCode then
		-- The number was formatted correctly.
		return theNumber
	end if
	
	if character 1 of theNumber = myLongDistanceCode then
		-- Domestic long distance with LD access code
		return theNumber
	end if
	
	if character 1 of theNumber = "+" then
		--  international number, add prefix
		return myIntlAccessCode & " " & theNumber
	end if
	
	--  local number, must add the LD code for Vonage
	return myLongDistanceCode & " " & theNumber
	
end InsertLDCodes

on CleanTheNumber(numToDial) -- remove punctuation from a string, leaving just the number
	set theDigits to {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"}
	set cleanedNumber to ""
	repeat with i from 1 to length of numToDial
		set j to (character i of numToDial)
		if j is in theDigits then set cleanedNumber to cleanedNumber & j
	end repeat
	return cleanedNumber
end CleanTheNumber

on GetKeyNamed(keyName)
	
	tell application "Keychain Scripting"
		try
			tell current keychain
				get some generic key whose name is keyName
				return result
			end tell
		on error
			return null
		end try
	end tell
end GetKeyNamed

on CreateKey(keyName)
	tell application "Address Book"
		display dialog "Enter Username" default answer "username" buttons {"OK"} default button "OK"
		set myVonageLogin to text returned of the result
		display dialog "Enter Password" default answer "password" buttons {"OK"} default button "OK"
		set myVonagePassword to text returned of the result
		display dialog "Enter Vonage Number" default answer "15555555555" buttons {"OK"} default button "OK"
		set myVonageNumber to text returned of the result
		(* set VonageNumbers to GetNumbers(myVonageLogin, myVonagePassword)
		if (count of VonageNumbers) is 1 then
			set myVonageNumber to item 1 of VonageNumbers
		else
			set myVonageNumber to null
		end if *)
	end tell
	tell application "Keychain Scripting"
		tell current keychain
			make new generic key with properties ¬
					{name:keyName, account:myVonageLogin, password:myVonagePassword, comment:"Default Number: " & myVonageNumberreturn result
		end tell
	end tell
end CreateKey

on GetDefaultNumber(comments, VonageNumbers)
	set theNumber to null
	repeat with currentWord in VonageNumbers
		if currentWord is in comments then
			set theNumber to currentWord
		end if
	end repeat
	return theNumber
end GetDefaultNumber

on GetNumbers(login, pass)
	set theURL to "https://secure.click2callu.com/tpcc/getnumbers?"
	set theURL to theURL & "username=" & login
	set theURL to theURL & "&password=" & pass
	set errorCode to do shell script "curl \"" & theURL & "\""
	return words in errorCode
end GetNumbers

on SelectNumber(NumberList)
	tell application "Address Book"
		display dialog "Choose a number" buttons NumberList
		return button returned of result
	end tell
end SelectNumber




[ Reply to This | # ]
Dial with Vonage from the Address Book
Authored by: codebowl on Jul 15, '06 10:34:51AM

Is there a way to do this with MS Entourage?



[ Reply to This | # ]
Dial with Vonage from the Address Book
Authored by: 5chm31din6 on Feb 07, '06 10:24:18PM

This! Totally! Rawks!

---
Power corrupts. PowerPoint corrupts absolutely.



[ Reply to This | # ]
Dial with Vonage from the Address Book
Authored by: anastas on Feb 02, '07 05:42:48PM
I setup two scripts from these provided here that dial a phone number from AddressBook (tags: Address Book) using Vonage from Launchbar!
--> http://forums.obdev.at/viewtopic.php?p=813

[ Reply to This | # ]
Combine POST with Keychain
Authored by: muski on Aug 13, '09 10:59:40AM
This is great -- works beautifully. However, I ended up combining the Dial-with-Vonage-0.3 script (halfway up the comments), that POSTs the username and password, and the idea of using the keychain to store them (near the bottom of comments). Think this is as secure as you can make this. The resulting script looks like this:

(*

Automatic Vonage Dialer v0.5
Major Changes by Patrick Tescher, pat2man@comcast.net

Based on:
Automatic Vonage Dialer v0.2
Aaron Freimark, abf@mac.com
March 16, 2004

Put this script into your "Address Book Plugins" folder in your ~/Library folder.
Only works in the US with this version

*)

property keyName : "Vonage"

-- The lines below are correct for the U.S.
property myCountryCode : "1"
property myLongDistanceCode : "1"
property myIntlAccessCode : "011"


using terms from application "Address Book"
on action property
return "phone"
end action property

on action title for pers with fone
return "Dial with Vonage"
end action title

on should enable action for pers with fone
if label of fone contains "fax" then return false
return true
end should enable action

on perform action for pers with fone
set theKey to GetKeyNamed(keyName)

-- set theKey to myVonageKey
if theKey is null then
set theKey to CreateKey(keyName)
end if

tell application "Keychain Scripting"
set myVonageLogin to account of theKey
set myVonagePassword to password of theKey
end tell
set NumberList to GetNumbers(myVonageLogin, myVonagePassword)
if (count of NumberList) is greater than 1 then
set myVonageNumber to GetDefaultNumber(comment of theKey, NumberList)
if myVonageNumber is null then
set myVonageNumber to SelectNumber(NumberList)
end if
else
set myVonageNumber to item 1 of NumberList
end if

set theNumber to (value of fone) as string

-- Add the long distance or international access code if it's not already there.
set numToDial to InsertLDCodes(theNumber)

--Uncomment the following two lines to confirm the number
--display dialog "So you want me to call?" default answer numToDial buttons {"OK"}
--set numToDial to text returned of the result

--Erase everything that's not a digit from the phone number
set cleanedNumber to CleanTheNumber(numToDial)

set theURL to "https://secure.click2callu.com/tpcc/makecall";
set theData to " -d username=" & myVonageLogin
set theData to theData & " -d password=" & myVonagePassword
set theData to theData & " -d fromnumber=" & myVonageNumber
set theData to theData & " -d tonumber=" & cleanedNumber

-- Use curl to hit the URL and dial the number
set errorCode to do shell script "curl \"" & theURL & "\"" & theData

--If there was an error, return a message.
if (characters 1 thru 3 of errorCode) as string ≠ "000" then
display dialog "Error: " & errorCode buttons {"OK"}
end if

end perform action

end using terms from


on InsertLDCodes(theNumber)

if (characters 1 thru 2 of theNumber) as string = "+" & myCountryCode then
-- The number was formatted correctly.
return theNumber
end if

if character 1 of theNumber = myLongDistanceCode then
-- Domestic long distance with LD access code
return theNumber
end if

if character 1 of theNumber = "+" then
-- international number, add prefix
return myIntlAccessCode & " " & theNumber
end if

-- local number, must add the LD code for Vonage
return myLongDistanceCode & " " & theNumber

end InsertLDCodes

on CleanTheNumber(numToDial) -- remove punctuation from a string, leaving just the number
set theDigits to {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"}
set cleanedNumber to ""
repeat with i from 1 to length of numToDial
set j to (character i of numToDial)
if j is in theDigits then set cleanedNumber to cleanedNumber & j
end repeat
return cleanedNumber
end CleanTheNumber

on GetKeyNamed(keyName)

tell application "Keychain Scripting"
try
tell current keychain
get some generic key whose name is keyName
return result
end tell
on error
return null
end try
end tell
end GetKeyNamed

on CreateKey(keyName)
tell application "Address Book"
display dialog "Enter Username" default answer "username" buttons {"OK"} default button "OK"
set myVonageLogin to text returned of the result
display dialog "Enter Password" default answer "password" buttons {"OK"} default button "OK"
set myVonagePassword to text returned of the result
display dialog "Enter Vonage Number" default answer "15555555555" buttons {"OK"} default button "OK"
set myVonageNumber to text returned of the result
(* set VonageNumbers to GetNumbers(myVonageLogin, myVonagePassword)
if (count of VonageNumbers) is 1 then
set myVonageNumber to item 1 of VonageNumbers
else
set myVonageNumber to null
end if *)
end tell
tell application "Keychain Scripting"
tell current keychain
make new generic key with properties ¬
{name:keyName, account:myVonageLogin, password:myVonagePassword, comment:"Default Number: " & myVonageNumber}
return result
end tell
end tell
end CreateKey

on GetDefaultNumber(comments, VonageNumbers)
set theNumber to null
repeat with currentWord in VonageNumbers
if currentWord is in comments then
set theNumber to currentWord
end if
end repeat
return theNumber
end GetDefaultNumber

on GetNumbers(login, pass)
set theURL to "https://secure.click2callu.com/tpcc/getnumbers?";
set theURL to theURL & "username=" & login
set theURL to theURL & "&password=" & pass
set errorCode to do shell script "curl \"" & theURL & "\""
return words in errorCode
end GetNumbers

on SelectNumber(NumberList)
tell application "Address Book"
display dialog "Choose a number" buttons NumberList
return button returned of result
end tell
end SelectNumber


[ Reply to This | # ]
Dial with Vonage from the Address Book
Authored by: bucweat on Dec 29, '09 07:48:21AM

Has anyone noticed that this service has stopped working? I tried to send an email to the address mentioned at the bottom of the page https://secure.click2callu.com/, but it bounced. I even tried the direct URL, which responded back that it was successful, but no call came in to my Vonage line (which otherwise is working fine). Has anyone else had a problem?



[ Reply to This | # ]
Dial with Vonage from the Address Book
Authored by: Gex2501 on Feb 08, '10 05:25:28PM

Yeah, whenever I try to use it now, for the last two months, instead of ringing my phone the call goes to my voicemail and then I get a VM message with the person I was trying to call talking to my voice mail. What happened? This was a really great feature and I used it all the time!



[ Reply to This | # ]
Dial with Vonage from the Address Book
Authored by: duffomelia on Jun 04, '10 11:34:54AM

It's hasn't been working for me either for awhile now.



[ Reply to This | # ]
Dial with Vonage from the Address Book
Authored by: bucweat on Feb 08, '10 05:31:58PM

Got the following from Vonage on 29 Dec 2009:

Thank you for contacting Vonage Customer Care!

It can be upsetting when you are unable to use the Click-2-Call feature. I'm glad you took the time to write to us today. I will do everything I can to ensure that this problem is taken care of at the earliest.

Charlie, due to some technical updates on our server, the Click-2-Call will not work at present. Our technicians are working on it to resolve the issue as soon as possible. Please accept my apology for the inconvenience caused.

Have not heard any more back. I just requested a status today. We'll see...

charlie



[ Reply to This | # ]
Dial with Vonage from the Address Book
Authored by: zoff on Aug 30, '11 11:50:06AM

Anyone get this to work with Lion? Address Book freezes when I use it with 10.7.1



[ Reply to This | # ]