Kodi Community Forum

Full Version: [RELEASE] YAC Caller ID Listener (Script) YAC Caller ID Listener & Notifier for XBMC
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4
From my fuzzy recollection I think it worked nice with this skin but other skins certain sections were missing?
i just seen your post, you must of posted at the same time i was posting. Thanks for the response. i wasn't sure if i would get an answer from such an old forum post. ill take a look at the link see if i can come up with any answers. thanks!

its funny, not many people are thinking about caller id anymore since the cable companys give you the "triple play" if you have all 3 services (digital cable tv, internet, and phone) they will display the caller info on the tv digitality via the cable box.. but since i am moving away from the triple play finding it to be just a money pit (after taxes and rental costs its 45-50 dollars a month for home phone, even tho comcast says otherwise) i now require an alternative.

well, thanks so much for our post, ill let u know what happens
i just wish i knew where the xbmc live version keeps the scripts/add-ons etc

EDIT: right after i hit send i found it... lol, its in the same spot on normal, its just hidden
Thank you very much for that zip file! i unzipped it and replaced it with what was installed... it worked perfectly, still only showed the name only and not the number, but i can live with that for now! untill someone can rewrite the script and find why it does that!

thanks again!

Phil
I have C code for decoding caller ID info on my home page

http://highlandsun.com/hyc/#callerID

You might try extracting it directly, if whatever you're currently using isn't providing the number.

There's 3 programs there now, one that listens to my modem and parses the callerID, then UDP broadcasts it on my LAN. Then a listener that prints the info on stdout, and now I've just extended this with D-Bus notification, so it shows the info on my Xubuntu desktop. It would be pretty simple to make it notify the XBMC Event Server too.
Just an update. everything works flawlessly with the link that mcborzu provided. DO NOT use the version in the XBMCZONE program. use mcborzu's link and it will work.. i am currently learning some basic python so i can reformat it to work on HD tv resolution. I am currently a full time IT Manager so i dont get much to do hobbiest stuff, but I will post my findings and hopefully a new revision to the script.
Between trying to get Live TV to work from my Wintv 500 pvr pci card, and the caller id.. It should give me the tivo/comcast cablebox experience without having the pay the big bucks for it
Is this script still working - if so, could someone link me to it as the original link is down....

Thanks


Jon
This script will no longer work with the latest versions of xbmc.. however since the original author has not updated it 5 or more years most of the code is no longer compatible, i took the liberty a few weeks ago to start updating it.. I have an alpha-build (pre-beta) ready to go. I will post within a few days if you are interested.

nojstevens, what xbmc version are you currently using? I have been focusing on working on new compatibility only while most scripts can be backwards compatible i have not tested for that.

This script is what got me intrested learning python and how to script because i used it on a daily bases on my HTPC and it displayed wonderfully on my LG LCD tv.

nojstevens Wrote:Is this script still working - if so, could someone link me to it as the original link is down....

Thanks


Jon
philw132 glad to see that you are updating the script. As I was excited to come across this post and was disappointed when the first page I realize was posted so long ago. However as I clicked the last page and saw a much more recent date I was very excited.

I am running version XBMC 9.11 R26017 and would love to try out the script when you get a chance to get it posted. Hope to see something soon.

And thanks again for updating this, like you said in your previous post I am no fan of the "Triple Play" and this would be the final touch needed for my own setup not owned by the man! Nod

Alan
Sorry about the delay Ive been doing long hours at my job.. so my spare time has been spent sleeping Smile
I just installed Dharma beta 3, it broke updated package, it looks like its something simple ill update the problem code, and as soon as its set ill post a download link.

snogard20 Wrote:philw132 glad to see that you are updating the script. As I was excited to come across this post and was disappointed when the first page I realize was posted so long ago. However as I clicked the last page and saw a much more recent date I was very excited.

I am running version XBMC 9.11 R26017 and would love to try out the script when you get a chance to get it posted. Hope to see something soon.

And thanks again for updating this, like you said in your previous post I am no fan of the "Triple Play" and this would be the final touch needed for my own setup not owned by the man! Nod

Alan
Quote:import socket
import xbmc, xbmcgui, threading, thread, os, urllib
from time import *
from string import *

try:
EMULATING = xbmcgui.Emulating
SCRIPTFOLDER = "c:\\win32app\\Python24\\CallerId"
except:
EMULATING = False
SCRIPTFOLDER = os.getcwd()

MYAREACODE = "250" # SPECIFY YOUR AREA CODE
DOPAUSE = 1 # PAUSE PLAYBACK ON INCOMING CALL?
DOINITMSG = 1 # SHOW AN INITIALISATION MESSAGE WHEN SCRIPT STARTS
DOIMAGE = 1 # SPECIFY WHETHER OR NOT TO DISPLAY PICTURE WITH DIALOG
DOSOUND = 1 # SPECIFY WHETHER TO PLAY A SOUND
DELAY = 2 # SPECIFY DELAY BEFORE CLOSE IN SECONDS
SERVERTYPE = "YAC" # SPECIFY EITHER "YAC", "SWITCHBOARD", "CIDSENTRY" OR "IMPULSE"
OSDTITLE = "Phone Call" # TITLE TO SHOW ON INCOMING CALL DIALOG
SOUNDFILE = "incoming-a.wav" # WAV FILE TO PLAY IF DOSOUND IS ENABLED


