96_SIP : add support for Text2Speech (Forum #60411)

git-svn-id: https://svn.fhem.de/fhem/trunk@13695 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
Wzut 2017-03-13 19:40:07 +00:00
parent 1262f26d08
commit 469c27bced

View File

@ -140,19 +140,20 @@ sub SIP_Attr (@)
my ($cmd, $name, $attrName, $attrVal) = @_; my ($cmd, $name, $attrName, $attrVal) = @_;
my $hash = $defs{$name}; my $hash = $defs{$name};
#Log3 $name,5,"$name , SIP_Attr : $cmd, $attrName, $attrVal";
if ($cmd eq "set") if ($cmd eq "set")
{ {
if (substr($attrName ,0.4) eq "sip_") if (substr($attrName ,0,4) eq "sip_")
{ {
$_[3] = $attrVal; $_[3] = $attrVal;
$hash->{".reset"} = 1 if ($hash->{LPID} && ($attrName ne "sip_audiofile_call") && ($attrName ne "sip_dtmf_send")); $hash->{".reset"} = 1 if defined($hash->{LPID});
} }
elsif (($attrName eq "disable") && ($attrVal == 1)) elsif (($attrName eq "disable") && ($attrVal == 1))
{ {
readingsSingleUpdate($hash,"state","disabled",1); readingsSingleUpdate($hash,"state","disabled",1);
$_[3] = $attrVal; $_[3] = $attrVal;
$hash->{".reset"} = 1 if $hash->{LPID}; $hash->{".reset"} = 1 if defined($hash->{LPID});
} }
elsif ($attrName eq "audio_converter") elsif ($attrName eq "audio_converter")
{ {
@ -169,10 +170,10 @@ sub SIP_Attr (@)
} }
elsif ($cmd eq "del") elsif ($cmd eq "del")
{ {
if (substr($attrName,0.4) eq "sip_") if (substr($attrName,0,4) eq "sip_")
{ {
$_[3] = $attrVal; $_[3] = $attrVal;
$hash->{".reset"} = 1 if ($hash->{LPID} && ($attrName ne "sip_audiofile_call") && ($attrName ne "sip_dtmf_send")); $hash->{".reset"} = 1 if defined($hash->{LPID});
} }
elsif ($attrName eq "audio_converter") elsif ($attrName eq "audio_converter")
{ {
@ -187,7 +188,11 @@ sub SIP_Attr (@)
} }
SIP_updateConfig($hash) if ($hash->{".reset"}); if ($hash->{".reset"})
{
Log3 $name,5,"$name , SIP_Attr : reset";
SIP_updateConfig($hash);
}
return undef; return undef;
} }