Hi Monster_Inc,
erstmal vielen Dank für Deinen support!
Meine Media-PCs haben seit jeher feste IP-Adressen, unter denen ich sie anspreche. Mit den in FritzBox eingetragenen Namen arbeite ich nicht. Ich habe deshalb Dein Script wie folgt umgesetzt:
set TITLE
set TEXT
set TIMEOUT
set ID
set UID
send_request() {
REQUEST="..."
HOSTS="192.168.20.100 192.168.20.101 192.168.20.102 192.168.20.103 192.168.20.104"
for h in $HOSTS
do
curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d "$REQUEST" http://%24h/jsonrpc
done
}
# Eingehender Anruf
incoming() {
TITLE="Eingehender Anruf"
TEXT="$SOURCE_NAME ($SOURCE)"
TIMEOUT=20
UID="$SOURCE"
send_request
}
# Ausgehender Anruf
outgoing() {
TITLE="Ausgehender Anruf"
TEXT="$DEST_NAME ($DEST)"
TIMEOUT=20
UID="$DEST"
send_request
}
# Verbindung hergestellt
connect_in() {
TITLE="Verbunden"
TEXT="$SOURCE_NAME ($SOURCE)"
TIMEOUT=5
UID="$SOURCE"
send_request
}
connect_out() {
TITLE="Verbunden"
TEXT="$DEST_NAME ($DEST)"
TIMEOUT=5
UID="$DEST"
send_request
}
# Verbindung getrennt
disconnected() {
TITLE="Anruf beendet"
TEXT="Anrufdauer: $(f_duration $DURATION)"
TIMEOUT=10
send_request
}
# Eingehender Anruf abgebrochen (aufgelegt?)
incoming_canceled() {
TITLE="Anrufer hat aufgelegt"
TEXT="$SOURCE_NAME ($SOURCE)"
TIMEOUT=20
UID="$SOURCE"
send_request
}
# Ausgehender Anruf abgebrochen (aufgelegt?)
outgoing_canceled() {
TITLE="Anruf abgebrochen"
TEXT="$DEST_NAME ($DEST)"
TIMEOUT=5
UID="$DEST"
send_request
}
Ich habe es im Windows-Editor geschrieben. Danach habe ich in der Telnet-Verbindung das alte Script gelöscht und dann ein neues mit vi erstellt. Dort habe ich copy&paste der Zeilen aus dem Word-Editor vorgenommen.. Das scheint prinzipiell zu klappen, da es die Fehlermeldungen bzgl. "linx xyz not found" oder ähnliches nicht mehr gibt. Trotzdem werden mir keine Anrufe auf den Media-PCs signalisiert. Wenn ich den testanruf unter Freetz ausführe, bekomme ich folgende Meldung:
including /usr/lib/callmonitor/actions.d/config.sh
including /usr/lib/callmonitor/actions.d/dboxlcd.sh
including /usr/lib/callmonitor/actions.d/dial.sh
including /usr/lib/callmonitor/actions.d/mail.sh
including /usr/lib/callmonitor/actions.d/messages.sh
including /usr/lib/callmonitor/actions.d/musicpal.sh
including /usr/lib/callmonitor/actions.d/rc.sh
including /usr/lib/callmonitor/actions.d/roku.sh
including /usr/lib/callmonitor/actions.d/samsung.sh
including /var/tmp/flash/callmonitor/actions.local.d/xbmccalls.sh
/usr/sbin/callmonitor-test: /mod/pkg/callmonitor/usr/lib/callmonitor/actions.local.d/xbmccalls.sh: line 1: et: not found
>>> in:request ID=1 TIMESTAMP=04.03.13 08:23 SOURCE=123456 DEST=902733 EXT=4 DURATION=16 PROVIDER=
[0] event detected:
EVENT=in:request
SOURCE='123456'
DEST='902733'
[0+] detailed event data:
SOURCE_DISP='123456'
SOURCE_ENTRY=''
SOURCE_NAME=''
SOURCE_ADDRESS=''
DEST_DISP='902733'
DEST_ENTRY=''
DEST_NAME=''
DEST_ADDRESS=''
ID=1
EXT=4
DURATION=16
TIMESTAMP='04.03.13 08:23'
PROVIDER=
[0:2] processing rule 'in:request' '^' '^' 'incoming'
[0:2] event 'in:request' matches pattern 'in:request'
[0:2] parameter SOURCE='123456' matches pattern '^'
[0:2] parameter DEST='902733' matches pattern '^'
[0:2] SUCCEEDED
[0:2] ACTION: 'incoming'
/usr/sbin/callmonitor-test: eval: line 1: curl: not found
/usr/sbin/callmonitor-test: eval: line 1: curl: not found
/usr/sbin/callmonitor-test: eval: line 1: curl: not found
/usr/sbin/callmonitor-test: eval: line 1: curl: not found
/usr/sbin/callmonitor-test: eval: line 1: curl: not found
[0:2] listener failed with an exit status of 127
[0:3] processing rule 'out:request' '^' '^' 'outgoing'
[0:3] event 'in:request' does NOT match pattern 'out:request'
[0:3] FAILED
[0:0] processing rule 'in:request' '^...11.....9$' '^' 'ether-wake -b 00:26:18:7E:8D:1C'
[0:0] event 'in:request' matches pattern 'in:request'
[0:1] processing rule 'in:request' '^...11.....9$' '^' 'ether-wake -b 00:01:2E:2B:23:C4'
[0:1] event 'in:request' matches pattern 'in:request'
[0:5] processing rule 'out:connect' '^' '^' 'connect_out'
[0:5] event 'in:request' does NOT match pattern 'out:connect'
[0:5] FAILED
[0:6] processing rule 'in:cancel' '^' '^' 'incoming_canceled'
[0:6] event 'in:request' does NOT match pattern 'in:cancel'
[0:6] FAILED
[0:7] processing rule 'out:cancel' '^' '^' 'outgoing_canceled'
[0:7] event 'in:request' does NOT match pattern 'out:cancel'
[0:7] FAILED
[0:8] processing rule '*:disconnect' '^' '^' 'disconnected'
[0:8] event 'in:request' does NOT match pattern '*:disconnect'
[0:8] FAILED
[0:4] processing rule 'in:connect' '^' '^' 'connect_in'
[0:4] event 'in:request' does NOT match pattern 'in:connect'
[0:4] FAILED
Irgendeine Idee, was ich Ändern sollte?
Viele Grüße!
FantasticN