Index: /trunk/I_FritzBox.xml
===================================================================
--- /trunk/I_FritzBox.xml	(revision 3)
+++ /trunk/I_FritzBox.xml	(revision 3)
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<implementation>
+    <settings>
+        <protocol>crlf</protocol>
+    </settings>
+    <functions>
+		--
+		--  Created by Henrik Ekblad
+		--  henrik.ekblad at gmail com 
+		--
+		
+        function initialize( deviceId )
+			selfId = 'urn:hek:deviceId:FritzBox1'
+			serviceId = 'urn:hek:serviceId:FritzBox1'
+   
+			ipAddress = luup.devices[deviceId].ip;
+			if ( ipAddress == nil ) or ( ipAddress == '' ) then
+				ipAddress = '192.168.178.1';
+				luup.attr_set("ip", ipAddress, deviceId);
+			end
+
+			luup.log("FritzBox: Starting ... device #"..tostring(deviceId).." starting up with id "..luup.devices[deviceId].id)
+			luup.io.open( FritzBox_handle, ipAddress, 1012 )
+        end
+		
+		-- splits a string by a pattern
+		-- returns an array of the pieces
+		function string:split(delimiter)
+			local result = { }
+			local from  = 1
+			local delim_from, delim_to = string.find( self, delimiter, from  )
+			while delim_from do
+				table.insert( result, string.sub( self, from , delim_from-1 ) )
+				from  = delim_to + 1
+				delim_from, delim_to = string.find( self, delimiter, from  )
+			end
+			table.insert( result, string.sub( self, from  ) )
+			return result
+		end
+
+    </functions>
+    <incoming>
+        <lua>
+			local data = tostring(lul_data):split(";")
+			local action = data[2]
+			local phone = ""
+			if action == "CALL" then
+				phone = data[6]
+			elseif (action == "RING") or (action == "DISCONNECT") then
+				phone = data[5]
+			end		
+	
+			luup.variable_set( serviceId, "Action", action, deviceId)
+			luup.variable_set( serviceId, "Phone", phone, deviceId)
+       </lua>
+    </incoming>
+    <startup>initialize</startup>
+</implementation>
Index: /trunk/D_FritzBox.json
===================================================================
--- /trunk/D_FritzBox.json	(revision 3)
+++ /trunk/D_FritzBox.json	(revision 3)
@@ -0,0 +1,179 @@
+{
+    "flashicon": "icons\/fbiconsmall.png",
+    "imgIconBody": "",
+    "imgIconDimmable": "",
+    "imgIconTurnable": "",
+    "imgIconMin": "",
+    "imgIconMax": "",
+    "halloIconsDir": "pics\/hallo",
+    "DisplayStatus": {},
+    "doc_url": {
+        "doc_forced_url":{
+            "text":"http://code.mios.com/trac/fritzbox/"
+        }
+    },
+    "Tabs": [
+        {
+            "Label": {
+                "lang_tag": "tabname_control",
+                "text": "Control"
+            },
+            "Position": "0",
+            "TabType": "flash",
+            "SceneGroup": [
+                {
+                    "id": "1",
+                    "top": "1",
+                    "left": "0",
+                    "x": "2",
+                    "y": "1"
+                }
+            ],
+            "ControlGroup": [
+                {
+                    "id": "1",
+                    "isSingle": "1",
+                    "scenegroup": "1"
+                }
+            ],
+            "Control": [
+                {
+                    "ControlGroup": "1",
+                    "ControlType": "label",
+                    "Label": {
+                        "lang_tag": "action",
+                        "text": "Action: "
+                    },
+                    "top": "0",
+                    "left": "0",
+		
+                    "Display": {
+                        "Top": 25,
+                        "Left": 50,
+                        "Width": 75,
+                        "Height": 20
+                    }
+                },
+                {
+                    "ControlGroup": "1",
+                    "ControlType": "variable",
+                    "top": "0",
+                    "left": "1",
+                    "Display": {
+                        "Service": "urn:hek:serviceId:FritzBox1",
+                        "Variable": "Action",
+                        "Top": 25,
+                        "Left": 150,
+                        "Width": 175,
+                        "Height": 20
+                    }
+                },
+                {
+                    "ControlGroup": "1",
+                    "ControlType": "label",
+                    "Label": {
+                        "lang_tag": "number",
+                        "text": "Number: "
+                    },
+                    "top": "1",
+                    "left": "0",
+                    "Display": {
+                        "Top": 40,
+                        "Left": 50,
+                        "Width": 75,
+                        "Height": 20
+                    }
+                },
+                {
+                    "ControlGroup": "1",
+                    "ControlType": "variable",
+                    "top": "1",
+                    "left": "1",
+                    "Display": {
+                        "Service": "urn:hek:serviceId:FritzBox1",
+                        "Variable": "Number",
+                        "Top": 40,
+                        "Left": 150,
+                        "Width": 175,
+                        "Height": 20
+                    }
+                }
+            ]
+        },
+        {
+            "Label": {
+                "lang_tag": "notifications",
+                "text": "Notifications" 
+            },
+            "Position": "5",
+            "TabType": "javascript",
+            "ScriptName": "shared.js",
+            "Function": "device_notifications" 
+        },
+        {
+            "Label": {
+                "lang_tag": "advanced",
+                "text": "Advanced" 
+            },
+            "Position": "2",
+            "TabType": "javascript",
+            "ScriptName": "shared.js",
+            "Function": "advanced_device" 
+        } 
+    ],
+    "eventList2": [
+        {
+            "id": 1,
+            "label": {
+                "lang_tag": "event_type",
+                "text": "Action"
+            },
+            "serviceId": "urn:hek:serviceId:FritzBox1",
+            "argumentList" : [
+                {
+                    "id": 1,
+                    "dataType": "string",
+                    "defaultValue": "None",
+                    "allowedValueList" : [
+                        {
+                            "value": "CALL",
+                            "HumanFriendlyText": {
+                                "lang_tag": "outgoing_call",
+                                "text": "Outgoing call"
+                            }
+                        },
+                        {
+                            "value": "RING",
+                            "HumanFriendlyText": {
+                                "lang_tag": "incoming_call",
+                                "text": "Incoming call"
+                            }
+                        },
+                        {
+                            "value": "DISCONNECT",
+                            "HumanFriendlyText": {
+                                "lang_tag": "disconnect",
+                                "text": "Call ended"
+                            }
+                        },
+                        {
+                            "value": "CONNECT",
+                            "HumanFriendlyText": {
+                                "lang_tag": "connect",
+                                "text": "Connect"
+                            }
+                        }
+                    ],
+                    "name": "Action",
+                    "comparisson": "=",
+                    "prefix": {
+                        "lang_tag": "event_type",
+                        "text": "Event type"
+                    },
+                    "suffix": {}
+                }
+            ]
+        }
+    ],
+    "DeviceType": "urn:hek:device:FritzBox:1"
+}
Index: /trunk/S_FritzBox.xml
===================================================================
--- /trunk/S_FritzBox.xml	(revision 3)
+++ /trunk/S_FritzBox.xml	(revision 3)
@@ -0,0 +1,37 @@
+<?xml version="1.0"?>
+<scpd xmlns="urn:schemas-upnp-org:service-1-0">
+  <specVersion>
+    <major>2</major>
+    <minor>0</minor>
+  </specVersion>
+  <serviceStateTable>
+
+  <stateVariable sendEvents="yes" allowRepeats="yes">
+      <name>Action</name>
+      <dataType>string</dataType>
+      <shortCode>action</shortCode>
+      <defaultValue>DISCONNECT</defaultValue>
+      <allowedValueList>
+        <allowedValue>CALL</allowedValue>
+        <allowedValue>RING</allowedValue>
+        <allowedValue>DISCONNECT</allowedValue>
+        <allowedValue>CONNECT</allowedValue>
+      </allowedValueList>
+    </stateVariable>
+
+    <!-- stateVariable sendEvents="yes" allowRepeats="yes">
+      <name>Number</name>
+      <dataType>string</dataType>
+      <shortCode>number</shortCode>
+      <defaultValue></defaultValue> 
+    </stateVariable>
+
+    <stateVariable sendEvents="yes" allowRepeats="yes">
+      <name>Name</name>
+      <dataType>string</dataType>
+      <shortCode>name</shortCode>
+      <defaultValue></defaultValue> 
+    </stateVariable -->
+	
+  </serviceStateTable>
+</scpd>
Index: /trunk/D_FritzBox.xml
===================================================================
--- /trunk/D_FritzBox.xml	(revision 3)
+++ /trunk/D_FritzBox.xml	(revision 3)
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+<root xmlns="urn:schemas-upnp-org:device-1-0">
+  <specVersion>
+    <major>1</major>
+    <minor>0</minor>
+  </specVersion>
+  <device>
+    <deviceType>urn:hek:device:FritzBox:1</deviceType>
+	<staticJson>D_FritzBox.json</staticJson>
+	<serviceList>
+      <service>
+        <serviceType>urn:hek:service:FritzBox:1</serviceType>
+        <serviceId>urn:hek:serviceId:FritzBox1</serviceId>
+        <SCPDURL>S_FritzBox.xml</SCPDURL>
+      </service>
+    </serviceList>
+    <friendlyName>Fritz!Box Call Log</friendlyName>
+    <manufacturer>AVM</manufacturer>
+    <manufacturerURL>http://www.avm.de/</manufacturerURL>
+    <protocol>crlf</protocol>
+    <handleChildren>1</handleChildren>
+    <implementationList>
+        <implementationFile>I_FritzBox.xml</implementationFile>
+    </implementationList>
+  </device>
+</root>
