Announcement

Collapse
No announcement yet.

HSPhone Source

Collapse
This topic is closed.
X
This is a sticky topic.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #46
    Test scripts for HS3

    I've started a thread in the Way2Call section that contains the various HS3 scripts I'm creating as I test. I'll be adding to that post as I create additional test scripts.

    I'm starting a new thread in the HSphone sub-forum to discuss test results, since this one has gone way off-topic from the "source code" issue. I'll post the results of the tests in that thread.

    Here's the link to the test scripts.
    https://forums.homeseer.com/showthread.php?t=196516
    Fred

    HomeSeer Pro 3.0.0.548, HS3Touch, Zwave 3.0.1.252, Envisalink DSC 3.0.0.40, WeatherXML, Z-stick, HS phone, Way2Call

    Comment


      #47
      I don't want to hijack the thread but ... Mike; how do you have your Panasonic switch lay out? POTS --> Panasonic --> Way2Call, or some other manner.

      Apologies for the diversion.
      Don

      Comment


        #48
        Originally posted by donstephens View Post
        I don't want to hijack the thread but ... Mike; how do you have your Panasonic switch lay out? POTS --> Panasonic --> Way2Call, or some other manner.

        Apologies for the diversion.
        Correct, Way2Call is a single line device in parallel with an extension. Panasonic passes CID info to extensions so no matter which line rings the CID info is fed to the Way2Call and is announced.

        Comment


          #49
          Originally posted by ITguyHS View Post
          Mike,

          Do you have an example (event and/or script) that you could share for doing the paging? I'm assuming that you currently have this working.
          I disabled it awhile back because a quirk in the way Way2call works made it repeat each message multiple times as if it was delivering an alarm notification to an external party. Went back to using Stargate for internal pages for now but would like to solve the Way2Call issue and resume using Homeseer for these.
          Attached Files
          Last edited by upstatemike; June 30, 2018, 10:14 PM. Reason: Add example

          Comment


            #50
            Originally posted by upstatemike View Post
            I disabled it awhile back because a quirk in the way Way2call works made it repeat each message multiple times as if it was delivering an alarm notification to an external party. Went back to using Stargate for internal pages for now but would like to solve the Way2Call issue and resume using Homeseer for these.
            So, actually, it does work, but with the undesired repetition of the message?

            Would you give the script below a try? Just run it from a manual-called event. Just for chuckles, I added a "beep, beep" before the message as an attention-getter.

            Code:
            Sub Main(ByVal Parms As Object)
            
              dim r
            
              hs.WriteLogEx("Phone dial-number, speak message test", "Start script", "#008000")
            
              hsp.LINEScriptHasControl(1, TRUE)	'take script control of line 1
            
              ' Phone off-hook for answer/call
              hs.WriteLogEx("Phone dial-number, speak message test", "Go off-hook", "#008000")
              HSP.HIPcmd(1,&H005A,&H0)
             
              hsp.WaitMS(2000)			'wait 2 seconds
            
              hs.WriteLogEx("Phone dial-number, speak message test", "Dial number", "#008000")
              r = hsp.LineDial(1, "33*", FALSE, FALSE)	
            
              hsp.WaitMS(1000)			'wait 1 second
            
              hs.WriteLogEx("Phone dial-number, speak message test", "Send tones 123", "#008000")
              hsp.LineSendtones(1, "11", 1)  'send DTMF tones to line 1
              hsp.WaitMS(1000)			'wait 1 seconds
            
              hs.WriteLogEx("Phone dial-number, speak message test", "Speak message", "#008000")
              hsp.speak(1,"Time for dinner",true)
            
              hs.WriteLogEx("Phone dial-number, speak message test", "Hang up", "#008000")
              hsp.LINEhangup(1)                     'disconnect call
            
              hsp.WaitMS(1000)			'wait 1 second
            
              hs.WriteLogEx("Phone dial-number, speak message test", "Reset line", "#008000")
              hsp.LINEReset(1)			'reset line
            
              hs.WriteLogEx("Phone dial-number, speak message test", "End script", "#008000")
            End Sub
            Fred

            HomeSeer Pro 3.0.0.548, HS3Touch, Zwave 3.0.1.252, Envisalink DSC 3.0.0.40, WeatherXML, Z-stick, HS phone, Way2Call

            Comment


              #51
              Originally posted by ITguyHS View Post
              So, actually, it does work, but with the undesired repetition of the message?

              Would you give the script below a try? Just run it from a manual-called event. Just for chuckles, I added a "beep, beep" before the message as an attention-getter.

              Code:
              Sub Main(ByVal Parms As Object)
              
                dim r
              
                hs.WriteLogEx("Phone dial-number, speak message test", "Start script", "#008000")
              
                hsp.LINEScriptHasControl(1, TRUE)    'take script control of line 1
              
                ' Phone off-hook for answer/call
                hs.WriteLogEx("Phone dial-number, speak message test", "Go off-hook", "#008000")
                HSP.HIPcmd(1,&H005A,&H0)
               
                hsp.WaitMS(2000)            'wait 2 seconds
              
                hs.WriteLogEx("Phone dial-number, speak message test", "Dial number", "#008000")
                r = hsp.LineDial(1, "33*", FALSE, FALSE)    
              
                hsp.WaitMS(1000)            'wait 1 second
              
                hs.WriteLogEx("Phone dial-number, speak message test", "Send tones 123", "#008000")
                hsp.LineSendtones(1, "11", 1)  'send DTMF tones to line 1
                hsp.WaitMS(1000)            'wait 1 seconds
              
                hs.WriteLogEx("Phone dial-number, speak message test", "Speak message", "#008000")
                hsp.speak(1,"Time for dinner",true)
              
                hs.WriteLogEx("Phone dial-number, speak message test", "Hang up", "#008000")
                hsp.LINEhangup(1)                     'disconnect call
              
                hsp.WaitMS(1000)            'wait 1 second
              
                hs.WriteLogEx("Phone dial-number, speak message test", "Reset line", "#008000")
                hsp.LINEReset(1)            'reset line
              
                hs.WriteLogEx("Phone dial-number, speak message test", "End script", "#008000")
              End Sub
              Happy to test but have a house full of guests through July 4th so might be a delay till I can get to it.

              Comment


                #52
                Originally posted by upstatemike View Post
                Happy to test but have a house full of guests through July 4th so might be a delay till I can get to it.
                No problem. Just whenever you can get to it.
                Thanks.
                Fred

                HomeSeer Pro 3.0.0.548, HS3Touch, Zwave 3.0.1.252, Envisalink DSC 3.0.0.40, WeatherXML, Z-stick, HS phone, Way2Call

                Comment


                  #53
                  I’m a HS3 HSPhone on Win7 user

                  I use it for:
                  Block ring until cid received
                  Based on cid and address book entry
                  Ring phone and announce caller name x number of rings before going to voicemail.
                  Special voicemail greeting for some address book entries
                  Special announcements for some address book entries.
                  Or
                  Block (no ring, answer & immediately hang up) on caller

                  Voicemail handling through events and Scripts I wrote using hsphone commands. (Play Vmail, delete vmail, send wav file via email, etc)

                  I do NOT currently use it for local HS control through voice or DTMF. (No longer see need with Alexa and hstouch)

                  I’d also like the option of having it run on Linux in future

                  Been using hsphone since pcimodem days.... WAF is EXTREMELY high.

                  I’d pay for a plug-in, and if necessary a moderately priced modem (if the way2call was not supported.)

                  Will Definitely need it or replacement before moving to next version of HS (HS4?)

                  Thanks.



                  Sent from my iPad using Tapatalk
                  Regards,

                  Andrew B.

                  Comment


                    #54
                    Originally posted by rjh View Post
                    Notes on the source:
                    These files are pulled from the main source so for sure it will not compile without some work. With this code you should be able to create a plugin that will interact with the way2call device, (and PCI modem), by detecting off hook, answering calls, etc. The VR will be an issue as I don't believe all the code is there to take the audio from the phone and process it through the Windows VR system. If you get that far I might be able to pull more source that does some of this. I don't have a problem adding some hooks into HS3 if needed in order to integrate some of the functionally. Originally, HSPhone was going to be a plugin for HS3 but we decided it was too much work.

                    It references a third party audio dll from:

                    http://www.exceletel.com/

                    (which is already installed with HS3)

                    There is also another DLL named hsaudio2.dll which I believe is still referenced and does some audio handling. That is our DLL and I can give you the source if you want. That was written in VB6 as .net could not do what was needed.
                    Rich,
                    I'm trying to create a test project in VS2015 and have a few issues:
                    1. What's the name of the exceletel audio dll?
                    2. Could you post a copy of hsaudio2.dll?
                    3. w2cusbdll.vb tries to import wavelib. I can't find that anywhere! Can you post it?
                    4. The source makes extensive use of a function WriteMon, but that function is not defined in any of the source you posted. Can you post the source?

                    Thanks!
                    Fred

                    HomeSeer Pro 3.0.0.548, HS3Touch, Zwave 3.0.1.252, Envisalink DSC 3.0.0.40, WeatherXML, Z-stick, HS phone, Way2Call

                    Comment


                      #55
                      Fred:

                      I want to encourage you in your attempt to take this on. I think the philosophy of your scripts was in the right direction.

                      Thanks for giving this a go.
                      Don

                      Comment


                        #56
                        Here is the exceletel DLL (this will need a license, but it may run as a trial)
                        http://homeseer.com/hs2/etTT35.ocx

                        Here is hsaudio2.dll:
                        http://homeseer.com/hs2/hsaudio2.dll
                        This DLL was written long ago, maybe in VB6 and I tried to find the source but could not. You can probably disassemble if needed. I think its used to record audio.

                        Wavelib is in the HS2Util dll, the source to that DLL is here:
                        http://homeseer.com/hs2/HS2Util.zip

                        WriteMon simply sends log info to the HS log, so just stub that out and send it to your own log or console.writeline so you can see messages.

                        You are probably seeing what a can of worms this thing is .NET does not offer the low level API's that are need to tie into low level audio so hacks were cobbled together to get it to work. Ideally, the entire audio interface should be written in native C++.

                        Originally posted by ITguyHS View Post
                        Rich,
                        I'm trying to create a test project in VS2015 and have a few issues:
                        1. What's the name of the exceletel audio dll?
                        2. Could you post a copy of hsaudio2.dll?
                        3. w2cusbdll.vb tries to import wavelib. I can't find that anywhere! Can you post it?
                        4. The source makes extensive use of a function WriteMon, but that function is not defined in any of the source you posted. Can you post the source?

                        Thanks!
                        💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

                        Comment


                          #57
                          Originally posted by rjh View Post
                          Here is the exceletel DLL (this will need a license, but it may run as a trial)
                          https://homeseer.com/hs2/etTT35.ocx

                          Here is hsaudio2.dll:
                          https://homeseer.com/hs2/hsaudio2.dll
                          This DLL was written long ago, maybe in VB6 and I tried to find the source but could not. You can probably disassemble if needed. I think its used to record audio.

                          Wavelib is in the HS2Util dll, the source to that DLL is here:
                          https://homeseer.com/hs2/HS2Util.zip

                          WriteMon simply sends log info to the HS log, so just stub that out and send it to your own log or console.writeline so you can see messages.

                          You are probably seeing what a can of worms this thing is .NET does not offer the low level API's that are need to tie into low level audio so hacks were cobbled together to get it to work. Ideally, the entire audio interface should be written in native C++.
                          That was fast! Thanks, Rich!
                          Fred

                          HomeSeer Pro 3.0.0.548, HS3Touch, Zwave 3.0.1.252, Envisalink DSC 3.0.0.40, WeatherXML, Z-stick, HS phone, Way2Call

                          Comment


                            #58
                            Originally posted by donstephens View Post
                            Fred:

                            I want to encourage you in your attempt to take this on. I think the philosophy of your scripts was in the right direction.

                            Thanks for giving this a go.
                            Thanks for the kind words. It's really a daunting project, but I've got some time. So far, I've reduced the error count from 2,457 to 463! Mostly had to do with additional dll's needing to be referenced and some HS utility things (like writemon and log) that had to be changed to a generic. If I can get it to the point where I get a clean build of the existing code, then I can start looking at what needs to be added/changed to convert it to a plugin.
                            Fred

                            HomeSeer Pro 3.0.0.548, HS3Touch, Zwave 3.0.1.252, Envisalink DSC 3.0.0.40, WeatherXML, Z-stick, HS phone, Way2Call

                            Comment


                              #59
                              Problem with dumping land lines is always going to be 911 service.

                              That's why I went with VOIP via Google Voice. My home gateway uses an ObiTalk VOIP gatways which supports Google Voice and other VOIP services. I then subscribe to E911 service and I'm set to go.

                              The other nice thing is that my Google voice number also connects to our cell phones, when we move I can take my landline number anywhere I go in the entire country just like a cell phone and I can also do texting via my GV app or web site. In fact I don't give my cell phone out much at all just my GV number then pickup the calls from my cell.

                              So back to the issue at hand, my ObiTalk gives me a POTS line so I can still integrate that into HS3 or any other POTs device.

                              All of that said there is still one way you could connect ones cell up to HS3 and that's using bluetooth via a RPi that an HS3 plugin could talk to. That same RPi could also have a phone interface then your covered on all fronts.

                              Oh, OMT. Transferring you land line does take some work as you much transfer it to a cell phone then to GV. That's simple using a prepaid cell phone for about $20 or so. GV then charges $20 to transfer the cell to GV so the total cost was about $40 per line.
                              HomeSeer Version: HS3 Standard Edition 3.0.0.548
                              Linux version: Linux auto 4.15.0-72-generic #81-Ubuntu SMP Tue Nov 26 12:20:02 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
                              Number of Devices: 484 | Number of Events: 776

                              Enabled Plug-Ins: 3.0.0.13: AirplaySpeak | 2.0.61.0: BLBackup
                              3.0.0.70: EasyTrigger | 1.3.7006.42100: LiftMaster MyQ
                              4.2.3.0: mcsMQTT | 3.0.0.53: PHLocation2 | 0.0.0.47: Pushover 3P
                              3.0.0.16: RaspberryIO | 3.0.1.262: Z-Wave

                              Z-Net version: 1.0.23 for Inclusion Nodes
                              SmartStick+: 6.04 (ZDK 6.81.3) on Server

                              Comment


                                #60
                                Originally posted by Timon View Post
                                Problem with dumping land lines is always going to be 911 service.

                                That's why I went with VOIP via Google Voice. My home gateway uses an ObiTalk VOIP gatways which supports Google Voice and other VOIP services. I then subscribe to E911 service and I'm set to go.

                                The other nice thing is that my Google voice number also connects to our cell phones, when we move I can take my landline number anywhere I go in the entire country just like a cell phone and I can also do texting via my GV app or web site. In fact I don't give my cell phone out much at all just my GV number then pickup the calls from my cell.

                                So back to the issue at hand, my ObiTalk gives me a POTS line so I can still integrate that into HS3 or any other POTs device.

                                All of that said there is still one way you could connect ones cell up to HS3 and that's using bluetooth via a RPi that an HS3 plugin could talk to. That same RPi could also have a phone interface then your covered on all fronts.

                                Oh, OMT. Transferring you land line does take some work as you much transfer it to a cell phone then to GV. That's simple using a prepaid cell phone for about $20 or so. GV then charges $20 to transfer the cell to GV so the total cost was about $40 per line.
                                In addition to 911 I don't see how to make a cell phone practical at home unless you use a a cradle that ties it into regular home phones. I'm not going to carry a cell phone (or any other device) around the house with me wherever I go... I'm just not.

                                I also note that POTS has a significant outage maybe once every 5 years or so. Cable Internet ( and therefore VOIP) has a significant outage at least once a month.

                                Cellular Service has some sort of issue at least once a week. (battery low or phone decides to go offline and update firmware, or cell signal gets flaky, etc.)

                                I can't see trading the reliability of POTS for either Cell or VOIP for my main number. They are OK for extra lines but nowhere near reliable enough or convenient enough to rely on as my main home phone.

                                Comment

                                Working...
                                X