k-shym / urfaclient Goto Github PK
View Code? Open in Web Editor NEWURFAClient PHP (api.xml)
License: GNU General Public License v3.0
URFAClient PHP (api.xml)
License: GNU General Public License v3.0
Пытаюсь выполнить следующий файл:
<?php
$urfa = URFAClient::init(array(
'login' => 'login',
'password' => 'password',
'address' => 'address',
'timeout' => 10,
'admin' => FALSE,
'log' => TRUE,
));
$result = $urfa->rpcf_user5_set_next_tp(array(
'tp_link' => 2,
'tp_next' => 2,
));
print_r($result);
print_r(URFAClient::trace_log());
При выполнении скрипт "висит" и ничего не выводит.
По тайм ауту тоже не завершается.
Приветствую.
В 5,3 версии есть некий турборежим. Так вот в ЛК он вызывается через 0x1200c но что то в xml его найти не получилось. Есть у кого?
Приветствую.
Помогите с данной функцией.
делаю так:
$house["house_id"]=252; // MAX(id)+1
$house["connect_date"]=time();
$house["post_code"]="1";
$house["country"]="1";
$house["region"]="1";
$house["building"]="1";
$house["city"]="1";
$house["street"]="2";
$house["number"]="2";
$house["count"][0]["ipzone_id"]=1; // ID зоны
$addhouse=$urfa->rpcf_add_house($house);
print_r(URFAClient::trace_log());
В итоге вроде как отрабатывает, выдает такое
Array
(
[0] => 2016.06.22 15:39:29 INFO: rpcf_add_house( Array ( [house_id] => 252 [connect_date] => 1466599169 [post_code] => 1 [country] => 1 [region] => 1 [building] => 1 [city] => 1 [street] => 2 [number] => 2 [count] => Array ( [0] => Array ( [ipzone_id] => 1 ) ) ) ) -> Array ( ) 0.157ms
)
Каким образом, с помощью этой функции, осуществить поиск по дополнительным параметрам?
Если utm5_core не запущен, то попытка обратиться к нему выдает ошибку:
<b>Warning</b>: stream_socket_client(): unable to connect to tcp://127.0.0.1:11758 (Connection refused) in <b>/var/www/framework/vendor/k-shym/urfa-client/src/Connection.php</b> on line <b>68</b><br />
Для себя я решил таким образом, добавив @:
$this->socket = @stream_socket_client( "tcp://{$data['address']}:{$data['port']}", $err_no, $err_str, $data['timeout'], STREAM_CLIENT_CONNECT, $context );
В идеале генерировать исключение, но насколько знаю stream_socket_client не вызывает их.
Или я не правильно заполняю параметры, или что то с описанием функции в api_53-003.xml.
Вызываю так:
$URFAParams = array (
'sid' => 85404,
'st' => 1000,
'cnt' => array (
0 => array (
'vendor' => 14988,
'attr' => 19,
'usage_flags' => 1,
'expire_date' => 2000000000,
'param1' => 1,
'cval' => 'Unlim550',
'ival' => 0,
'val' => '',
'prop_size' => array (
0 => array (
'type' => 0,
'value' => '',
),
),
),
),
);
$radius_attr = $urfa_admin->rpcf_set_radius_attr($URFAParams);
Уже который день мучаюсь - безрезультатно :-(
Вы не пробовали использовать эту функцию?
Может я что-то не верно делаю при исполнении функции rpcf_dealer_add_service_to_user возникает ошибка:
PHP Fatal error: Uncaught exception 'URFAClient_Exception' with message 'Error calling function rpcf_dealer_add_service_to_user' in /usr/share/utm_scripts/urfa/classes/URFAClient/API.php:100
Stack trace:
#0 /var/www/utm/test.php(46): URFAClient_API->__call('rpcf_dealer_add...', Array)
#1 /var/www/utm/test.php(46): URFAClient_API->rpcf_dealer_add_service_to_user(Array)
#2 {main}
thrown in /usr/share/utm_scripts/urfa/classes/URFAClient/API.php on line 100
Вот так составляю параметры, которые передаю функции:
$par = array(
'user_id' => 31624,
'account_id' => 31658,
'service_id' => 498,
'service_type' => 3,
'tariff_link_id' => 31804,
'discount_period_id'=> 1638,
'start_date' => 1582202226,
'expire_date' => 1893441600,
'policy_id' => 1,
'unabon' => 1,
'cost_coef' => 1,
'unprepay' => 1,
'ip_groups_count' => array(array(
'ip_address' => '10.0.123.135',
'mask' => 32,
'iptraffic_login' => 'login',
'iptraffic_password'=> 'password',
'ip_not_vpn' => 0,
'dont_use_fw' => 0,
'router_id' => 0
))
);
var_dump($urfa->rpcf_dealer_add_service_to_user($par));
Меня смущает тип данных "ip_address" - может нельзя туда string передавать, тогда как?
Версия 5.3-004
Добрый день !
Не получается получить вывод функции rpcf_get_iptraffic_service с UTM 5.5-006
При этом rpcf_get_iptraffic_service_ex работает
Выдает следующее:
PHP Warning: unpack(): Type N: not enough input, need 4, have 0 in /home/balu/utm-work/sms/URFAClient/classes/URFAClient/Packet.php on line 256
PHP Stack trace:
PHP 1. {main}() /home/balu/utm-work/sms/sms-shaper.php:0
PHP 2. URFAClient_API->rpcf_get_iptraffic_service() /home/balu/utm-work/sms/sms-shaper.php:150
PHP 3. URFAClient_API->__call() /home/balu/utm-work/sms/sms-shaper.php:150
PHP 4. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:129
PHP 5. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:433
PHP 6. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:404
PHP 7. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:433
PHP 8. URFAClient_Packet->getDataLong() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:325
PHP 9. unpack() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/Packet.php:256
PHP Warning: unpack(): Type d: not enough input, need 8, have 4 in /home/balu/utm-work/sms/URFAClient/classes/URFAClient/Packet.php on line 154
PHP Stack trace:
PHP 1. {main}() /home/balu/utm-work/sms/sms-shaper.php:0
PHP 2. URFAClient_API->rpcf_get_iptraffic_service() /home/balu/utm-work/sms/sms-shaper.php:150
PHP 3. URFAClient_API->__call() /home/balu/utm-work/sms/sms-shaper.php:150
PHP 4. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:129
PHP 5. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:433
PHP 6. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:404
PHP 7. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:433
PHP 8. URFAClient_Packet->getDataDouble() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:328
PHP 9. unpack() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/Packet.php:154
PHP Warning: unpack(): Type N: not enough input, need 4, have 0 in /home/balu/utm-work/sms/URFAClient/classes/URFAClient/Packet.php on line 256
PHP Stack trace:
PHP 1. {main}() /home/balu/utm-work/sms/sms-shaper.php:0
PHP 2. URFAClient_API->rpcf_get_iptraffic_service() /home/balu/utm-work/sms/sms-shaper.php:150
PHP 3. URFAClient_API->__call() /home/balu/utm-work/sms/sms-shaper.php:150
PHP 4. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:129
PHP 5. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:433
PHP 6. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:404
PHP 7. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:433
PHP 8. URFAClient_Packet->getDataLong() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:325
PHP 9. unpack() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/Packet.php:256
PHP Warning: unpack(): Type d: not enough input, need 8, have 4 in /home/balu/utm-work/sms/URFAClient/classes/URFAClient/Packet.php on line 154
PHP Stack trace:
PHP 1. {main}() /home/balu/utm-work/sms/sms-shaper.php:0
PHP 2. URFAClient_API->rpcf_get_iptraffic_service() /home/balu/utm-work/sms/sms-shaper.php:150
PHP 3. URFAClient_API->__call() /home/balu/utm-work/sms/sms-shaper.php:150
PHP 4. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:129
PHP 5. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:433
PHP 6. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:404
PHP 7. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:433
PHP 8. URFAClient_Packet->getDataDouble() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:328
PHP 9. unpack() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/Packet.php:154
PHP Warning: unpack(): Type N: not enough input, need 4, have 0 in /home/balu/utm-work/sms/URFAClient/classes/URFAClient/Packet.php on line 256
PHP Stack trace:
PHP 1. {main}() /home/balu/utm-work/sms/sms-shaper.php:0
PHP 2. URFAClient_API->rpcf_get_iptraffic_service() /home/balu/utm-work/sms/sms-shaper.php:150
PHP 3. URFAClient_API->__call() /home/balu/utm-work/sms/sms-shaper.php:150
PHP 4. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:129
PHP 5. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:433
PHP 6. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:404
PHP 7. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:433
PHP 8. URFAClient_Packet->getDataLong() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:325
PHP 9. unpack() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/Packet.php:256
PHP Warning: unpack(): Type d: not enough input, need 8, have 4 in /home/balu/utm-work/sms/URFAClient/classes/URFAClient/Packet.php on line 154
PHP Stack trace:
PHP 1. {main}() /home/balu/utm-work/sms/sms-shaper.php:0
PHP 2. URFAClient_API->rpcf_get_iptraffic_service() /home/balu/utm-work/sms/sms-shaper.php:150
PHP 3. URFAClient_API->__call() /home/balu/utm-work/sms/sms-shaper.php:150
PHP 4. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:129
PHP 5. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:433
PHP 6. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:404
PHP 7. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:433
PHP 8. URFAClient_Packet->getDataDouble() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:328
PHP 9. unpack() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/Packet.php:154
PHP Warning: unpack(): Type N: not enough input, need 4, have 0 in /home/balu/utm-work/sms/URFAClient/classes/URFAClient/Packet.php on line 256
PHP Stack trace:
PHP 1. {main}() /home/balu/utm-work/sms/sms-shaper.php:0
PHP 2. URFAClient_API->rpcf_get_iptraffic_service() /home/balu/utm-work/sms/sms-shaper.php:150
PHP 3. URFAClient_API->__call() /home/balu/utm-work/sms/sms-shaper.php:150
PHP 4. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:129
PHP 5. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:433
PHP 6. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:404
PHP 7. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:433
PHP 8. URFAClient_Packet->getDataLong() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:325
PHP 9. unpack() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/Packet.php:256
PHP Warning: unpack(): Type d: not enough input, need 8, have 4 in /home/balu/utm-work/sms/URFAClient/classes/URFAClient/Packet.php on line 154
PHP Stack trace:
PHP 1. {main}() /home/balu/utm-work/sms/sms-shaper.php:0
PHP 2. URFAClient_API->rpcf_get_iptraffic_service() /home/balu/utm-work/sms/sms-shaper.php:150
PHP 3. URFAClient_API->__call() /home/balu/utm-work/sms/sms-shaper.php:150
PHP 4. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:129
PHP 5. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:433
PHP 6. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:404
PHP 7. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:433
PHP 8. URFAClient_Packet->getDataDouble() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:328
PHP 9. unpack() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/Packet.php:154
PHP Warning: unpack(): Type N: not enough input, need 4, have 0 in /home/balu/utm-work/sms/URFAClient/classes/URFAClient/Packet.php on line 256
PHP Stack trace:
PHP 1. {main}() /home/balu/utm-work/sms/sms-shaper.php:0
PHP 2. URFAClient_API->rpcf_get_iptraffic_service() /home/balu/utm-work/sms/sms-shaper.php:150
PHP 3. URFAClient_API->__call() /home/balu/utm-work/sms/sms-shaper.php:150
PHP 4. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:129
PHP 5. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:433
PHP 6. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:404
PHP 7. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:433
PHP 8. URFAClient_Packet->getDataLong() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:325
PHP 9. unpack() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/Packet.php:256
PHP Warning: unpack(): Type d: not enough input, need 8, have 4 in /home/balu/utm-work/sms/URFAClient/classes/URFAClient/Packet.php on line 154
PHP Stack trace:
PHP 1. {main}() /home/balu/utm-work/sms/sms-shaper.php:0
PHP 2. URFAClient_API->rpcf_get_iptraffic_service() /home/balu/utm-work/sms/sms-shaper.php:150
PHP 3. URFAClient_API->__call() /home/balu/utm-work/sms/sms-shaper.php:150
PHP 4. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:129
PHP 5. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:433
PHP 6. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:404
PHP 7. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:433
PHP 8. URFAClient_Packet->getDataDouble() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:328
PHP 9. unpack() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/Packet.php:154
PHP Warning: unpack(): Type N: not enough input, need 4, have 0 in /home/balu/utm-work/sms/URFAClient/classes/URFAClient/Packet.php on line 256
PHP Stack trace:
PHP 1. {main}() /home/balu/utm-work/sms/sms-shaper.php:0
PHP 2. URFAClient_API->rpcf_get_iptraffic_service() /home/balu/utm-work/sms/sms-shaper.php:150
PHP 3. URFAClient_API->__call() /home/balu/utm-work/sms/sms-shaper.php:150
PHP 4. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:129
PHP 5. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:433
PHP 6. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:404
PHP 7. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:433
PHP 8. URFAClient_Packet->getDataLong() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:325
PHP 9. unpack() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/Packet.php:256
PHP Warning: unpack(): Type d: not enough input, need 8, have 4 in /home/balu/utm-work/sms/URFAClient/classes/URFAClient/Packet.php on line 154
PHP Stack trace:
PHP 1. {main}() /home/balu/utm-work/sms/sms-shaper.php:0
PHP 2. URFAClient_API->rpcf_get_iptraffic_service() /home/balu/utm-work/sms/sms-shaper.php:150
PHP 3. URFAClient_API->__call() /home/balu/utm-work/sms/sms-shaper.php:150
PHP 4. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:129
PHP 5. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:433
PHP 6. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:404
PHP 7. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:433
PHP 8. URFAClient_Packet->getDataDouble() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:328
PHP 9. unpack() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/Packet.php:154
PHP Notice: Undefined offset: 29 in /home/balu/utm-work/sms/URFAClient/classes/URFAClient/Packet.php on line 256
PHP Stack trace:
PHP 1. {main}() /home/balu/utm-work/sms/sms-shaper.php:0
PHP 2. URFAClient_API->rpcf_get_iptraffic_service() /home/balu/utm-work/sms/sms-shaper.php:150
PHP 3. URFAClient_API->__call() /home/balu/utm-work/sms/sms-shaper.php:150
PHP 4. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:129
PHP 5. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:433
PHP 6. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:404
PHP 7. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:433
PHP 8. URFAClient_Packet->getDataLong() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:325
PHP Warning: unpack(): Type N: not enough input, need 4, have 0 in /home/balu/utm-work/sms/URFAClient/classes/URFAClient/Packet.php on line 256
PHP Stack trace:
PHP 1. {main}() /home/balu/utm-work/sms/sms-shaper.php:0
PHP 2. URFAClient_API->rpcf_get_iptraffic_service() /home/balu/utm-work/sms/sms-shaper.php:150
PHP 3. URFAClient_API->__call() /home/balu/utm-work/sms/sms-shaper.php:150
PHP 4. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:129
PHP 5. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:433
PHP 6. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:404
PHP 7. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:433
PHP 8. URFAClient_Packet->getDataLong() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:325
PHP 9. unpack() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/Packet.php:256
PHP Notice: Undefined offset: 30 in /home/balu/utm-work/sms/URFAClient/classes/URFAClient/Packet.php on line 154
PHP Stack trace:
PHP 1. {main}() /home/balu/utm-work/sms/sms-shaper.php:0
PHP 2. URFAClient_API->rpcf_get_iptraffic_service() /home/balu/utm-work/sms/sms-shaper.php:150
PHP 3. URFAClient_API->__call() /home/balu/utm-work/sms/sms-shaper.php:150
PHP 4. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:129
PHP 5. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:433
PHP 6. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:404
PHP 7. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:433
PHP 8. URFAClient_Packet->getDataDouble() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:328
PHP Warning: unpack(): Type d: not enough input, need 8, have 0 in /home/balu/utm-work/sms/URFAClient/classes/URFAClient/Packet.php on line 154
PHP Stack trace:
PHP 1. {main}() /home/balu/utm-work/sms/sms-shaper.php:0
PHP 2. URFAClient_API->rpcf_get_iptraffic_service() /home/balu/utm-work/sms/sms-shaper.php:150
PHP 3. URFAClient_API->__call() /home/balu/utm-work/sms/sms-shaper.php:150
PHP 4. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:129
PHP 5. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:433
PHP 6. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:404
PHP 7. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:433
PHP 8. URFAClient_Packet->getDataDouble() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:328
PHP 9. unpack() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/Packet.php:154
PHP Notice: Undefined offset: 31 in /home/balu/utm-work/sms/URFAClient/classes/URFAClient/Packet.php on line 256
PHP Stack trace:
PHP 1. {main}() /home/balu/utm-work/sms/sms-shaper.php:0
PHP 2. URFAClient_API->rpcf_get_iptraffic_service() /home/balu/utm-work/sms/sms-shaper.php:150
PHP 3. URFAClient_API->__call() /home/balu/utm-work/sms/sms-shaper.php:150
PHP 4. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:129
PHP 5. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:433
PHP 6. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:404
PHP 7. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:433
PHP 8. URFAClient_Packet->getDataLong() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:325
PHP Warning: unpack(): Type N: not enough input, need 4, have 0 in /home/balu/utm-work/sms/URFAClient/classes/URFAClient/Packet.php on line 256
PHP Stack trace:
PHP 1. {main}() /home/balu/utm-work/sms/sms-shaper.php:0
PHP 2. URFAClient_API->rpcf_get_iptraffic_service() /home/balu/utm-work/sms/sms-shaper.php:150
PHP 3. URFAClient_API->__call() /home/balu/utm-work/sms/sms-shaper.php:150
PHP 4. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:129
PHP 5. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:433
PHP 6. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:404
PHP 7. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:433
PHP 8. URFAClient_Packet->getDataLong() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:325
PHP 9. unpack() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/Packet.php:256
PHP Notice: Undefined offset: 32 in /home/balu/utm-work/sms/URFAClient/classes/URFAClient/Packet.php on line 154
PHP Stack trace:
PHP 1. {main}() /home/balu/utm-work/sms/sms-shaper.php:0
PHP 2. URFAClient_API->rpcf_get_iptraffic_service() /home/balu/utm-work/sms/sms-shaper.php:150
PHP 3. URFAClient_API->__call() /home/balu/utm-work/sms/sms-shaper.php:150
PHP 4. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:129
PHP 5. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:433
PHP 6. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:404
PHP 7. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:433
PHP 8. URFAClient_Packet->getDataDouble() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:328
PHP Warning: unpack(): Type d: not enough input, need 8, have 0 in /home/balu/utm-work/sms/URFAClient/classes/URFAClient/Packet.php on line 154
PHP Stack trace:
PHP 1. {main}() /home/balu/utm-work/sms/sms-shaper.php:0
PHP 2. URFAClient_API->rpcf_get_iptraffic_service() /home/balu/utm-work/sms/sms-shaper.php:150
PHP 3. URFAClient_API->__call() /home/balu/utm-work/sms/sms-shaper.php:150
PHP 4. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:129
PHP 5. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:433
PHP 6. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:404
PHP 7. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:433
PHP 8. URFAClient_Packet->getDataDouble() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:328
PHP 9. unpack() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/Packet.php:154
PHP Notice: Undefined offset: 33 in /home/balu/utm-work/sms/URFAClient/classes/URFAClient/Packet.php on line 129
PHP Stack trace:
PHP 1. {main}() /home/balu/utm-work/sms/sms-shaper.php:0
PHP 2. URFAClient_API->rpcf_get_iptraffic_service() /home/balu/utm-work/sms/sms-shaper.php:150
PHP 3. URFAClient_API->__call() /home/balu/utm-work/sms/sms-shaper.php:150
PHP 4. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:129
PHP 5. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:433
PHP 6. URFAClient_Packet->getDataInt() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:322
PHP Warning: unpack(): Type N: not enough input, need 4, have 0 in /home/balu/utm-work/sms/URFAClient/classes/URFAClient/Packet.php on line 323
PHP Stack trace:
PHP 1. {main}() /home/balu/utm-work/sms/sms-shaper.php:0
PHP 2. URFAClient_API->rpcf_get_iptraffic_service() /home/balu/utm-work/sms/sms-shaper.php:150
PHP 3. URFAClient_API->__call() /home/balu/utm-work/sms/sms-shaper.php:150
PHP 4. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:129
PHP 5. URFAClient_API->processDataOutput() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:433
PHP 6. URFAClient_Packet->getDataInt() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:322
PHP 7. URFAClient_Packet->bin2int() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/Packet.php:129
PHP 8. unpack() /home/balu/utm-work/sms/URFAClient/classes/URFAClient/Packet.php:323
PHP Fatal error: Uncaught URFAClient_Exception: Not provided an error, contact the developer (processDataOutput) in /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php:392
Stack trace:
#0 /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php(433): URFAClient_API->processDataOutput(Object(SimpleXMLElement), Object(URFAClient_Packet))
#1 /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php(129): URFAClient_API->processDataOutput(Object(SimpleXMLElement), Object(URFAClient_Packet))
#2 /home/balu/utm-work/sms/sms-shaper.php(150): URFAClient_API->__call('rpcf_get_iptraf...', Array)
#3 {main}
thrown in /home/balu/utm-work/sms/URFAClient/classes/URFAClient/API.php on line 392
Описание самой функции в родном api.xml такое же, как и в предыдущих версиях.
api_55-006.zip
Версия api 53-003
При вызове с параметрами:
$data = $this->urfa->rpcf_search_users_new(['select_type' => 0, 'patterns_count' => [ 0 => [ 'what_id' => 3, 'criteria_id'=>3, 'pattern' => $account ], ],
Получаю ошибку:
Notice: Undefined index: j
На строке 318:
$count = (int) $result[$name];
Если убрать из api.xml последний цикл в котором идет куча необязательных параметров, функция начинает работать.
URFAClient-1.3.0, api_53-003.xml
Не работает rpcf_get_radius_attr
$URFAParams = array (
'sid' => 85312,
'st' => 10000,
);
$radius_attr = $urfa_admin->rpcf_get_radius_attr($URFAParams);
Передача параметров и вызов проходят правильно, в логах билинга вижу
Jul 13 15:10:33 ?Debug : a8bf3b40 DBConnection_mysql: <0x8edc760> SQL SELECT query: SELECT attr_type,vendor,attr,value,flags,expire_date,id FROM radius_data WHERE owner_type='10000' AND owner_id='85312'
Jul 13 15:10:33 ?Debug : a8bf3b40 DBConnection_mysql: <0x8edc760> SQL SELECT query: 1 rows in 0.000 sec
Но с получением результата проблема:
PHP Notice: Undefined offset: 8 in /opt/URFAClient/classes/URFAClient/Packet.php on line 139
Notice: Undefined offset: 8 in /opt/URFAClient/classes/URFAClient/Packet.php on line 139
PHP Notice: Undefined offset: 9 in /opt/URFAClient/classes/URFAClient/Packet.php on line 95
Notice: Undefined offset: 9 in /opt/URFAClient/classes/URFAClient/Packet.php on line 95
PHP Warning: unpack(): Type N: not enough input, need 4, have 0 in /opt/URFAClient/classes/URFAClient/Packet.php on line 275
Warning: unpack(): Type N: not enough input, need 4, have 0 in /opt/URFAClient/classes/URFAClient/Packet.php on line 275
PHP Notice: Undefined offset: 10 in /opt/URFAClient/classes/URFAClient/Packet.php on line 139
Notice: Undefined offset: 10 in /opt/URFAClient/classes/URFAClient/Packet.php on line 139
PHP Notice: Undefined offset: 11 in /opt/URFAClient/classes/URFAClient/Packet.php on line 95
Notice: Undefined offset: 11 in /opt/URFAClient/classes/URFAClient/Packet.php on line 95
PHP Warning: unpack(): Type N: not enough input, need 4, have 0 in /opt/URFAClient/classes/URFAClient/Packet.php on line 275
Warning: unpack(): Type N: not enough input, need 4, have 0 in /opt/URFAClient/classes/URFAClient/Packet.php on line 275
PHP Notice: Undefined offset: 12 in /opt/URFAClient/classes/URFAClient/Packet.php on line 139
Notice: Undefined offset: 12 in /opt/URFAClient/classes/URFAClient/Packet.php on line 139
PHP Notice: Undefined offset: 13 in /opt/URFAClient/classes/URFAClient/Packet.php on line 95
Notice: Undefined offset: 13 in /opt/URFAClient/classes/URFAClient/Packet.php on line 95
PHP Warning: unpack(): Type N: not enough input, need 4, have 0 in /opt/URFAClient/classes/URFAClient/Packet.php on line 275
Warning: unpack(): Type N: not enough input, need 4, have 0 in /opt/URFAClient/classes/URFAClient/Packet.php on line 275
PHP Notice: Undefined offset: 14 in /opt/URFAClient/classes/URFAClient/Packet.php on line 139
И так до бесконечности пока не остановишь.
Добрый вечер! При вызове функции rpcf_user5_edit_user она изменяет все параметры кроме full_name и email! Тестировал на версии 5.3-003!
Функция rpcf_get_shaping 0x1200e api_53-003.xml не работает, видимо ошибка в api_53-003.xml ((
Описание функции :
<function name="rpcf_get_shaping" id="0x1200e">
<input>
<integer name="service_id"/>
</input>
<output>
<integer name="result"/>
<if variable="result" value="0" condition="eq">
<integer name="flags"/>
<!-- input shaping details -->
<integer name="in_tclass_count"/>
<for name="i" from="0" count="in_tclass_count">
<integer name="in_tclass_id_array" array_index="i"/>
</for>
<integer name="in_limits_count"/>
<for name="l" from="0" count="in_limits_count">
<integer name="in_acc_states_array" array_index="l"/>
<long name="in_borders_array" array_index="l"/>
<integer name="in_timeranges_array" array_index="l"/>
<integer name="in_limits_array" array_index="l"/>
</for>
<!-- output shaping details -->
<integer name="out_tclass_count"/>
<for name="i" from="0" count="out_tclass_count">
<integer name="out_tclass_id_array" array_index="i"/>
</for>
<integer name="out_limits_count"/>
<for name="l" from="0" count="out_limits_count">
<integer name="out_acc_states_array" array_index="l"/>
<long name="out_borders_array" array_index="l"/>
<integer name="out_timeranges_array" array_index="l"/>
<integer name="out_limits_array" array_index="l"/>
</for>
<integer name="rad_count"/>
<for name="i" from="0" count="rad_count">
<integer name="rad_vendor" array_index="i"/>
<integer name="rad_attr" array_index="i"/>
<integer name="rad_type" array_index="i"/>
<string name="rad_value" array_index="i"/>
</for>
<integer name="settings_cnt"/>
<for name="i" from="0" count="settings_cnt">
<integer name="turbo_mode_service_id" array_index="i"/>
<integer name="turbo_mode_incoming_rate" array_index="i"/>
<integer name="turbo_mode_outgoing_rate" array_index="i"/>
<long name="turbo_mode_incoming_limit" array_index="i"/>
<long name="turbo_mode_outgoing_limit" array_index="i"/>
<integer name="name" array_index="i"/>
<integer name="turbo_mode_duration" array_index="i"/>
<integer name="turbo_mode_acct_period_flag" array_index="i"/>
</for>
</if>
</output>
</function>
Результат ее выполнения:
PHP Warning: unpack(): Type N: not enough input, need 4, have 0 in /opt/URFAClient-1.3.3/classes/URFAClient/Packet.php on line 204
Warning: unpack(): Type N: not enough input, need 4, have 0 in /opt/URFAClient-1.3.3/classes/URFAClient/Packet.php on line 204
PHP Warning: unpack(): Type N: not enough input, need 4, have 0 in /opt/URFAClient-1.3.3/classes/URFAClient/Packet.php on line 204
Warning: unpack(): Type N: not enough input, need 4, have 0 in /opt/URFAClient-1.3.3/classes/URFAClient/Packet.php on line 204
PHP Warning: unpack(): Type N: not enough input, need 4, have 0 in /opt/URFAClient-1.3.3/classes/URFAClient/Packet.php on line 204
Warning: unpack(): Type N: not enough input, need 4, have 0 in /opt/URFAClient-1.3.3/classes/URFAClient/Packet.php on line 204
PHP Warning: unpack(): Type N: not enough input, need 4, have 0 in /opt/URFAClient-1.3.3/classes/URFAClient/Packet.php on line 204
Warning: unpack(): Type N: not enough input, need 4, have 0 in /opt/URFAClient-1.3.3/classes/URFAClient/Packet.php on line 204
PHP Warning: unpack(): Type N: not enough input, need 4, have 0 in /opt/URFAClient-1.3.3/classes/URFAClient/Packet.php on line 204
Warning: unpack(): Type N: not enough input, need 4, have 0 in /opt/URFAClient-1.3.3/classes/URFAClient/Packet.php on line 204
PHP Warning: unpack(): Type N: not enough input, need 4, have 0 in /opt/URFAClient-1.3.3/classes/URFAClient/Packet.php on line 204
Warning: unpack(): Type N: not enough input, need 4, have 0 in /opt/URFAClient-1.3.3/classes/URFAClient/Packet.php on line 204
PHP Warning: unpack(): Type N: not enough input, need 4, have 0 in /opt/URFAClient-1.3.3/classes/URFAClient/Packet.php on line 204
Warning: unpack(): Type N: not enough input, need 4, have 0 in /opt/URFAClient-1.3.3/classes/URFAClient/Packet.php on line 204
Array
(
[result] => 0
[flags] => 3
[in_tclass_count] => Array
(
[0] => Array
(
[in_tclass_id_array] => 10
)
)
[in_limits_count] => Array
(
[0] => Array
(
[in_acc_states_array] => 0
[in_borders_array] => 0
[in_timeranges_array] => 1
[in_limits_array] => 50
)
)
[out_tclass_count] => Array
(
[0] => Array
(
[out_tclass_id_array] => 20
)
)
[out_limits_count] => Array
(
[0] => Array
(
[out_acc_states_array] => 0
[out_borders_array] => 0
[out_timeranges_array] => 1
[out_limits_array] => 50
)
)
[rad_count] => Array
(
)
[settings_cnt] => Array
(
[0] => Array
(
[turbo_mode_service_id] => 3
[turbo_mode_incoming_rate] => 909
[turbo_mode_outgoing_rate] => 300
[turbo_mode_incoming_limit] =>
[turbo_mode_outgoing_limit] => 0
[name] => 0
[turbo_mode_duration] => -794635901
[turbo_mode_acct_period_flag] => 10800
)
[1] => Array
(
[turbo_mode_service_id] => 0
[turbo_mode_incoming_rate] => 4
[turbo_mode_outgoing_rate] => 910
[turbo_mode_incoming_limit] =>
[turbo_mode_outgoing_limit] =>
[name] => 0
[turbo_mode_duration] => 0
[turbo_mode_acct_period_flag] => -794635901
)
[2] => Array
(
[turbo_mode_service_id] => 21600
[turbo_mode_incoming_rate] => 0
[turbo_mode_outgoing_rate] => 5
[turbo_mode_incoming_limit] =>
[turbo_mode_outgoing_limit] =>
[name] => 300
[turbo_mode_duration] => 0
[turbo_mode_acct_period_flag] => 0
)
[3] => Array
(
[turbo_mode_service_id] => -794635901
[turbo_mode_incoming_rate] => 43200
[turbo_mode_outgoing_rate] => 0
[turbo_mode_incoming_limit] =>
[turbo_mode_outgoing_limit] =>
[name] => 300
[turbo_mode_duration] => 300
[turbo_mode_acct_period_flag] => 0
)
)
)
Подскажите, где можно взять правильное описание?
Вроде всё настроил, но при попытке отправить данные на UTM вываливается ошибка:
Fatal error: Uncaught exception 'URFAClient_Exception' with message 'Error code 21. Version: 3' in /var/www/urfa/classes/URFAClient/Connection.php:216
Что бы это могло быть?
UTM5.3-004
Приветствую.
Не работает данная функция. Так же (для теста) пробовал "rpcf_user5_get_tariff_name" - она тоже не работает.
У меня есть подозрение, что это связано с модулем "liburfa-user", но не уверен.
Может я что-то не так запускаю - подскажите, пожалуйста
В новой версии есть немного отличий в api.xml
api_53-006.xml.txt
Version:5.3-002
Если прописать tariff_link_id функция перестает работать! При тестировании на версии 5.3-003 все хорошо!
Пробую запустить тестовые скрипты на Debian 12 с php 8.2 или php 7.4 в обоих случаях проблема
Error in line 218Error code 0PHP Notice: fwrite(): send of 1 bytes failed with errno=32 Broken pipe in /home/user/devel/payment-wip/vendor/k-shym/urfa-client/src/Connection.php on line 254
PHP Notice: fwrite(): send of 1 bytes failed with errno=32 Broken pipe in /home/user/devel/payment-wip/vendor/k-shym/urfa-client/src/Connection.php on line 255
PHP Notice: fwrite(): send of 2 bytes failed with errno=32 Broken pipe in /home/user/devel/payment-wip/vendor/k-shym/urfa-client/src/Connection.php on line 256
PHP Notice: fwrite(): send of 2 bytes failed with errno=32 Broken pipe in /home/user/devel/payment-wip/vendor/k-shym/urfa-client/src/Connection.php on line 259
PHP Notice: fwrite(): send of 2 bytes failed with errno=32 Broken pipe in /home/user/devel/payment-wip/vendor/k-shym/urfa-client/src/Connection.php on line 260
PHP Notice: fwrite(): send of 4 bytes failed with errno=32 Broken pipe in /home/user/devel/payment-wip/vendor/k-shym/urfa-client/src/Connection.php on line 261
Добрый день.
Выполняю такой код:
$result = URFA_add_tariff($urfa, '41189', '41205', '65', '2210', '10.100.100.100', '255.255.255.255', '10.100.100.100', '');
// Добавить тариф и услуги
function URFA_add_tariff($urfa, $user_id, $account_id, $tariff_id, $discount_period_id, $ip_add, $netmask_add, $login_add, $password_add)
{
// Получаем информацию об услугах тарифа
$tsvc = $urfa->rpcf_get_tariff(array("tariff_id"=>$tariff_id));
print_r($tsvc);
// Подключаем тариф
$param["user_id"] = $user_id;
$param["account_id"] = $account_id;
$param["tariff_current"] = $tariff_id;
$param["discount_period_id"] = $discount_period_id;
$tariff_link_id = $urfa->rpcf_link_user_tariff($param);
echo "\nlink tariff to user"."\n";
print_r($tariff_link_id);
// Подключение всех услуг
$max = count($tsvc['services_count']);
for ($i = 0; $i < $max; $i++) {
$srv_in_tarif = $tsvc['services_count'][$i];
$service_new = array();
$service_new['user_id'] = $user_id;
$service_new['account_id'] = $account_id;
$service_new['unabon'] = 1;
$service_new['service_id'] = $srv_in_tarif['service_id_array'];
$service_new['service_type'] = $srv_in_tarif['service_type_array'];
$service_new['tariff_link_id'] = $tariff_link_id['tariff_link_id'];
if ($srv_in_tarif['service_type_array'] == '2') {
// Периодическая услуга
$service_new['discount_period_id'] = $discount_period_id;
// Добавляем услугу
$report = $urfa->rpcf_add_periodic_slink_ex($service_new);
echo "\n"."service_new array =>"."\n";
print_r($service_new);
echo "\nadd periodic service link =>"."\n";
print_r($report);
}
if ($srv_in_tarif['service_type_array'] == '3') {
// услуга "Передача IP-трафика"
$service_new['service_id'] = $srv_in_tarif['service_id_array'];
$service_new['discount_period_id'] = $discount_period_id;
$service_new['unabon'] = 1;
$service_new['unprepay'] = 0;
$service_new['ip_groups_count'][] = array(
'ip_address' => $ip_add,
'mask' => $netmask_add,
'mac' => "",
'allowed_cid' => "",
'iptraffic_login'=> $login_add,
'iptraffic_allowed_cid' => '',
'iptraffic_password'=> $password_add,
'ip_not_vpn' => 0,
'dont_use_fw' => 0,
'router_id' => 0,
);
$service_new['quota'] = array();
// Добавляем услугу
echo "\n"."service_new array =>"."\n";
print_r($service_new);
$report = $urfa->rpcf_add_ip_slink_ex($service_new);
echo "\nadd IP-traffic service link"."\n";
print_r($report);
}
}
print_r(URFAClient::trace_log());
}
Появляются ошибки именно при подключении тарифа с услугой "Передача IP-трафика". Тариф с периодической услугой подключается без проблем.
PHP Notice: Undefined offset: 0 in /noc/www/vhosts/htdocs/.../URFAClient/classes/URFAClient/Packet.php on line 95
Notice: Undefined offset: 0 in /noc/www/vhosts/htdocs/.../URFAClient/classes/URFAClient/Packet.php on line 95
PHP Warning: unpack(): Type N: not enough input, need 4, have 0 in /noc/www/vhosts/htdocs/.../URFAClient/classes/URFAClient/Packet.php on line 276
Warning: unpack(): Type N: not enough input, need 4, have 0 in /noc/www/vhosts/htdocs/.../URFAClient/classes/URFAClient/Packet.php on line 276
add IP-traffic service link
Array
(
[slink_id] =>
)
Array
(
[0] => 2021.04.01 18:51:48 INFO: rpcf_get_tariff( Array ( [tariff_id] => 65 ) ) -> Array ( [tariff_name] => тариф "Безлимитный 250р." [tariff_create_date] => 1141129132 [who_create] => -1 [who_create_login] => admin [tariff_change_date] => 1611927868 [who_change] => -43 [who_change_login] => test [tariff_expire_date] => 2000000000 [tariff_is_blocked] => 0 [tariff_balance_rollover] => 0 [services_count] => Array ( [0] => Array ( [service_id_array] => 102 [service_type_array] => 3 [service_name_array] => услуга "Безлимитный 250р." [comment_array] => 50 Мбит/сек, 250 рублей в месяц [link_by_default_array] => 1 [is_dynamic_array] => 0 ) ) ) 0.095ms
[1] => 2021.04.01 18:51:48 INFO: rpcf_link_user_tariff( Array ( [user_id] => 41189 [account_id] => 41205 [tariff_current] => 65 [discount_period_id] => 2210 ) ) -> Array ( [tariff_link_id] => 47364 ) 0.165ms
[2] => 2021.04.01 18:51:48 INFO: rpcf_add_ip_slink_ex( Array ( [user_id] => 41189 [account_id] => 41205 [unabon] => 1 [service_id] => 102 [service_type] => 3 [tariff_link_id] => 47364 [discount_period_id] => 2210 [unprepay] => 0 [ip_groups_count] => Array ( [0] => Array ( [ip_address] => 10.100.100.100 [mask] => 255.255.255.255 [mac] => [allowed_cid] => [iptraffic_login] => 10.100.100.100 [iptraffic_allowed_cid] => [iptraffic_password] => [ip_not_vpn] => 0 [dont_use_fw] => 0 [router_id] => 0 ) ) [quota] => Array ( ) ) ) -> Array ( [slink_id] => ) 0.109ms
)
На UTM 5.3-005 при вызове rpcf_add_iptraffic_service_link_ipv6 0x294e возникает ошибка Undefined offset: 0 на строке 95 в Packet.php.
Если я правильно понял, эта функция не только для ipv6, по этому пытаюсь создать сервисную связку для ipv4: в качестве ip использую адрес, полученный в rpcf_get_iptraffic_service_link (long2ip), маска - 32.
Что я делаю не так?
пробую сделать смену логина и пароля в утм 5,3
Выполняю такие действия:
$service_new['slink_id'] = "11736";
$all_service = $urfa->rpcf_get_iptraffic_service_link_ipv6($service_new);
$all_service["ip_groups_count"][0]["iptraffic_login"]="172.30.49.40";
$all_service["ip_groups_count"][0]["iptraffic_password"]="172.30.49.40";
$services_tariff = $urfa->rpcf_edit_iptraffic_service_link_ipv6($all_service);
print_r(URFAClient::trace_log());
в итоге получаю такую ошибку:
[1] => 2016.05.23 14:46:20 ERROR: rpcf_edit_iptraffic_service_link_ipv6( Array ( [tariff_link_id] => 1741 [is_blocked] => 0 [discount_period_id] => 2171 [start_date] => 1392148800 [expire_date] => 2130706431 [policy_id] => 1 [cost_coef] => 1 [unabon] => 0 [unprepay] => 0 [tariff_id] => 73 [parent_id] => 2 [bandwidth_in] => 0 [bandwidth_out] => 0 [ip_groups_count] => Array ( [0] => Array ( [ip_address] => 192.168.0.10 [mask] => 32 [mac] => [iptraffic_login] => 172.30.49.40 [iptraffic_password] => 172.30.49.40 [iptraffic_allowed_cid] => [pool_name] => [ip_not_vpn] => 0 [dont_use_fw] => 0 [is_dynamic] => 0 [router_id] => 0 [switch_id] => 0 [port_id] => 0 [vlan_id] => 0 [pool_id] => 0 ) ) [quotas_count] => Array ( [0] => Array ( [tclass_id] => 0 [tclass_name] => Unknown [quota] => 0.0000000 ) [1] => Array ( [tclass_id] => 10 [tclass_name] => Входящий [quota] => 0.0000000 ) [2] => Array ( [tclass_id] => 20 [tclass_name] => Исходящий [quota] => 0.0000000 ) [3] => Array ( [tclass_id] => 30 [tclass_name] => локальный [quota] => 0.0000000 ) ) ) ): Not implemented for PHP x32
Version:5.2.1-009-update2
<function name="rpcf_search_users_lite" id="0x1202">
<input>
<string name="login" />
<string name="email" />
<string name="fname" />
</input>
<output>
<integer name="success" />
<integer name="total" />
<integer name="show_count" />
<if variable="show_count" value="0" condition="ne">
<for name="i" from="0" count="show_count">
<integer name="id" array_index="i" />
<string name="login" array_index="i" />
<string name="email" array_index="i" />
<string name="name" array_index="i" />
</for>
</if>
</output>
</function>```
Если пользователь найден, то возникает ошибка:
```PHP Fatal error: Uncaught exception 'Exception' with message 'Not provided an error, contact the developer (_proccess_data_output)' in /MYUTM/ORFA_xmp/URFAClient/classes/URFAClient/API.php:315
Stack trace:
#0 /MYUTM/ORFA_xmp/URFAClient/classes/URFAClient/API.php(304): URFAClient_API-_proccess_data_output(Object(SimpleXMLElement), Object(URFAClient_Packet))
#1 /MYUTM/ORFA_xmp/URFAClient/classes/URFAClient/API.php(95): URFAClient_API-_proccess_data_output(Object(SimpleXMLElement), Object(URFAClient_Packet))
#2 /MYUTM/ORFA_xmp/rpcf_search_users_lite.php(16): URFAClient_API->__call('rpcf_search_use...', Array)
#3 /MYUTM/ORFA_xmp/rpcf_search_users_lite.php(16): URFAClient_API-rpcf_search_users_lite(Array)
#4 {main}
thrown in /MYUTM/ORFA_xmp/URFAClient/classes/URFAClient/API.php on line 315
Если не найден, то возвращается результат вида:
array(3) {
["success"]=>
int(0)
["total"]=>
int(0)
["show_count"]=>
int(0)
}
Пытаюсь выполнить поиск через rpcf_search_users_new
пример:
->rpcf_search_users_new([
'select_type' => 0,
'patterns_count' => [
[
'what' => 2,
'criteria_id' => 3,
'pattern' => 'test1',
]
],
]);
скрипт при попытке выполнения выпадает в OOM
путём дебага и траблшутинга выяснил, что фейлится вот в этом месте
Признаюсь честно: я логикой так и не допёр, что там должно происходить, но в моём случае в $count
обнаруживается не целое число, а массив, и функция вызывает сама себя, передавая ту же ноду, с которой работала.
такая фигня происходит, похоже, потому что внутри for
вложен ещё один for
(в api.xml)
захардкодил костыль
if (!is_numeric($count)) {
error_log(print_r($count, true));
break;
}
вроде как-то работает, но, подозреваю что косячно… может, в случае с массивом надо в функцию передать не ту же ноду, а дочерние?..
в общем, взываю к помощи @k-shym
спасибо
Приветствую.
Обновился какой то пакет на сервере, теперь не идет коннект до UTM.
Array ( [0] => 2017.08.19 12:46:43 ERROR: rpcf_core_version( Array ( ) ): Error code 0 )
на стороне УТМ пишет что ошибка ssl соединения, на стороне урфы, пишет error 0.
Такое было когда в конфиге указывал ssl, но тут у меня tls
Пробовал на php 5.6 / 7.1
openssl version
OpenSSL 1.1.0f 25 May 2017
коннект
$urfa = URFAClient::init(array(
'login' => 'init',
'password' => 'pass',
'address' => host,
'timeout' => 30,
'protocol' => 'tls',
'log' => true,
));
При попытки вызвать любую функцию (например rpcf_get_users_list) получаем ответ - Error code 0
Самое интересное что с локального компа (Win 8, apache 24 и php 5.6) все работает без проблем.
Ошибка появляется только на продакшин серверах - OC Debian 8 nginx и php 5.6 (сборки php везде одинаковы)
UTM работает на FreeBSD 9.2-STABLE FreeBSD 9.2-STABLE amd64
Не подскажите описание ошибки или где можно прочитать?
Версия билинга 5.3-003, используется api_53-003.xml. PHP 5.4.45-0+deb7u12 (cli)
Решил перевести хозяйство на ваш класс. Кстати чудесный продукт, спасибо вам!
Но столкнулся с странным форматом результата функции rpcf_get_all_services_for_user.
В старой версии urfa-php результат выглядит вот так:
Array
(
[count] => 1
[services] => Array
(
[0] => Array
(
[id] => 190
[type] => 3
[name] => Интернет
[tarif_name] => ФЛ/Unlim 880
[cost] => 0
[slink_id] => 72722
[period] => 1235
)
)
)
В вашей версии вот так:
Array
(
[slink_id_count] => Array
(
[0] => Array
(
[service_id] => 190
[service_type_array] => 3
[service_name_array] => Интернет
[tariff_name_array] => ФЛ/Unlim 880
[service_cost_array] => 0
[slink_id_array] => 72722
[discount_period_id_array] => 1235
)
)
)
Понятно что в старой урфе искусственно, ручным кодом, приведено к такому результату.
Но в вашей версии смущает индекс массива [slink_id_count], меня прямо выворачивает от его бессмысленности ;-)
Успокойте меня пожалуйста - так и должно быть? ;-)
Вот, для удобства, описание функции из xml:
<function name="rpcf_get_all_services_for_user" id="0x2700">
<input>
<integer name="account_id"/>
</input>
<output>
<integer name="slink_id_count"/>
<for name="i" from="0" count="slink_id_count">
<integer name="service_id"/>
<if variable="service_id" value="-1" condition="ne">
<set src="service_id" dst="service_id_array" dst_index="i"/>
<integer name="service_type_array" array_index="i"/>
<string name="service_name_array" array_index="i"/>
<string name="tariff_name_array" array_index="i"/>
<double name="service_cost_array" array_index="i"/>
<integer name="slink_id_array" array_index="i"/>
<integer name="discount_period_id_array" array_index="i"/>
</if>
<if variable="service_id" value="-1" condition="eq">
<set dst="service_id_array" dst_index="i" value="-1"/>
<set dst="service_type_array" dst_index="i" value="-1"/>
<set dst="service_name_array" dst_index="i" value=""/>
<set dst="tariff_name_array" dst_index="i" value=""/>
<set dst="service_cost_array" dst_index="i" value="-1"/>
<set dst="slink_id_array" dst_index="i" value="-1"/>
<set dst="discount_period_id_array" dst_index="i" value="-1"/>
</if>
</for>
</output>
</function>
Возможно ли добавить некий флаг для формирования адекватных названий полей результата?
К примеру, чтоб при установке флага вместо [services_count] => Array(...
на выходе было [services] => Array(...
.
Как я понимаю странные имена получаются только у массивов:
<integer name="tariffs_count" />
<for name="i" from="0" count="tariffs_count">
...
<integer name="services_count"/>
<for name="i" from="0" count="services_count">
Обрезать суффиксы _size, _count.
А в некоторых случаях игнорировать полностью:
<function name="rpcf_get_user_contacts" id="0x2021">
<input>
<integer name="user_id" />
</input>
<output>
<integer name="size" />
<for name="i" from="0" count="size">
<integer name="id" array_index="i" />
<string name="person" array_index="i" />
<string name="descr" array_index="i" />
<string name="contact" array_index="i" />
<string name="email" array_index="i" />
<integer name="email_notify" array_index="i" />
<string name="short_name" array_index="i" />
<string name="birthday" array_index="i" />
<integer name="id_exec_man" array_index="i" />
</for>
</output>
</function>
чтоб на выходе был не
Array
(
[size] => Array
(
[0] => Array
( ...
а вот так
Array
(
[0] => Array
( ...
А то на urfa-php написано грандиозное количество кода.
Переделка параметров из кучи переменных в массив - это благо, улучшает читабельность.
А переделка результатов - ад кромешный, читабельность кода существенно снижает :-(
Заранее благодарю!
Есть утм 5,3
пытаюсь вывести список услуг, делаю вызов
rpcf_get_services_list
получаю что то не ясное:
[41] => Array ( [service_id_array] => 162 [service_name_array] => internet [service_type_array] => 3 [service_comment_array] => [service_status_array] => 2 )
[42] => Array
(
[service_id_array] => 1433300073
[service_name_array] => �
[service_type_array] => 1768846437
[service_comment_array] => �
[service_status_array] =>
)
[43] => Array
(
[service_id_array] => 2
[service_name_array] => unlim5/250/d
[service_type_array] => 164
[service_comment_array] => абон плата
[service_status_array] => 2
)
[44] => Array
(
[service_id_array] =>
[service_name_array] => �
[service_type_array] => 1970170985
[service_comment_array] => �
[service_status_array] => -793718607
)
Пробую на стареньком билинге 5.2.1-005.
С разбегу заставить работать не удалось. Но чуть изменил код - отключил шифрование, и все завелось.
Изменил конструктор
public function __construct(Array $data)
{
$context = stream_context_create();
if ($data['protocol'] !== 'none') {
if ($data['admin'] AND $data['protocol'] !== 'tls')
{
stream_context_set_option($context, 'ssl', 'capture_peer_cert', TRUE);
stream_context_set_option($context, 'ssl', 'local_cert', __DIR__ . '/../../admin.crt');
stream_context_set_option($context, 'ssl', 'passphrase', 'netup');
stream_context_set_option($context, 'ssl', 'ciphers', 'SSLv3');
}
else
{
stream_context_set_option($context, 'ssl', 'ciphers', 'ADH-RC4-MD5');
}
stream_context_set_option($context, 'ssl', 'verify_peer', FALSE);
stream_context_set_option($context, 'ssl', 'verify_peer_name', FALSE);
}
$data['address'] = gethostbyname($data['address']);
$this->_socket = stream_socket_client("tcp://{$data['address']}:{$data['port']}", $errno, $errstr, $data['timeout'], STREAM_CLIENT_CONNECT, $context);
if ( ! $this->_socket)
throw new Exception("$errstr ($errno)");
stream_set_timeout($this->_socket, $data['timeout']);
if ( ! $this->_auth($data['login'], $data['password'], $data['admin'], $data['protocol']))
throw new Exception('Login or password incorrect');
}
и пару строк в protected function _auth($login, $password, $admin, $protocol)
if ($protocol === 'none')
$packet->set_attr_int(false, 10);
else
$packet->set_attr_int(($protocol === 'tls') ? 6 : (($admin) ? 4 : 2), 10);
$data=[
'sid'=>679,
'st'=>3,
'cnt'=> [
[
'vendor'=>43823,
'attr'=>1,
'usage_flags'=>1,
'tag'=>0,
'expire_date'=>2000000000,
'param1'=>1,
'tmp_type'=>1,
'val'=>'234234fsdfsdfsdf',
'prop_size'=>[]
]
]
];
$uf->rpcf_set_radius_attr($data);
Возвращает false (bool) пробовал всё что только можно через pyurfa которую писал работает, видимо не правильно парсятся входящие данные
Спасибо за новую версию!
Можно пояснить вот эти изменения:
Они как то скажутся на формате результатов функций?
Заранее благодарю!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.