[VB] [Access] Tel Sms par PC - Faisable ?

Tel Sms par PC - Faisable ? [VB] [Access] - VB/VBA/VBS - Programmation

Marsh Posté le 16-06-2005 à 16:18:23    

Bonjour,  
 
Je voudrais savoir si Access (à partir d'une nouvelle entrée dans la base) peut automatiquement rechercher un numéro de téléphone, le composer et délivrer un message pré-enregistré à l'interlocuteur. Ou / et un sms.  
Avec un modem classique ou bien en Voip.  
 
C'est pour max 4/5 appels en même temps au pire.  
1) Est-ce faisable ?  
2) Mais surtout de quelle manière faire cela ? Je me doute que ça nécessitera sans doute un développement particulier, mais pour rechercher un programmeur, j'ai besoin de savoir quoi lui demander  
 
J'ai trouvé le code ci-dessous sur Allapi lien : http://www.mentalis.org/apilist/Ra [...] rams.shtml  
 
Pensez-vous que ça réponde à ma question ?  
Ce serait cool de me répondre  
 
Merci  
 
PS1: j'ai vu dans les faq qu'access peut gérer un appel mais je ne sais pas s'il peut faire tout ça automatiquement  
PS2: si quelqu'un sait faire, qu'il me contacte
 
 

Code :
  1. 'This program let you dial to your dial-up connections using whether
  2. 'the stored user name and password or the ones you specifies
  3. '(It use RasDial for dialing)
  4. 'You need a form with a list,2 textbox and a command button
  5. Option Explicit
  6. Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (pDst As Any, ByVal pSrc As String, ByVal ByteLen As Long)
  7. Private Declare Sub ZeroMemory Lib "kernel32.dll" Alias "RtlZeroMemory" (Destination As Any, ByVal Length As Long)
  8. Const RAS95_MaxEntryName = 256
  9. Const RAS_MaxPhoneNumber = 128
  10. Const RAS_MaxCallbackNumber = RAS_MaxPhoneNumber
  11. Const UNLEN = 256
  12. Const PWLEN = 256
  13. Const DNLEN = 12
  14. Private Type RASDIALPARAMS
  15. dwSize As Long ' 1052
  16. szEntryName(RAS95_MaxEntryName) As Byte
  17. szPhoneNumber(RAS_MaxPhoneNumber) As Byte
  18. szCallbackNumber(RAS_MaxCallbackNumber) As Byte
  19. szUserName(UNLEN) As Byte
  20. szPassword(PWLEN) As Byte
  21. szDomain(DNLEN) As Byte
  22. End Type
  23. Private Type RASENTRYNAME95
  24. 'set dwsize to 264
  25. dwSize As Long
  26. szEntryName(RAS95_MaxEntryName) As Byte
  27. End Type
  28. Private Declare Function RasDial Lib "rasapi32.dll" Alias "RasDialA" (ByVal lprasdialextensions As Long, ByVal lpcstr As String, ByRef lprasdialparamsa As RASDIALPARAMS, ByVal dword As Long, lpvoid As Any, ByRef lphrasconn As Long) As Long
  29. Private Declare Function RasEnumEntries Lib "rasapi32.dll" Alias "RasEnumEntriesA" (ByVal reserved As String, ByVal lpszPhonebook As String, lprasentryname As Any, lpcb As Long, lpcEntries As Long) As Long
  30. Private Declare Function RasGetEntryDialParams Lib "rasapi32.dll" Alias "RasGetEntryDialParamsA" (ByVal lpcstr As String, ByRef lprasdialparamsa As RASDIALPARAMS, ByRef lpbool As Long) As Long
  31. Private Function Dial(ByVal Connection As String, ByVal UserName As String, ByVal Password As String) As Boolean
  32. Dim rp As RASDIALPARAMS, h As Long, resp As Long
  33. rp.dwSize = Len(rp) + 6
  34. ChangeBytes Connection, rp.szEntryName
  35. ChangeBytes "", rp.szPhoneNumber 'Phone number stored for the connection
  36. ChangeBytes "*", rp.szCallbackNumber 'Callback number stored for the connection
  37. ChangeBytes UserName, rp.szUserName
  38. ChangeBytes Password, rp.szPassword
  39. ChangeBytes "*", rp.szDomain 'Domain stored for the connection
  40. 'Dial
  41. resp = RasDial(ByVal 0, ByVal 0, rp, 0, ByVal 0, h) 'AddressOf RasDialFunc
  42. Dial = (resp = 0)
  43. End Function
  44. Private Function ChangeToStringUni(Bytes() As Byte) As String
  45. 'Changes an byte array to a Visual Basic unicode string
  46. Dim temp As String
  47. temp = StrConv(Bytes, vbUnicode)
  48. ChangeToStringUni = Left(temp, InStr(temp, Chr(0)) - 1)
  49. End Function
  50. Private Function ChangeBytes(ByVal str As String, Bytes() As Byte) As Boolean
  51. 'Changes a Visual Basic unicode string to an byte array
  52. 'Returns True if it truncates str
  53. Dim lenBs As Long 'length of the byte array
  54. Dim lenStr As Long 'length of the string
  55. lenBs = UBound(Bytes) - LBound(Bytes)
  56. lenStr = LenB(StrConv(str, vbFromUnicode))
  57. If lenBs > lenStr Then
  58. CopyMemory Bytes(0), str, lenStr
  59. ZeroMemory Bytes(lenStr), lenBs - lenStr
  60. ElseIf lenBs = lenStr Then
  61. CopyMemory Bytes(0), str, lenStr
  62. Else
  63. CopyMemory Bytes(0), str, lenBs 'Queda truncado
  64. ChangeBytes = True
  65. End If
  66. End Function
  67. Private Sub Command1_Click()
  68. Dial List1.Text, Text1, Text2
  69. End Sub
  70. Private Sub List1_Click()
  71. Dim rdp As RASDIALPARAMS, t As Long
  72. rdp.dwSize = Len(rdp) + 6
  73. ChangeBytes List1.Text, rdp.szEntryName
  74. 'Get User name and password for the connection
  75. t = RasGetEntryDialParams(List1.Text, rdp, 0)
  76. If t = 0 Then
  77. Text1 = ChangeToStringUni(rdp.szUserName)
  78. Text2 = ChangeToStringUni(rdp.szPassword)
  79. End If
  80. End Sub
  81. Private Sub Form_Load()
  82. 'example created by Daniel Kaufmann (daniel@i.com.uy)
  83. 'load the connections
  84. Text2.PasswordChar = "*"
  85. Command1.Caption = "Dial"
  86. Dim s As Long, l As Long, ln As Long, a$
  87. ReDim r(255) As RASENTRYNAME95
  88. r(0).dwSize = 264
  89. s = 256 * r(0).dwSize
  90. l = RasEnumEntries(vbNullString, vbNullString, r(0), s, ln)
  91. For l = 0 To ln - 1
  92. a$ = StrConv(r(l).szEntryName(), vbUnicode)
  93. List1.AddItem Left$(a$, InStr(a$, Chr$(0)) - 1)
  94. Next
  95. If List1.ListCount > 0 Then
  96. List1.ListIndex = 0
  97. List1_Click
  98. End If
  99. End Sub


Message édité par Domdomdom le 16-06-2005 à 16:32:54
Reply

Marsh Posté le 16-06-2005 à 16:18:23   

Reply

Marsh Posté le 16-06-2005 à 16:24:29    

a mon avis ca va etre chaud  
mais recherches toujours du cote des codes TAPI
et alors la bonne chance

Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed