Author |
|
fanningp Groupie
Joined: December 01 2002 Location: United States
Online Status: Offline Posts: 55
|
Posted: December 01 2002 at 09:55 | IP Logged
|
|
|
Since delving into home automation a couple of weeks ago, I've been looking at a number of software packages and have settled on PowerHome as being the best I've seen. One feature I noticed in other software is the ability to log caller id information. Any chance this can be evaluated for future integration?
Would be nice to be able to run reports on who called, and when.
__________________ Pete Fanning
Internet: petefanning@hotmail.com
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: December 03 2002 at 11:14 | IP Logged
|
|
|
Pete,
I am definately looking at adding TAPI support for PowerHome. This would include the caller ID support. I'll also do some research and see if it is something by itself that can be added without too much trouble.
Dave.
|
Back to Top |
|
|
fanningp Groupie
Joined: December 01 2002 Location: United States
Online Status: Offline Posts: 55
|
Posted: December 03 2002 at 11:26 | IP Logged
|
|
|
Dave...
Outstanding! After I posted the wheels started to turn and I thought, "Hey, I can trigger an event if a specific person calls!". This could help deaf folks by being able to trigger a specific lamp when someone calls, etc.
I started out thinking it would just be nice to be able to log calls, but it was nice to know there are other possiblities.
Thanks for taking a look and keep up the good work!
__________________ Pete Fanning
Internet: petefanning@hotmail.com
|
Back to Top |
|
|
TonyNo Moderator Group
Joined: December 05 2001 Location: United States
Online Status: Offline Posts: 2889
|
Posted: February 10 2003 at 20:50 | IP Logged
|
|
|
Dave,
I've found a spare CID-capable modem and dropped it in my PH system. I want to write a plug-in type app to watch the serial port for CID info, and, send it to PH. What is the best way to do this?
I can write a program to just log to a file, but, I'd like to tie-in directly to PH so I don't have to poll the file for changes.
I'm volunteering to do most of the work if you gimme a hand!
Tony
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: February 11 2003 at 09:40 | IP Logged
|
|
|
Tony,
If you can get to the point where you can log the caller ID to a file, then the tie-in to PowerHome part will be easy. I can give you the code to send a Windows message to PowerHome which can directly fire a trigger. It's just the monitoring of the serial port for CID info which will probably be the difficult part.
Let me know where you are at and I'll help all that I can.
Dave.
|
Back to Top |
|
|
TonyNo Moderator Group
Joined: December 05 2001 Location: United States
Online Status: Offline Posts: 2889
|
Posted: February 11 2003 at 12:01 | IP Logged
|
|
|
Dave,
Bah, the serial stuff is the easy part!
Bring on the code!
Tony
|
Back to Top |
|
|
TonyNo Moderator Group
Joined: December 05 2001 Location: United States
Online Status: Offline Posts: 2889
|
Posted: February 15 2003 at 17:55 | IP Logged
|
|
|
Well, it's been a while since I did VB coding, but, I've got the shell program getting CID info. All I need now is that code to pass it to PH!
Tony
|
Back to Top |
|
|
TonyNo Moderator Group
Joined: December 05 2001 Location: United States
Online Status: Offline Posts: 2889
|
Posted: February 16 2003 at 17:54 | IP Logged
|
|
|
A day later and the shell is starting be become a nice, little utility...
While waiting, I've added the ability to automatically generate a web page with the CID info. This page is based on a template file that can be customized. The template can be any HTML file that has a "<CID>" tag in it somewhere. The tag gets replaced with all current call data (which is only kept for the current session of the program, for now).
I've also started playing around with using PHCommand.exe until I hear from Dave.
Tony
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: February 17 2003 at 21:53 | IP Logged
|
|
|
Damn Tony you're fast!!!
Pasted below is the VB code to talk to PowerHome using Windows Messaging. It uses the WM_COPYDATA message and allows you to pass any arbitrary data to PowerHome and fire a trigger.
__________________________________________________
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Private Declare Function SendMessageCDS Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByRef lParam As Any) As Long
Private Type COPYDATASTRUCT dwData As Long cbData As Long lpData As String End Type
Dim hPwrHome As Long Dim cds As COPYDATASTRUCT
Private Sub Form_Load() Dim sData As String sData = "407-555-1212" hPwrHome = FindWindow(vbNullString, " PowerHome ") If hPwrHome = 0 Then MsgBox ("PowerHome is not running") End If cds.dwData = 11 cds.cbData = Len(sData) + 1 cds.lpData = sData SendMessageCDS hPwrHome, 74, 0, cds End End Sub
When this code is executed, it will fire a WM_COPYDATA / Data trigger within PowerHome. The passed in data is then available within the [TEMP5] system variable.
Hope this helps.
BTW, Tony I'd be interested in seeing your final code if you don't mind. I've got CID support on my to-do list but just havent had a chance to get to it.
Dave.
|
Back to Top |
|
|
TonyNo Moderator Group
Joined: December 05 2001 Location: United States
Online Status: Offline Posts: 2889
|
Posted: February 17 2003 at 22:53 | IP Logged
|
|
|
Fast when motivated... On Friday, I wished I had access my home CID data!
I'll try adding the code tomorrow night; I just finished up reading from and writing to an INI file for prefs (instead of just being hard-coded).
The CID code is fairly trivial; I think it building HTML is, at least, novel!
Of course I can send you the code. I didn't use TAPI, though. Seemed too obfuscated.
Tony
|
Back to Top |
|
|
TonyNo Moderator Group
Joined: December 05 2001 Location: United States
Online Status: Offline Posts: 2889
|
Posted: February 18 2003 at 21:16 | IP Logged
|
|
|
Yeah, baby! Hell, yeah!
Just as the second ring hits, PH is announcing the caller's name!
Who wants to beta test?!
Tony
|
Back to Top |
|
|
TonyNo Moderator Group
Joined: December 05 2001 Location: United States
Online Status: Offline Posts: 2889
|
Posted: February 20 2003 at 22:30 | IP Logged
|
|
|
Dave,
A bit off topic...
Okay, I'm stuck! How do I make a public array (or, my second choice, pass the array to a sub)?
I'm trying to build a string array to cross-ref numbers with names and replace the telco's supplied name with a more user friendly one. Know any tricks?
Thanks - Tony
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: February 21 2003 at 09:35 | IP Logged
|
|
|
Tony,
Im assuming you mean within PowerHome and not VB.
Since PowerHome does not have any arrays, the first problem is where to store the data. You could do this in either a global variable or a file.
Now, since there are no arrays, the data will be all contiguous and you just need a way to separate the components. You could do this a couple of ways as well. An array, is really just a structured piece of contiguous memory so you could actually simulate one in a GV or a file. You could do this by alloting say 12 characters for the number and 25 characters for the name, padding unused positions with a space character. Use this format within a file or GV and then just use math with the mid function to pull the info you need. This is commonly referred to as "fixed length". An alternative would be "variable length" where you use a special character as a separator. You could build your data as a phone number, followed by a single space, followed by the name, followed by a tab character (represented by "~t" in PowerHome).
Once you have your data built, I would just use the pos function to find the number, then use math or either the pos function again to pick out the name.
I also thought of another method. You could make use of the userdata1 table contained within the PowerHome database. You could place the number in the idstring field and the name within the valstring field. Set the type field to an appropriate value to signify that this "type" of data will be caller id lookup. You could then use the SQL select functions to pull the data.
Looking back at your post...Im thinking you actually meant within VB. Im not much of a VB programmer, but to make something public within VB, just declare (dim) the variable at global scope (not within any function or subroutine) just like I did with the hPwrHome and cds variables.
HTH,
Dave.
|
Back to Top |
|
|
TonyNo Moderator Group
Joined: December 05 2001 Location: United States
Online Status: Offline Posts: 2889
|
Posted: February 21 2003 at 22:33 | IP Logged
|
|
|
Dave,
Thanks! It was for VB, but, I really like the fixed-length field idea!
Tony
|
Back to Top |
|
|