Solved

Connect my Database to Skype automatically to make phone calls

Posted on 2009-07-14
4
1,200 Views
Last Modified: 2013-11-09
I am going to build a simple access 2007 contact database with basic name, address and telephone number fields. This is to be used by some temps to contact the people by phone. I am going to use Skype for the phone calls and want to know if there is a way to have a button on the datbase that the temp woudl press and it would automatically call the telephone number for the displayed record using Skype?
0
Comment
Question by:iaingibbons
  • 2
  • 2
4 Comments
 
LVL 57

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 500 total points
ID: 24848305
Interesting question.  I haven't done this myself, but a quick check of the Skype web site shows that it has a developer portal:
https://developer.skype.com
  On the download page (https://developer.skype.com/Download), you'd want the COM wrapper, which you could then add into Access as a reference.
  There are VB programming examples here:
https://developer.skype.com/Docs/Examples#head-d8c9553367e685dfa81a1076ecddab67c6864f8d
and in the online examples, I found this VB example (see attached code).   That should work fine in VBA.
  So it certainly looks quite doable.  You didn't indicate your level of expertise, so I'm going to stop here for the moment.  If you need more, let me know.
JimD.

'// Create a Skype4COM object:

Set oSkype = WScript.CreateObject("Skype4COM.Skype", "Skype_")
 

'// Start the Skype client:

If Not oSkype.Client.IsRunning Then oSkype.Client.Start() End If
 

'// Declare the following Skype constants:

cUserStatus_Offline = oSkype.Convert.TextToUserStatus("OFFLINE")

cUserStatus_Online = oSkype.Convert.TextToUserStatus("ONLINE")

cCallStatus_Ringing = oSkype.Convert.TextToCallStatus("RINGING")

cCallStatus_Inprogress = oSkype.Convert.TextToCallStatus("INPROGRESS")

cCallStatus_Failed = oSkype.Convert.TextToCallStatus("FAILED")

cCallStatus_Refused = oSkype.Convert.TextToCallStatus("REFUSED")

cCallStatus_Cancelled = oSkype.Convert.TextToCallStatus("CANCELLED")

cCallStatus_Finished = oSkype.Convert.TextToCallStatus("FINISHED")

cCallStatus_Busy = oSkype.Convert.TextToCallStatus("BUSY")

cAttachmentStatus_Available = oSkype.Convert.TextToAttachmentStatus("AVAILABLE")
 

'// The PlaceCall command will fail if the user is offline. To avoid failure, check user status and change to online if necessary:

If cUserStatus_Offline = oSkype.CurrentUserStatus Then oSkype.ChangeUserStatus(cUserStatus_Online) End If  
 

'// Create a user object:

Set oUser = oSkype.User("echo123")

WScript.Echo "User " & oUser.Handle & " online status is " & oSkype.Convert.OnlineStatusToText(oUser.OnlineStatus)
 

'// Place a call:

Set oCall = oSkype.PlaceCall(oUser.Handle)
 

'// Wait until the call is in progress and return the relevant error if any other status occurs:

Do While oCall.Status <> cCallStatus_Inprogress

  If oCall.Status = cCallStatus_Failed Or _

    oCall.Status = cCallStatus_Refused Or _

    oCall.Status = cCallStatus_Cancelled Or _

    oCall.Status = cCallStatus_Finished Or _

    oCall.Status = cCallStatus_Busy Then

    Err.Raise vbObjectError + 1, "", "Call status: " & oSkype.Convert.CallStatusToText(oCall.Status)    

  End If    

  WScript.Sleep(500)

Loop
 

'// Check sending DTMF tones for use with interactive voice response (IVR) applications:

WScript.Sleep(10000)    

If cCallStatus_InProgress = oCall.Status Then oCall.DTMF = "0" End If  

WScript.Sleep(500)

If cCallStatus_InProgress = oCall.Status Then oCall.DTMF = "1" End If

WScript.Sleep(500)

If cCallStatus_InProgress = oCall.Status Then oCall.DTMF = "2" End If

WScript.Sleep(500)

If cCallStatus_InProgress = oCall.Status Then oCall.DTMF = "3" End If

WScript.Sleep(500)

If cCallStatus_InProgress = oCall.Status Then oCall.DTMF = "4" End If

WScript.Sleep(500)

If cCallStatus_InProgress = oCall.Status Then oCall.DTMF = "5" End If

WScript.Sleep(500)

If cCallStatus_InProgress = oCall.Status Then oCall.DTMF = "6" End If

WScript.Sleep(500)

If cCallStatus_InProgress = oCall.Status Then oCall.DTMF = "7" End If

WScript.Sleep(500)

If cCallStatus_InProgress = oCall.Status Then oCall.DTMF = "8" End If

WScript.Sleep(500)

If cCallStatus_InProgress = oCall.Status Then oCall.DTMF = "9" End If

WScript.Sleep(500)

If cCallStatus_InProgress = oCall.Status Then oCall.DTMF = "#" End If

WScript.Sleep(500)

If cCallStatus_InProgress = oCall.Status Then oCall.DTMF = "*" End If

WScript.Sleep(500)
 

'// Finish the call: 

If oCall.Status <> cCallStatus_Finished Then oCall.Finish() End If  
 

'// The AttachmentStatus event handler monitors attachment status and automatically attempts to reattach to the API following loss of connection:

Public Sub Skype_AttachmentStatus(ByVal aStatus)

  WScript.Echo  ">Attachment status " & oSkype.Convert.AttachmentStatusToText(aStatus)

  If aStatus = cAttachmentStatus_Available Then oSkype.Attach() End If

End Sub
 

'// If the call status is "failed", the CallStatus event handler returns the relevant failure reason as text:

Public Sub Skype_CallStatus(ByRef aCall, ByVal aStatus)

  WScript.Echo  ">Call " & aCall.Id & " status " & aStatus & " " & oSkype.Convert.CallStatusToText(aStatus)

  If cCallStatus_Failed = aStatus Then 

    WScript.Echo ">Failure reason:" & oSkype.Convert.CallFailureReasonToText(aCall.FailureReason)

  End If  

End Sub

Open in new window

0
 

Author Comment

by:iaingibbons
ID: 24848593
I am a novice really - I can create a table and design a form in access but thats about it - how would i integrate this into the database? Thank you so much!
0
 
LVL 57
ID: 24848935
<<I am a novice really - I can create a table and design a form in access but thats about it - how would i integrate this into the database? Thank you so much!>>
No coding experience then?   While not exactly simple, it's not all that difficult either, but there is nothing built-in to do what you want, so it means developing and coding a solution.
Time is a little short over here at the moment or I'd take some and code up a sample for this, which you could more or less drop in, but it still means you'd need to do some coding to get it to work.
 Let's wait just a bit and see if someone else jumps in.  Everyone on the assistance request list got pinged to look at this, so there will be quite a few eyes on this.
  Do you have a time frame on this or is it something that is going to be just a "nice to have" at some point?  I'm thinking if no one else responds in a couple of days, I might be able to free up some time to do the sample.  
JimD.
0
 

Author Comment

by:iaingibbons
ID: 24849083
Hi, I am looking to kick off something next week. I have found a Skype toolbar which interacts with Excel 2007 and tags telephone numbers - this will provide me with a simple short term solution - though I hate using excel for data. I really appreciate all your effort on this - thank you!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
As companies replace their old PBX phone systems with Unified IP Communications, many are finding out that legacy applications such as fax do not work well with VoIP. Fortunately, Cloud Faxing provides a cost-effective alternative that works over an…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now