SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Customizations
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Customizations This forums is for discussing and sharing user-created modifications for the SageTV application created by using the SageTV Studio or through the use of external plugins. Use this forum to discuss customizations for SageTV version 6 and earlier, or for the SageTV3 UI.

Closed Thread
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-05-2009, 12:43 PM
nstocke nstocke is offline
Sage Advanced User
 
Join Date: Apr 2008
Location: Kaysville, Utah
Posts: 100
VonageSniff VOIP Caller ID Script

I have the script running on my system. Still some things aren't quite right but very close.

Can the script send to more than one client? Multiple IPs with different ports.

The Daemon Switch -D doesn't seem to be working for me.

Neal
  #2  
Old 01-05-2009, 02:14 PM
KJake KJake is offline
Sage Icon
 
Join Date: May 2003
Location: West Michigan
Posts: 1,117
Quote:
Originally Posted by nstocke View Post
I have the script running on my system. Still some things aren't quite right but very close.
Great! So it is working? Sending new incoming calls to a YAC Listener?

Quote:
Originally Posted by nstocke View Post
Can the script send to more than one client? Multiple IPs with different ports.
It doesn't currently, but that's a good point. It was designed to only send to one listener since the new Info Popup will send the message to all the sage sessions, but I may be misunderstanding that and you probably still need to send the message to each Sage stand-alone client (non-server, non-extender). I only have extenders, so this didn't strike me as a problem originally. Anyway, this is a long winded way of saying I should be able to change this.

Quote:
Originally Posted by nstocke View Post
The Daemon Switch -D doesn't seem to be working for me.
There isn't really a great way to fork() in Windows to properly detach a running process from the console. I will though try again, and if not, I can remove the option from the help text and give simple instructions on how to install this as a Windows Service.

Since you're my first official tester, I'll start adding in some more debugging info too Thanks for the help, glad to know it works
  #3  
Old 01-05-2009, 03:16 PM
nstocke nstocke is offline
Sage Advanced User
 
Join Date: Apr 2008
Location: Kaysville, Utah
Posts: 100
Apparently if you run SageTV as a service and then run SageTV on the same computer it is seen as a client device and in order to get the popups to work on the primary computer (in my case it is my primary HTPC) you have to call out a different port than what the main SageTV listener is listening on.

I'm very excited about getting this to work. What I've seen so far is great. I love getting the infopopup on the screen before I hear the phone ring. The household has gotten spoiled with YAC on all the PCs around the house. So I think they will enjoy getting the early notice of your script on their PCs.

Below is a copy of one of my posts in the other thread.

Quote:
I determined that the perl58.dll it was looking for was based on the version of PERL. I had installed Perl 5.10 after installing an older version of PERL version 5.8.8 I got the script to run. I have gotten it to detect incoming calls and to send the CALLER ID to a YAC listener. There are still a few problems. I get errors when I try to use the Daemon option -D and the only way I can get it to detect incoming calls is to use the -f (filter option) but when I do the screen fills with "Use of uninitialized value in pattern match (m//) at vonageSniff.pl line 275." messages. It is functioning but the screen just streams that message.
Thanks for the effort into this. I'm hoping that anyone else giving the script a try will find this thread.

Neal
  #4  
Old 01-05-2009, 03:50 PM
KJake KJake is offline
Sage Icon
 
Join Date: May 2003
Location: West Michigan
Posts: 1,117
Quote:
Originally Posted by nstocke View Post
I determined that the perl58.dll it was looking for was based on the version of PERL. I had installed Perl 5.10 after installing an older version of PERL version 5.8.8 I got the script to run.
My apologies for that, I'll make sure that I package it correctly next time. You shouldn't have to install perl to make this work, just the WinPcap.

I'll take a look at that line in the source code to see if I can determine what the problem is, and when we're done, I'll post the source.
  #5  
Old 01-05-2009, 05:53 PM
KJake KJake is offline
Sage Icon
 
Join Date: May 2003
Location: West Michigan
Posts: 1,117
Here is a new version. This should support minimal logging to the Event Log (will be more useful once running as a service), support for multiple YAC listeners, should correct the perl58.dll problem, and should correct the error message from before.

Version 1.04

As usual, I have no way to test this, so there are portions of the code that don't even execute when I run this. I'm hoping that I wrote things correctly so this doesn't bomb out unexpectedly once you do have a call.

edit: original posting with more details/instructions ---
Quote:
Originally Posted by kjake
Here is my first try. I've commented out all the Unix stuff for now, focusing on getting the sniffing working instead. I don't have a way to test this since the only windows system close to my vonage adapter only has 1 network card in it, so I did the best I could blindly

