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


Click here to return to the 'Dial Vonage phones directly from Address Book' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Dial Vonage phones directly from Address Book
Authored by: geoff2v on Jul 15, '05 07:43:54AM
Or, for dialing Vonage, you can just use this script:
(*
	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 : "xxxxxxxxxx"
property myVonagePassword : "xxxxxxxxxx"
property myVonageNumber : "1xxxxxxxxxx"

-- 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 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


[ Reply to This | # ]
Dial Vonage phones directly from Address Book
Authored by: argh128 on Jul 15, '05 07:57:37AM

The autoDialer script is a bit more powerful, since it supports multiple languages, and has quite of bit of intelligence about dialing internationally.

---

A completely SANE Canadian.



[ Reply to This | # ]
Dial Vonage phones directly from Address Book
Authored by: argh128 on Jul 15, '05 08:02:26AM
Also on 10.4's applescript this script fails to compile.

if (characters 1 thru 3 of errorCode) as string ? "000" then
I replaced it with
if (not (characters 1 thru 3 of errorCode) as string = "000") then
Which I believe to be semantically equivalent.

---

A completely SANE Canadian.

[ Reply to This | # ]

Dial Vonage phones directly from Address Book
Authored by: geoff2v on Jul 15, '05 10:03:56AM

Might have something to do with cutting-and-pasting from Script Editor. I'll give it a looksee...

- geoff



[ Reply to This | # ]
Dial Vonage phones directly from Address Book
Authored by: David Allen on Jul 16, '05 05:25:13PM

For those less sophisticated users, like myself, I have been dialing directly to my Vonage account from the menu bar with the Click2Call feature in iAddressX. It is a program that adds a system preference pane to System Prefs for configuring and a drop-down menu that gives you access to all the entries in AddressBook without having to open AddressBook. You can configure iAddressX to work with Vonage, Skype, and Phone Valet.

From Mibasoft, iAddressX costs US$8.00. I've used it for years and was jazzed when they added the Click2Call feature!

http://store6.esellerate.net/store/catalog.aspx?s=STR129433248&pc=


---
David Austin Allen
Monterrey, NL, MX



[ Reply to This | # ]
Dial Vonage phones directly from Address Book
Authored by: jonn8n on Jul 16, '05 10:35:49PM
Jon's Phone Tool also has a system-wide menu that shows all of your contacts from Address Book without having to open the Address Book application.

[ Reply to This | # ]
Dial Vonage phones directly from Address Book
Authored by: sethd on Nov 17, '05 12:29:17AM

Wow, this is excellent! Thanks so much!!

---
http://www.fictionalpeople.com



[ Reply to This | # ]