Skip to content

Commit

Permalink
Исправил не корректное сохранение SIP пира, в поле type сохранялось з…
Browse files Browse the repository at this point in the history
…начение "SIP", а должно было "peer", в итоге не создавались endpoint в pjsip.conf
  • Loading branch information
boffart committed Oct 10, 2024
1 parent ab020fb commit f516e46
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/AdminCabinet/Forms/ExtensionEditForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public function initialize($entity = null, $options = null): void
$this->add(new Hidden('sip_extension', ["value" => $entity->number]));

// SIP Type
$this->add(new Hidden('sip_type', ["value" => $entity->type]));
$this->add(new Hidden('sip_type', ["value" => $entity->sip_type]));

// SIP Secret
$this->add(
Expand Down
16 changes: 8 additions & 8 deletions src/Core/Asterisk/Configs/SIPConf.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,9 @@ private function getTopologyData(): array
$subnets[] = $net;
}
if (trim($if_data['internet']) === '1') {
$topology = trim($if_data['topology']);
$extipaddr = trim($if_data['extipaddr']);
$exthostname = trim($if_data['exthostname']);
$topology = trim($if_data['topology']??'');
$extipaddr = trim($if_data['extipaddr']??'');
$exthostname = trim($if_data['exthostname']??'');
}
}

Expand Down Expand Up @@ -599,11 +599,11 @@ public function updateAsteriskDatabase(): bool
$db = new AstDB();
foreach ($this->data_peers as $peer) {
// Update Asterisk database with routing information.
$ringLength = ((string)$peer['ringlength'] === '0') ? '' : trim($peer['ringlength']);
$ringLength = ((string)$peer['ringlength'] === '0') ? '' : trim($peer['ringlength']??'');
$warError |= !$db->databasePut('FW_TIME', $peer['extension'], $ringLength);
$warError |= !$db->databasePut('FW', $peer['extension'], trim($peer['forwarding']));
$warError |= !$db->databasePut('FW_BUSY', $peer['extension'], trim($peer['forwardingonbusy']));
$warError |= !$db->databasePut('FW_UNAV', $peer['extension'], trim($peer['forwardingonunavailable']));
$warError |= !$db->databasePut('FW', $peer['extension'], trim($peer['forwarding']??''));
$warError |= !$db->databasePut('FW_BUSY', $peer['extension'], trim($peer['forwardingonbusy']??''));
$warError |= !$db->databasePut('FW_UNAV', $peer['extension'], trim($peer['forwardingonunavailable']??''));
}

return !$warError;
Expand Down Expand Up @@ -1281,7 +1281,7 @@ private function generatePeerEndpoint(
}

$dtmfmode = ($peer['dtmfmode'] === 'rfc2833') ? 'rfc4733' : $peer['dtmfmode'];
$peer['transport'] = trim($peer['transport']);
$peer['transport'] = trim($peer['transport']??'');
// Prepare the options for the endpoint section
$options = [
'type' => 'endpoint',
Expand Down
1 change: 1 addition & 0 deletions src/PBXCoreREST/Lib/Extensions/GetRecordAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ public static function main(string $id): PBXApiResult
'sip_dtmfmode' => 'Sip.dtmfmode',
'sip_manualattributes' => 'Sip.manualattributes',
'sip_uniqid' => 'Sip.uniqid',
'sip_type' => 'Sip.type',
'sip_secret' => 'Sip.secret',
'sip_networkfilterid' => 'Sip.networkfilterid',
'sip_transport' => 'Sip.transport'
Expand Down

0 comments on commit f516e46

Please sign in to comment.