YACPORT = 10629

BIGENDIAN = 1 # 0 OR 1, IF ONE DOESN'T WORK, TRY THE OTHER
HOST = '' # Symbolic name meaning the local host

xOffset = 3 # These are used to give a black shadow effect to text
yOffset = 3 # MattC.


class packet:
def __init__(self, type, param1, param2 = "", param3 = ""):
self.type = type
self.param1 = param1
self.param2 = param2
self.param3 = param3

def decodepacket(the_string):
if not(BIGENDIAN):
type = ord(the_string[3])
param1 = (ord(the_string[6]) * 256) + ord(the_string[7])
else:
type = ord(the_string[0])
param1 = (ord(the_string[5]) * 256) + ord(the_string[4])

param2 = the_string[8:72]
param3 = the_string[72:]
for i in range(-63, 0):
if ord(param2[-i]) == 0: param2 = param2[:-i]
if ord(param3[-i]) == 0: param3 = param3[:-i]
return packet(type, param1, param2, param3)

def encodepacket(the_packet):
r = " "
if not(BIGENDIAN):
r = r + chr(0)
else:
r = r + chr(the_packet.type)
r = r[1:]
r = r + chr(0)
r = r + chr(0)

if BIGENDIAN:
r = r + chr(0)
else:
r = r + chr(the_packet.type)

if not(BIGENDIAN):
r = r + chr(the_packet.param1 - ((the_packet.param1 / 256) * 256))
else:
r = r + chr(the_packet.param1 - ((the_packet.param1 / 256) * 256))
r = r + chr(the_packet.param1 / 256)
r = r + chr(0)
r = r + chr(0)

r = r + the_packet.param2
for i in range(len®, 72):
r = r + chr(0)
r = r + the_packet.param3
for i in range(len®, 136):
r = r + chr(0)
return r

def formatnumber( n ):
if len( n ) == 7:
return "(" + MYAREACODE + ") " + n[:3] + "-" + n[3:]
if len( n ) == 10:
return "(" + n[:3] + ") " + n[3:6] + "-" + n[6:]
if len( n ) == 11:
return n[0] + " (" + n[1:4] + ") " + n[4:7] + "-" + n[7:]
return n

def fileExists(f):
try:
file = open(f)
except IOError:
exists = 0
else:
exists = 1
return exists

class initialise(xbmcgui.WindowDialog):

def __init__(self):
if EMULATING: xbmcgui.Window.__init__(self)

w = self.getWidth()
h = self.getHeight()

self.a = -1
self.shown = 1

self.titleBlack = xbmcgui.ControlLabel(w - (275+xOffset), h - (133+yOffset), 150, 10, 'Caller ID Active', 'font13', '0xff000000')
self.titleWhite = xbmcgui.ControlLabel(w - 275, h - 133, 150, 10, 'Caller ID Active', 'font13', '0xffffffff')
self.addControl(self.titleBlack)
self.addControl(self.titleWhite)

subThread = threading.Thread(target=self.SubthreadProc, args=())
subThread.start()

def SubthreadProc(self):
sleep(1)
if self.shown:
self.shown = 0
self.close()

def onAction(self, action):
if self.a == action:
self.shown = 0
self.close()
self.a = action

class caller(xbmcgui.WindowDialog):

def __init__(self):
if EMULATING:
xbmcgui.Window.__init__(self)

w = self.getWidth()
h = self.getHeight()


if name != "": nametodisplay = name
if name == "NO NAME" or name == "": nametodisplay = number
if name == "" and number == "": nametodisplay = data
if location != "": nametodisplay = nametodisplay + "\n" + location

if number != "": numbertodisplay = number
if number == "NO number" or number == "": numbertodisplay = name
if number == "" and number == "": numbertodisplay = data
if location != "": numbertodisplay = numbertodisplay + "\n" + location



self.bg = xbmcgui.ControlImage(w - 282, h - 838, 222, 103, SCRIPTFOLDER + "\\Dialog\\dialog.png")
self.addControl(self.bg)
self.callerid = xbmcgui.ControlLabel(w - 275, h - 795, 151, 64, nametodisplay, 'font13', '0xFFFFFFFF')
self.addControl(self.callerid)
self.callerid = xbmcgui.ControlLabel(w - 275, h - 775, 151, 64, numbertodisplay, 'font13', '0xFFFFFFFF')
self.addControl(self.callerid)
if not DOIMAGE:
self.title = xbmcgui.ControlLabel(w - 277, h - 133, 222, 10, boxtitle, 'font13', '0xffffffff')
self.addControl(self.title)
else:
self.frame = xbmcgui.ControlImage(w - 359, h - 838, 77, 103, SCRIPTFOLDER + "\\Dialog\\frame.png")
self.addControl(self.frame)
self.title = xbmcgui.ControlLabel(w - 354, h - 833, 222, 10, boxtitle, 'font13', '0xffffffff')
self.addControl(self.title)

