2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-05-05 08:20:23 +00:00

96_SIP.pm : fix attr sip_audiofile_call value must be a audio file

git-svn-id: https://svn.fhem.de/fhem/trunk@15715 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
Wzut 2017-12-29 07:33:27 +00:00
parent 6270a026e4
commit a6f832f9f0

View File

@ -1,6 +1,6 @@
############################################################################### ###############################################################################
# #
# $Id:17-10-30 13:41:59Z Wzut $ # $Id$
# 96_SIP.pm # 96_SIP.pm
# Based on FB_SIP from werner.meines@web.de # Based on FB_SIP from werner.meines@web.de
# #
@ -54,7 +54,7 @@ use Net::Domain qw(hostname hostfqdn);
use Blocking; # http://www.fhemwiki.de/wiki/Blocking_Call use Blocking; # http://www.fhemwiki.de/wiki/Blocking_Call
#use Data::Dumper; #use Data::Dumper;
my $sip_version ="V1.71 / 16.12.17"; my $sip_version ="V1.72 / 29.12.17";
my $ua; # SIP user agent my $ua; # SIP user agent
my @fifo; my @fifo;
@ -173,7 +173,11 @@ sub SIP_Attr (@)
if ($cmd eq "set") if ($cmd eq "set")
{ {
if (substr($attrName ,0,4) eq "sip_") if ($attrName eq "sip_audiofile_call")
{
return "unknown audio type, please use only .alaw or .ulaw" if (($attrVal !~ /\.al(.+)$/) && ($attrVal !~ /\.ul(.+)$/));
}
elsif (substr($attrName ,0,4) eq "sip_")
{ {
$_[3] = $attrVal; $_[3] = $attrVal;
$hash->{".reset"} = 1 if defined($hash->{LPID}); $hash->{".reset"} = 1 if defined($hash->{LPID});
@ -766,6 +770,11 @@ sub SIP_Set($@)
return undef; return undef;
} }
if (AttrVal($name, "sip_audiofile_call", "") && !defined($a[4]))
{
return "unknown audio type, please use only .alaw or .ulaw" if (($msg !~ /\.al(.+)$/) && ($msg !~ /\.ul(.+)$/));
}
my $anz = @a; my $anz = @a;
$anz--; # letztes Element $anz--; # letztes Element
@ -1756,7 +1765,10 @@ sub SIP_rBU($$) {
<h3>SIP</h3> <h3>SIP</h3>
<ul> <ul>
Define a SIP-Client device. Define a SIP-Client device.<br>
Wiki : <a href="https://wiki.fhem.de/wiki/SIP-Client">https://wiki.fhem.de/wiki/SIP-Client</a>
<br>
Forum : <a href="https://forum.fhem.de/index.php/topic,67443.0.html">https://forum.fhem.de/index.php/topic,67443.0.html</a>
<br><br> <br><br>
<a name="SIPdefine"></a> <a name="SIPdefine"></a>
@ -1860,9 +1872,11 @@ sub SIP_rBU($$) {
<h3>SIP</h3> <h3>SIP</h3>
<ul> <ul>
Definiert ein SIP-Client Device. Definiert ein SIP-Client Device.<br>
Wiki : <a href="https://wiki.fhem.de/wiki/SIP-Client">https://wiki.fhem.de/wiki/SIP-Client</a>
<br>
Forum : <a href="https://forum.fhem.de/index.php/topic,67443.0.html">https://forum.fhem.de/index.php/topic,67443.0.html</a>
<br><br> <br><br>
<a name="SIPdefine"></a> <a name="SIPdefine"></a>
<b>Define</b> <b>Define</b>
<ul> <ul>