Skip to content

Commit

Permalink
Исправление ошибки редактирования внешнего транка
Browse files Browse the repository at this point in the history
  • Loading branch information
radetsky committed Jun 27, 2013
1 parent 9f47199 commit 7320fc2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
14 changes: 10 additions & 4 deletions lib/PearlPBX/SIP.pm
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,10 @@ sub setpeer {
if ($sip_call_limit eq '') { $sip_call_limit = 2; }

my $sip_host = $sip_ipaddr;
if ($sip_ipaddr eq '') {
$sip_host = 'dynamic';
}

my $sip_type = 'friend';
my $sip_insecure = '';
my $sip_permit = '';
Expand Down Expand Up @@ -556,14 +560,16 @@ sub setpeer {

if ( $@ ) { return "ERROR:". $this->{dbh}->errstr; }

my $doreg = undef;
my $doreg = '';

if ( $sip_remote_register eq 'true') {
$doreg = $this->_add_or_replace_regstr ($sip_remote_regstr, $sip_regstr_id);
} else {
if ( ($sip_regstr_id+0) > 0) {
$doreg = $this->_remove_regstr ($sip_regstr_id);
}
if ( $sip_regstr_id ne "" ) {
if ( ($sip_regstr_id+0) > 0) {
$doreg = $this->_remove_regstr ($sip_regstr_id);
}
}
}

if ($doreg =~ /^ERROR/ ) { return $doreg; }
Expand Down
4 changes: 3 additions & 1 deletion web/js/pearlpbx.js
Original file line number Diff line number Diff line change
Expand Up @@ -628,10 +628,12 @@ function pearlpbx_sip_update_peer() {

}
function pearlpbx_edit_peer_is_dynamic() {
if ($('#input_peer_edit_is_dynamic').prop('checked') ) {

if ($('#input_peer_edit_is_dynamic').prop('checked') ) {
$('#div_input_peer_edit_ipaddr').hide();
$('#input_peer_edit_registration').prop('checked',false);
$('#div_input_peer_edit_regstr').hide();
$('#input_peer_edit_ipaddr').val('');
} else {
$('#div_input_peer_edit_ipaddr').show();

Expand Down

0 comments on commit 7320fc2

Please sign in to comment.