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]

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


  • Subject: Re: an xPL worked example, was : STX...ETX (long)
  • From: Steve B
  • Date: Sun, 11 May 2003 14:05:00 +0000

<blockquote type="cite" class="cite" cite>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)
&nbsp;&nbsp;&nbsp; 'Where is the call coming from?
&nbsp;&nbsp;&nbsp; select case
xpl.getparam(xplmessage,"CALLED",True)
&nbsp;&nbsp;&nbsp; case "30"
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
calltype="Personal Call
From: "
&nbsp;&nbsp;&nbsp; case "31"
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
calltype="Business Call
From: "
&nbsp;&nbsp;&nbsp; end select
&nbsp;&nbsp;&nbsp; 'Mute the Office Speakers
&nbsp;&nbsp;&nbsp; slidercmd =
"SLIDER=MASTER"+chr(10)+"MUTE=YES"
&nbsp;&nbsp;&nbsp; call
xpl.sendmsg("","","SLIDER.BASIC",slidercmd)
&nbsp;&nbsp;&nbsp; 'Then OSD Display the Caller Details
&nbsp;&nbsp;&nbsp; friendly = "TEXT=" + calltype
&nbsp;&nbsp;&nbsp; friendly = friendly +
xpl.getparam(xplmessage,"NAME",True)
&nbsp;&nbsp;&nbsp; rawnum="TEXT2=" +
xpl.getparam(xplmessage,"REASON",True)
&nbsp;&nbsp;&nbsp; rawnum = rawnum + " ("
&nbsp;&nbsp;&nbsp; rawnum = rawnum +
xpl.getparam(xplmessage,"PHONE",True)
&nbsp;&nbsp;&nbsp; rawnum = rawnum + ")"
&nbsp;&nbsp;&nbsp; newcmd = friendly + chr(10) + rawnum
&nbsp;&nbsp;&nbsp; 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>&nbsp;
(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.