From 5ecdb1e5dc80bb376bbadd2c5caa8f0bd30bcffe Mon Sep 17 00:00:00 2001
From: tpoitzsch <>
Date: Thu, 25 Jun 2015 07:51:18 +0000
Subject: [PATCH] FRITZBOX: attr allowTR064Command
git-svn-id: https://svn.fhem.de/fhem/trunk@8821 2b470e98-0d58-463d-a4d8-8e2adae1ed80
---
fhem/FHEM/72_FRITZBOX.pm | 51 +++++++++++++++++++++++-----------------
1 file changed, 30 insertions(+), 21 deletions(-)
diff --git a/fhem/FHEM/72_FRITZBOX.pm b/fhem/FHEM/72_FRITZBOX.pm
index 21ac2238c..88fcf7edd 100644
--- a/fhem/FHEM/72_FRITZBOX.pm
+++ b/fhem/FHEM/72_FRITZBOX.pm
@@ -148,6 +148,7 @@ sub FRITZBOX_Initialize($)
$hash->{GetFn} = "FRITZBOX_Get";
$hash->{AttrFn} = "FRITZBOX_Attr";
$hash->{AttrList} = "allowShellCommand:0,1 "
+ ."allowTR064Command:0,1 "
."boxUser "
."disable:0,1 "
."defaultCallerName "
@@ -513,22 +514,22 @@ sub FRITZBOX_Get($@)
$returnStr .= join "\n", sort values %ringTone;
return $returnStr;
}
- elsif (lc $cmd eq "tr064response") {
+ elsif (lc $cmd eq "tr064command" && AttrVal( $name, "allowTR064Command", 0 )) {
# http://fritz.box:49000/tr64desc.xml
-#get Fritzbox tr064response DeviceInfo:1 deviceinfo GetInfo
-#get Fritzbox tr064response X_VoIP:1 x_voip X_AVM-DE_GetPhonePort NewIndex 1
-#get Fritzbox tr064response X_VoIP:1 x_voip X_AVM-DE_DialNumber NewX_AVM-DE_PhoneNumber **612
-#get Fritzbox tr064response X_VoIP:1 x_voip X_AVM-DE_DialHangup
-#get Fritzbox tr064response WLANConfiguration:3 wlanconfig3 X_AVM-DE_GetWLANExtInfo
-#get Fritzbox tr064response X_AVM-DE_OnTel:1 x_contact GetDECTHandsetList
-#get Fritzbox tr064response X_AVM-DE_OnTel:1 x_contact GetDECTHandsetInfo NewDectID 1
-#get Fritzbox tr064response X_AVM-DE_TAM:1 x_tam GetInfo NewIndex 0
-#get Fritzbox tr064response X_AVM-DE_TAM:1 x_tam SetEnable NewIndex 0 NewEnable 0
-#get Fritzbox tr064response InternetGatewayDevice:1 deviceinfo GetInfo
-#get Fritzbox tr064response LANEthernetInterfaceConfig:1 lanethernetifcfg GetStatistics
+#get Fritzbox tr064command DeviceInfo:1 deviceinfo GetInfo
+#get Fritzbox tr064command X_VoIP:1 x_voip X_AVM-DE_GetPhonePort NewIndex 1
+#get Fritzbox tr064command X_VoIP:1 x_voip X_AVM-DE_DialNumber NewX_AVM-DE_PhoneNumber **612
+#get Fritzbox tr064command X_VoIP:1 x_voip X_AVM-DE_DialHangup
+#get Fritzbox tr064command WLANConfiguration:3 wlanconfig3 X_AVM-DE_GetWLANExtInfo
+#get Fritzbox tr064command X_AVM-DE_OnTel:1 x_contact GetDECTHandsetList
+#get Fritzbox tr064command X_AVM-DE_OnTel:1 x_contact GetDECTHandsetInfo NewDectID 1
+#get Fritzbox tr064command X_AVM-DE_TAM:1 x_tam GetInfo NewIndex 0
+#get Fritzbox tr064command X_AVM-DE_TAM:1 x_tam SetEnable NewIndex 0 NewEnable 0
+#get Fritzbox tr064command InternetGatewayDevice:1 deviceinfo GetInfo
+#get Fritzbox tr064command LANEthernetInterfaceConfig:1 lanethernetifcfg GetStatistics
Log3 $name, 3, "FRITZBOX: get $name $cmd ".join(" ", @val);
- return "Wrong number of arguments, usage: get $name tr064response service control action [parameterName1 parameterValue1] [parameterName2 parameterValue2] ..."
+ return "Wrong number of arguments, usage: get $name tr064command service control action [parameterName1 parameterValue1] [parameterName2 parameterValue2] ..."
if int @val <3 || int(@val) %2 !=1;
$returnStr = "Result of TR064 call\n";
@@ -550,10 +551,9 @@ sub FRITZBOX_Get($@)
return FRITZBOX_Exec( $hash, $shCmd );
}
- my $list = "ringTones:noArg"
- . " tr064Response";
- $list .= " shellCommand"
- if AttrVal( $name, "allowShellCommand", 0 );
+ my $list = "ringTones:noArg";
+ $list .= " tr064Command" if AttrVal( $name, "allowTr064Command", 0 );
+ $list .= " shellCommand" if AttrVal( $name, "allowShellCommand", 0 );
return "Unknown argument $cmd, choose one of $list";
} # end FRITZBOX_Get
@@ -3988,11 +3988,13 @@ sub FRITZBOX_fritztris($)
Only available if the attribute "allowShellCommand" is set.
-
get <name> tr064Response <service> <control> <action> [[parameterName1 parameterValue1] ...]
+ get <name> tr064Command <service> <control> <action> [[parameterName1 parameterValue1] ...]
get Fritzbox tr064response X_AVM-DE_OnTel:1 x_contact GetDECTHandsetInfo NewDectID 1
+ Example: get Fritzbox tr064Command X_AVM-DE_OnTel:1 x_contact GetDECTHandsetInfo NewDectID 1
+ get <name> tr064Response <service> <control> <action> [[parameterName1 parameterValue1] ...]
+ get <name> tr064Command <service> <control> <action> [[parameterName1 parameterValue1] ...]
get Fritzbox tr064Response X_AVM-DE_OnTel:1 x_contact GetDECTHandsetInfo NewDectID 1
+ Beispiel: get Fritzbox tr064Command X_AVM-DE_OnTel:1 x_contact GetDECTHandsetInfo NewDectID 1
+ allowShellCommand <0 | 1>
+ defaultCallerName <Text>