For compilation, libxml2, and libxslt are required. Both were
available on my default redhat 9 installation.

MythTV UDP Relay

This program receives an XML structure over UDP. It then
applies an XSLT (XSL transformation). The resultant XML structure
is broadcast over UDP using a different port.

As an example, suppose you want to support caller ID. An OSD theme design
needs to have a container/textarea allocated to put your caller ID info.

In the osd.xml file there should be something like this to contain the
caller ID information:

(portion of osd.xml)

  <font name="notifyfont">
    <color>255</color>
    <size>12</size>
    <outline>no</outline>
  </font>

  <container name="notify_cid_info" priority="10" fademovement="0,6">
    <image name="background">
      <filename>osd-callerid.png</filename>
      <position>0,200</position>
    </image>
    <textarea name="notify_cid_name">
      <area>410,210,200,30</area>
      <font>notifyfont</font>
      <multiline>no</multiline>
    </textarea>
    <textarea name="notify_cid_num">
      <area>410,240,200,30</area>
      <font>notifyfont</font>
      <multiline>no</multiline>
    </textarea>
  </container>


The RESULT of the XSLT transformation should like something like:

<mythnotify version="1">
  <container name="notify_cid_info">
    <textarea name="notify_cid_name">
      <value>NAME: %caller_name%</value>
    </textarea>
    <textarea name="notify_cid_num">
      <value>NUM : %caller_num%</value>
    </textarea>
  </container>
</mythnotify>


Be sure the container names / textarea names correspond to the osd.xml

The included callerid.xsl XSLT file transforms input XML below into the 
format needed by mythtvnotify:

<telephone-event type="callerID" TTY="ttyS0">
  <time stamp="1063853301" zone="EDT" daylight-savings="1" second="21" minute="4
8" hour="22" day="17" month="9" year="2003">Wed Sep 17 22:48:21 2003</time>
  <ring-type>1</ring-type>
  <from>
    <name>JOE SCHMOE</name>
    <number>3015551212</number>
  </from>
</telephone-event>

Of course the callerid.xsl could be modified to extract whatever fields
you are interested in and display them on the OSD.

The provided XSLT works in conjunction with the cidbcast program. 
The cidbcast program generates an XML 'event' in the above format.

TODO: This program process one type of event. With a little bit of work, a
configuration file should be added that specifies 'input udp port',
'output udp port' and the 'xslt file'. This would allow multiple events to be 
received and transformed to mythnotify events.

Example:

./mythudprelay --xslfile=callerid.xsl --bcast="255.255.255.255" --udpport_in=6947 --udpport_out=6948

