From 33d4509fc85cda5af114c50c9eb70dc40a0eb645 Mon Sep 17 00:00:00 2001 From: markusbloch <> Date: Sun, 20 Jul 2014 09:39:07 +0000 Subject: [PATCH] FB_CALLMONITOR: generate call_id at last as it was before git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@6283 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- FHEM/72_FB_CALLMONITOR.pm | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/FHEM/72_FB_CALLMONITOR.pm b/FHEM/72_FB_CALLMONITOR.pm index f17344ecc..576e4eb7b 100755 --- a/FHEM/72_FB_CALLMONITOR.pm +++ b/FHEM/72_FB_CALLMONITOR.pm @@ -237,15 +237,7 @@ FB_CALLMONITOR_Read($) if($array[1] eq "CALL" or $array[1] eq "RING") { delete($hash->{helper}{TEMP}{$array[2]}) if(exists($hash->{helper}{TEMP}{$array[2]})); - - if(AttrVal($name, "unique-call-ids", "0") eq "1") - { - $hash->{helper}{TEMP}{$array[2]}{call_id}= Digest::MD5::md5_hex($data); - } - else - { - $hash->{helper}{TEMP}{$array[2]}{call_id} = $array[2]; - } + } if($array[1] eq "CALL") @@ -296,6 +288,15 @@ FB_CALLMONITOR_Read($) delete($hash->{helper}{TEMP}{$array[2]}) if(exists($hash->{helper}{TEMP}{$array[2]})); } + if(AttrVal($name, "unique-call-ids", "0") eq "1") + { + readingsBulkUpdate($hash, "call_id" ,Digest::MD5::md5_hex($data)); + } + else + { + readingsBulkUpdate($hash, "call_id", $array[2]); + } + readingsEndUpdate($hash, 1); }