The UK Home Automation Archive

Archive Home
Group Home
Search Archive


Advanced Search

The UKHA-ARCHIVE IS CEASING OPERATIONS 31 DEC 2024


[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]

an xPL worked example, was : STX...ETX (long)


  • Subject: an xPL worked example, was : STX...ETX (long)
  • From: Ian Lowe
  • Date: Sun, 11 May 2003 13:34:00 +0000

Here's a sequence of interactions:

ISDNCID picks up an incoming call, and sends this:

xpl-trig
{
hop=1
source=WMUTE-SENDER.ISDNCID
target=*
}
CID.ISDNCID
{
CALLTYPE=Inbound
PHONE=<my phone number removed>
NAME=IAN'S MOBILE
CALLED=30
TIME=13:38:43
DATE=11/05/2003
ISDNMSN=2
STATUS=Call Start
}

xplhal, the scripting engine picks this event up, and runs the following
script file: (this is a simple version of the script, which doesn't have
any
"working hours" settings)

' source script for WMUTE-SENDER.ISDNCID

Sub WMUTE_SENDER_ISDNCID_Trigger(xPLMessage)

'Where is the call coming from?
select case xpl.getparam(xplmessage,"CALLED",True)
case "30"
calltype="Personal Call From: "
case "31"
calltype="Business Call From: "
end select

'Mute the Office Speakers
slidercmd = "SLIDER=MASTER"+chr(10)+"MUTE=YES"
call
xpl.sendmsg("","","SLIDER.BASIC",slidercmd)

'Then OSD Display the Caller Details
friendly = "TEXT=" + calltype
friendly = friendly + xpl.getparam(xplmessage,"NAME",True)

rawnum="TEXT2=" +
xpl.getparam(xplmessage,"REASON",True)
rawnum = rawnum + " ("
rawnum = rawnum + xpl.getparam(xplmessage,"PHONE",True)
rawnum = rawnum + ")"

newcmd = friendly + chr(10) + rawnum
call xpl.sendmsg("","","OSD.BASIC",newcmd)
End Sub

This simple vbscript does two major things: mutes the sound in our office,
and displays the incoming call details on the OSD devices (at this time, a
VFD, a Slimp3, and Tivo) in the house.

The mute message looks like this:

xpl-cmnd
{
hop=1
source=xpl-xplhal.turing
target=*
}
SLIDER.BASIC
{
SLIDER=MASTER
MUTE=YES
}

This is picked up by the app I wrote as a replacement for the windows
volume
control applet, and mutes the sound on myself and Jenni's PCs.

The OSD message sent looks like this:

xpl-cmnd
{
hop=1
source=xpl-xplhal.turing
target=*
}
OSD.BASIC
{
TEXT=Personal Call From: IAN'S MOBILE
TEXT2= (<number removed>)
}

This displays as <a href="http://www.wintermute-ltd.com/vfd.jpg";>http://www.wintermute-ltd.com/vfd.jpg</a>
(which has my mobile
number included, lol)

Another version of the script adds a DELAY= tag to the OSD message, which
simply specifies the number of seconds the message is displayed for...

I'm going out now for a bit, but I hope this helps!

Ian.









xPL Main Index | xPL Thread Index | xPL Home | Archives Home

Comments to the Webmaster are always welcomed, please use this contact form . Note that as this site is a mailing list archive, the Webmaster has no control over the contents of the messages. Comments about message content should be directed to the relevant mailing list.