filename = replace(number, '(', '')
filename = replace(filename, ')', '')
filename = replace(filename, ' ', '')
filename = replace(filename, '-', '')
filename = SCRIPTFOLDER + "\\Pictures\\" + filename + '.png'

if not fileExists(filename): filename = SCRIPTFOLDER + "\\Pictures\\default.png"
self.tn = xbmcgui.ControlImage(w - 359, h - 812, 77, 77, filename)
self.addControl(self.tn)

self.a = -1
self.shown = 1

if (EMULATING):
sleep(1)
else:
if (DOPAUSE and xbmc.Player().isPlaying()):
value1 = xbmc.Player().getTime()
sleep(1)
value2 = xbmc.Player().getTime()
if value1 != value2:
xbmc.Player().pause()
if DOSOUND: xbmc.playSFX(SCRIPTFOLDER + "\\Sounds\\" + SOUNDFILE)

subThread = threading.Thread(target=self.SubthreadProc, args=())
subThread.start()

def SubthreadProc(self):
sleep(DELAY)
if self.shown:
self.shown = 0
self.close()

def onAction(self, action):
if self.a == action:
self.shown = 0
self.close()
self.a = action

if SERVERTYPE == "YAC":
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind((HOST, YACPORT))


data = ""
name = ""
number = ""
boxtitle = OSDTITLE
picurl = ""
location = ""

if not EMULATING and DOINITMSG:
w = initialise()
w.doModal()
del w

while 1:
if SERVERTYPE == "YAC":
s.listen(1)
conn, addr = s.accept()
a = conn.recv(1024)
alist = split(a[5:], "~")
if len(alist) > 1:
name = alist[0]
number = alist[1]
data = name + "\n" + number

if picurl != "":
tmppicurl = replace(number, '(', '')
tmppicurl = replace(tmppicurl , ')', '')
tmppicurl = replace(tmppicurl , ' ', '')
tmppicurl = replace(tmppicurl , '-', '')
urllib.urlretrieve(picurl, SCRIPTFOLDER + "\\Pictures\\" + tmppicurl + ".png")


if data != "":
print(data)
w = caller()
w.doModal()
del w
if SERVERTYPE == "YAC": conn.close()
data = ""
name = ""
number = ""
boxtitle = OSDTITLE
picurl = ""
location = ""
Here is working script for 9.11 I have fixed the non displaying phone number problem!
Been searching high and low for a CID plugin/addon for XBMC.. Nothing at all in the official addons, but I saw this post, and others which reference/are from the same author, and wondering/hoping someone might be able to get it working with the newest version of XBMC..

I tried copy/pasting what the author said will work with the 9.1.x series, and it's not working (it actually causes an error when I try to run it from programs, whereas the original download script said it was started, but did nothing).

I have YAC installed properly and can verify it works, it just doesn't seem to be linking up to XBMC by this callerid script. Help? Thanks in advance,

exit151
I'm Very sorry for the delay in posting the modified script after i had promised an updated version , life has thrown me a curveball and havent had the chance to work on this, things should start calming down for the me in the next 2-3 weeks hopefully and i'll re-visit the script.

-Phil

exit151 Wrote:Been searching high and low for a CID plugin/addon for XBMC.. Nothing at all in the official addons, but I saw this post, and others which reference/are from the same author, and wondering/hoping someone might be able to get it working with the newest version of XBMC..

I tried copy/pasting what the author said will work with the 9.1.x series, and it's not working (it actually causes an error when I try to run it from programs, whereas the original download script said it was started, but did nothing).

I have YAC installed properly and can verify it works, it just doesn't seem to be linking up to XBMC by this callerid script. Help? Thanks in advance,

exit151
No worries, just wanted to make sure it wasn't just me Smile

Only question I have is will it show up on the in-xbmc addons (or update button active), or do I need to keep watching this thread for an update? Just wanna know where to keep my eyes peeled for the update Smile Thanks in advance for your time, I really appreciate it, as do others, I'm sure!
I will post the beta version of the modified script on the forums once i do a little tweaking its been a while since i've had time to even think of entertainment, i decided to revamp this old script because i still have a housephone (using ooma VOIP service) and i would love to display it when i am browsing around or watching something in xbmc.

Once im happy there is no glitches, i will try to take steps to get it published. Not many of the script authors are interested in spending there time on a script like this cause more and more people are getting rid of their landline phones.

I miss my XBMC machines (they've been sitting idle for too long) hopefully things in my life will calm down over the next few weeks, and i can not only spend time doing scripting but i could enjoy the benefits of it as well! Smile
Pages: 1 2 3 4