Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Connect my Database to Skype automatically to make phone calls

Posted on 2009-07-14
4
Medium Priority
?
1,225 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 58

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 2000 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 58
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Popular third-party chat platforms like Slack, Discord, and Telegram are just a few of the many new productivity applications that are being hijacked by cybercriminals to create command-and-control (C&C) communications infrastructures for their malw…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

610 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