2005-04-15, 21:38
a good reason as any :d too bad i just found out the hard way my modem wont display caller id it would have been fun to have
import socket
import xbmc, xbmcgui, threading, thread, os, urllib
from time import *
from string import *
try:
# Modification by Matt Collinge.
# Allows us to test this script on a PC running the XBMC emulator & Python.
EMULATING = xbmcgui.Emulating
SCRIPTFOLDER = "c:\\win32app\\Python24\\CallerId"
except:
EMULATING = False
SCRIPTFOLDER = os.getcwd()[:-1]
MYAREACODE = "0113" # SPECIFY YOUR AREA CODE
DOPAUSE = 1 # PAUSE PLAYBACK ON INCOMING CALL?
DOINITMSG = 1 # SHOW AN INITIALISATION MESSAGE WHEN SCRIPT STARTS
DOLOG = 0 # SPECIFY WHETHER OR NOT TO WRITE TO LOG
DOIMAGE = 1 # SPECIFY WHETHER OR NOT TO DISPLAY PICTURE WITH DIALOG
DOSOUND = 1 # SPECIFY WHETHER TO PLAY A SOUND
DELAY = 6 # SPECIFY DELAY BEFORE CLOSE IN SECONDS
SERVERTYPE = "YAC" # SPECIFY EITHER "YAC", "SWITCHBOARD", "CIDSENTRY" OR "IMPULSE"
OSDTITLE = "Telephone Call" # TITLE TO SHOW ON INCOMING CALL DIALOG
SOUNDFILE = "incoming-a.wav" # WAV FILE TO PLAY IF DOSOUND IS ENABLED
try:
LOG_FILE.close()
except Exception:
pass
if DOLOG:
LOG_FILE = open(SCRIPTFOLDER+"\\log.txt",'w')
def LOG(message):
if DOLOG:
LOG_FILE.write(str(message)+"\n")
LOG_FILE.flush()
def LOGCLOSE():
if DOLOG:
LOG_FILE.close()
YACPORT = 10629 # SPECIFY PORT FOR YAC
CIDSENTRYPORT = 4550 # SPECIFY PORT FOR CALLER ID SENTRY
CIDSENTRYIP = "192.168.0.49" # SPECIFY IP ADDRESS FOR CALLER ID SENTRY SERVER
IMPULSEPORT = 42685 # SPECIFY PORT FOR IMPULSE
SWITCHBOARDPORT = 36390 # SPECIFT PORT FOR SWITCHBOARD
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.