If it does detect the SIP Invite, it will grab the data and print out the YAC formatted string and it will attempt to send the message to a YAC listener. I have not tested whether the TCP connect capability is still working (again, just want to get the sniffer working).

So, download and install the latest WinPcap, then run the attached. Run it first as vonageSniff.exe -h to see the options that can be set, then run it once without the -h to have it tell you the list of network adapters in your system that it can use.

Then you would run a command similar to:
vonageSniff -d=\Device\NPF_{GUID} -ip=ip.of.your.yac.listener

To test, you can leave out the -i (ignore) option that I added and it should detect an outgoing call (calling voicemail even) and display your own phone number as the caller. When I'm running this fulltime I use the ignore and place my own phone number there as 2125553322 and then it will ignore all outgoing calls.

In anycase, if someone can get this to print out something other than an error, I will be pleased.

Again, do note that you need a fairly specific network setup for this to work in general. Your sniffing system needs to be able to see all the traffic from the vonage adapter and switches will block that.

If this does work, I do plan on trying to add the Unix stuff back in as there are similar perl modules in Windows.

Last edited by KJake; 01-05-2009 at 06:12 PM.
  #6  
Old 01-05-2009, 06:19 PM
shadeblue.com's Avatar
shadeblue.com shadeblue.com is offline
Sage Aficionado
 
Join Date: Jun 2008
Posts: 435
Quote:
Originally Posted by KJake View Post
It was designed to only send to one listener since the new Info Popup will send the message to all the sage sessions, but I may be misunderstanding that and you probably still need to send the message to each Sage stand-alone client (non-server, non-extender). I only have extenders, so this didn't strike me as a problem originally. Anyway, this is a long winded way of saying I should be able to change this.
KJake is correct, the new SageInfoPopup plug-in was designed to accept a single YAC message and then create popup on all known UI context instances. Unfortunately in the architecture of Sage, software PC client instances are not known UI contexts in the servers list, but rather they run in their own separate process space as stand-a-lone instances not accessible via the SageTV server API. Thus to support InfoPopup on SageTV Client instances, a YAC message must be send to each instances and in the case where the client is being run from the SageTV server, an alternate port is required.
__________________
Server Hardware: Intel Core 2 Quad Q6700 2.66GHz CPU, 4GB DDR2 RAM, NVIDIA nForce 780i SLI Motherboard, GeForce 8600 GT, Seagate Barracuda 7200.11 2.5TB
Operating System: Windows XP Professional
HTPC/DVR Software: SageTV 7
Capture Devices: 2 @ Hauppauge HD-PVR (1212), Hauppauge WinTV-HVR-1600 ATSC/QAM, HD Homerun
Media Extenders: 2 @ Sage HD100 & 1 @ Sage HD200
Signals/Providers: AT&T UVerse, OTA ATSC
Set-Top-Box: 2 @ Motorola Box VIP 1200
  #7  
Old 01-05-2009, 06:26 PM
KJake KJake is offline
Sage Icon
 
Join Date: May 2003
Location: West Michigan
Posts: 1,117
A couple of other ideas for sniffing out a VOIP device:

On your windows system, install a second network card, if needed, connect the VOIP adapter to one network card and the rest of the network/internet to the other network card. Then, open your Network Adapters, highlight both adapters, right-click and choose bridge. This should allow the VOIP adapter access to the internet, and should allow you to either sniff the physical card connected to the VOIP adapter, or sniff the virtual bridge - try the VOIP card first since it will be less traffic.

Also, if you have fancy switches in your home, you can setup a Monitor port on the switch that will allow, usually a single defined management station, to sniff the packets of any device connected to that switch port. You can only have one management port on at a time, as far as I know.

You could also get real advanced with some nutso routing tables and setup everything on the network to route through a single PC with the vonageSniff application on it, then setup destination routes on that PC.

The easiest is probably the second option if you have the equipment. I did the first option on my Linux system because it already had two network cards.
  #8  
Old 01-05-2009, 08:37 PM
nstocke nstocke is offline
Sage Advanced User
 
Join Date: Apr 2008
Location: Kaysville, Utah
Posts: 100
What I've done is run a softphone on the PC running VonageSniff and linked set it up with my home number. Now all incoming calls go to the softphone on the PC and the VOIP box. I'm running X-Lite softphone.
  #9  
Old 01-05-2009, 10:27 PM
nstocke nstocke is offline
Sage Advanced User
 
