FB_CALLMONITOR: generate call_id at last as it was before

git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@6283 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
markusbloch
2014-07-20 09:39:07 +00:00
parent f960cfbd54
commit 27f816bc02

View File

@@ -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);
}