Join Date: Apr 2008
Location: Kaysville, Utah
Posts: 100
Quote:
Originally Posted by KJake View Post
Here is a new version. This should support minimal logging to the Event Log (will be more useful once running as a service), support for multiple YAC listeners, should correct the perl58.dll problem, and should correct the error message from before.

Version 1.04

As usual, I have no way to test this, so there are portions of the code that don't even execute when I run this. I'm hoping that I wrote things correctly so this doesn't bomb out unexpectedly once you do have a call.

edit: original posting with more details/instructions ---
I gave version 1.04 a try. I am unable to get it to send anything to the YAC listeners.
I am still getting the streaming error message if I use anything as a -f filter. With the previous version I had to put something in to be filtered to get it to detect anything. (I used -f='@CALL' but I think any text got it to work)
The repeating message is:
Quote:
Use of uninitialized value in pattern match (m//) at vonageSniff.pl line 161.
Same message different line.

Let me know if you need more details.
  #10  
Old 01-06-2009, 01:29 AM
KJake KJake is offline
Sage Icon
 
Join Date: May 2003
Location: West Michigan
Posts: 1,117
okay, i'm going to have to find a way to test this all before putting out new versions hold tight.
  #11  
Old 01-06-2009, 01:34 PM
OneThomas OneThomas is offline
Sage Advanced User
 
Join Date: Oct 2006
Posts: 102
Hey guys - I have Vonage (with the Linksys Adapter). I'd be glad to help test this out - this would be a great feature to install on my setup (Sage Server with HD100 Extenders). But, I don't know much about installing the plugins (I use the default SAGE GUI - and nothing else). If you would want to walk me through installing it, I would go for it...!!
  #12  
Old 01-06-2009, 02:40 PM
KJake KJake is offline
Sage Icon
 
Join Date: May 2003
Location: West Michigan
Posts: 1,117
Quote:
Originally Posted by KJake View Post
okay, i'm going to have to find a way to test this all before putting out new versions hold tight.
i have a new version ready and i think i know how to setup testing this on a windows pc at home - so i'll try to do that and flush out remaining bugs tonight. so far, i cleaned up logging a bit and the program can now install itself as a service (optional).

so tonight, i'll try and figure out why you're having that -f(ilter) problem, the scrolling error, and whether i can get multiple listeners going.
  #13  
Old 01-06-2009, 09:16 PM
KJake KJake is offline
Sage Icon
 
Join Date: May 2003
Location: West Michigan
Posts: 1,117
Quote:
Originally Posted by nstocke View Post
I gave version 1.04 a try. I am unable to get it to send anything to the YAC listeners.
Hopefully this new one works better, I remembered that my wife's XP system had another network card in it, so I could attach my adapter to that.

I didn't completely test it, but I trust that based on all of the good feedback on the console that it is detecting everything properly.

A word on -f(ilter); this setting is for WinPcap. It tells the driver what kind of traffic to look for. On the Vonage devices, this is usually on port 10000, so I have it defaulting to looking at any traffic (udp and tcp) on port 10000. If you want the tool to look at all traffic, you should be able to pass -f='' on the command line to do so - or anything else if you know more about your service.

New features:
Code:
-C=<config file> to load settings from a file rather than typing them all on the command line
--install <args> to install a service with <args> (example: --install -C=<full.file.path>)
--remove to remove the installed service
Sample config file is included in the zip file so you know how to set things. Make sure, if you install this as a service, that you use the full path to the config file or else it won't work. Also enclose it in quotes if there are spaces in the path folder/file names at any point.

Known Issue: Issuing a Stop command for the service won't kill the process; there is a workaround to this that I started implementing, but then ran into a problem...so I need to look into a different method. You can kill the process from the task manager for now. The reason that this happens is because the WinPcap filter is running in a loop and once it enters it never leaves to evaluate whether a stop command was issued.

Last minute thoughts: I have no idea if the filter= setting in the config file requires quotes around it or not. I don't think that it does, but I just noticed that there aren't any in the sample file. If I know the code well enough, this should still work since the quotes were really for the command line to help tokenize the arguments.

http://kjake.net/vonageSniff.zip (same file name, might want to clear your cache)
  #14  
Old 01-07-2009, 10:12 AM
lovingHDTV's Avatar
lovingHDTV lovingHDTV is offline
Sage Icon
 
Join Date: Jul 2003
Posts: 1,019
Quote:
Originally Posted by nstocke View Post
What I've done is run a softphone on the PC running VonageSniff and linked set it up with my home number. Now all incoming calls go to the softphone on the PC and the VOIP box. I'm running X-Lite softphone.
Could you go into a little more details on how you did this? I'd like to try it myself.

thanks
dave
  #15  
Old 01-07-2009, 10:28 AM
KJake KJake is offline
Sage Icon
 
Join Date: May 2003
Location: West Michigan
Posts: 1,117
Quote:
Originally Posted by lovingHDTV View Post
Could you go into a little more details on how you did this? I'd like to try it myself.

thanks
dave
X-Lite:
http://www.counterpath.com/x-lite.html

X-Lite for use with Asterisk:
http://www.asteriskguru.com/tutorial...softphone.html


Not sure if nstocke is using this with Vonage or not. I'll see if I can get it going later tonight if that's not what they are doing.
  #16  
Old 01-07-2009, 11:25 PM
KJake KJake is offline
Sage Icon
 
Join Date: May 2003
Location: West Michigan
Posts: 1,117
Quote:
Originally Posted by KJake View Post
X-Lite:
http://www.counterpath.com/x-lite.html

X-Lite for use with Asterisk:
http://www.asteriskguru.com/tutorial...softphone.html


Not sure if nstocke is using this with Vonage or not. I'll see if I can get it going later tonight if that's not what they are doing.
Vonage has a softphone that you can addon, otherwise you're out of luck with them. If you have a provider like CallCentric, etc they may actually give you all the SIP settings to set this up. In fact, due to my research on this, I'm pretty sure that I'm going to switch from Vonage to CallCentric - soley on the fact that I don't even come close to using the 500 minutes I have with them and using a Pay As You Go service will be even cheaper and Vonage is about to raise their 500 minute plan by $3.
  #17  
Old 01-10-2009, 01:13 AM
nstocke nstocke is offline
Sage Advanced User
 
Join Date: Apr 2008
Location: Kaysville, Utah
Posts: 100
Quote:
Originally Posted by lovingHDTV View Post
Could you go into a little more details on how you did this? I'd like to try it myself.

thanks
dave
Sorry, for taking so long to respond. Although I'm subscribed to this thread I didn't get a notification that responses had been left.

I use "Via Talk" as my VOIP provider. I use the X-Lite softphone application referenced above. VIATalk provides all of the required SIP info to get the softphone working. Once the softphone is working on the PC and I was able to make and receive calls I was able to get the network caller-id packets on the computer.
  #18  
Old 01-10-2009, 01:17 AM
nstocke nstocke is offline
Sage Advanced User
 
Join Date: Apr 2008
Location: Kaysville, Utah
Posts: 100
Quote:
Originally Posted by KJake View Post
Last minute thoughts: I have no idea if the filter= setting in the config file requires quotes around it or not. I don't think that it does, but I just noticed that there aren't any in the sample file. If I know the code well enough, this should still work since the quotes were really for the command line to help tokenize the arguments.

http://kjake.net/vonageSniff.zip (same file name, might want to clear your cache)
I am having problems unzipping the file. I keep getting errors that it is an unknown compression method. I've downloaded it several times. I use WinRAR and I tried the unzip feature built into XP. I'm excited to give it a try.

Thanks

Just tried Alzip to extract the files. It can see them but still no luck.

Last edited by nstocke; 01-10-2009 at 01:25 AM.
  #19  
Old 01-10-2009, 08:57 AM
KJake KJake is offline
Sage Icon
 
Join Date: May 2003
Location: West Michigan
Posts: 1,117
Quote:
Originally Posted by nstocke View Post
I am having problems unzipping the file. I keep getting errors that it is an unknown compression method.
Sorry! I may have picked weird options when I zipped it with 7-zip, or my FTP client may have resumed the file overtop of the old file...so I rezipped it and deleted the old file from FTP first and have uploaded a new file.

I just downloaded it and opened it to be sure.

Last edited by KJake; 01-10-2009 at 08:59 AM.
  #20  
Old 01-10-2009, 03:14 PM
KJake KJake is offline
Sage Icon
 
Join Date: May 2003
Location: West Michigan
Posts: 1,117
Also, nstocke, if the default filter setting doesn't work for you, try 'udp and tcp 5060' - i think that's the standard SIP port and it may work for Vonage too. If it does, I'll change that to be the default in the next release.
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Caller ID modem for voip tawd1992 Hardware Support 11 10-22-2009 06:17 PM
Anyone have a script tp restart client ? brewston SageTV Software 3 09-16-2008 08:02 AM
Need a script to reboot MVP deanm SageTV Media Extender 13 07-25-2008 01:32 AM
comclean script with .edl files joe123 SageTV Customizations 0 07-10-2007 10:08 AM
Perl script to automatically grab movie thumbs sundansx SageTV Customizations 0 01-10-2007 11:41 PM


All times are GMT -6. The time now is 06:55 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.