Переслалstarchik писал(а):не получил...........
urfaclient на php
-
- Сообщения: 12
- Зарегистрирован: Чт сен 22, 2011 11:51
а можно мне тоже пропатченную версию плиз переслать
а то у меня на
linux gentoo
billing1 ~ # php -v
PHP 5.3.6-pl0-gentoo (cli) (built: Jun 9 2011 16:14:05)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
NetUP UTM billing system core. Compile date: Apr 7 2011 16:19:18
Version:5.2.1-008-update4-centos5 Rev #11993
Copyright (c) 2001-2011 NetUP Inc. www.netup.ru
неотрабатывает пример-файл (example.php) (который находился а архиве)
billing1 urfa # php example.php
Error in line 27Error code 0PHP Notice: Undefined variable: urfa_admin in /netup/utm5/urfa/example.php on line 21
Notice: Undefined variable: urfa_admin in /netup/utm5/urfa/example.php on line 21
PHP Fatal error: Call to a member function rpcf_get_accountinfo() on a non-object in /netup/utm5/urfa/example.php on line 21
Fatal error: Call to a member function rpcf_get_accountinfo() on a non-object in /netup/utm5/urfa/example.php on line 21
а то у меня на
linux gentoo
billing1 ~ # php -v
PHP 5.3.6-pl0-gentoo (cli) (built: Jun 9 2011 16:14:05)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
NetUP UTM billing system core. Compile date: Apr 7 2011 16:19:18
Version:5.2.1-008-update4-centos5 Rev #11993
Copyright (c) 2001-2011 NetUP Inc. www.netup.ru
неотрабатывает пример-файл (example.php) (который находился а архиве)
billing1 urfa # php example.php
Error in line 27Error code 0PHP Notice: Undefined variable: urfa_admin in /netup/utm5/urfa/example.php on line 21
Notice: Undefined variable: urfa_admin in /netup/utm5/urfa/example.php on line 21
PHP Fatal error: Call to a member function rpcf_get_accountinfo() on a non-object in /netup/utm5/urfa/example.php on line 21
Fatal error: Call to a member function rpcf_get_accountinfo() on a non-object in /netup/utm5/urfa/example.php on line 21
-
- Сообщения: 12
- Зарегистрирован: Чт сен 22, 2011 11:51
-
- Сообщения: 12
- Зарегистрирован: Чт сен 22, 2011 11:51
http://wiki.flintnet.ru/doku.php?id=urf ... dmin_tablejamaikaoleg писал(а):большое спс,сработало
вопрос подскажите а функция rpcf_set_radius_attr\rpcf_get_radius_attr
планируется ? для получения\выставления радиусатрибутов
-
- Сообщения: 12
- Зарегистрирован: Чт сен 22, 2011 11:51
Пытаюсь установить рудиус тарибут (чуть изменил функцию передачи радиус атрибутов,чтоб принимал не масив а переменные)
функция
function rpcf_set_radius_attr($sid,$st,$vendor,$attr,$param1) { //0x10100
$ret = array();
if (!$this->connection->urfa_call(0x10100)) {
print "Error calling function ". __FUNCTION__ ."\n";
return FALSE;
}
$packet = $this->connection->getPacket();
$packet->DataSetInt($sid);
$packet->DataSetInt($st);
$packet->DataSetInt($cnt);
$packet->DataSetInt($vendor);
$packet->DataSetInt($attr);
$packet->DataSetInt($param1);
$packet->DataSetString($cval);
$this->connection->urfa_send_param($packet);
}
вызов функции print_r($urfa_admin->rpcf_set_radius_attr(1107,10000,0,11,123));
таил из дебага
Info : Oct 12 14:37:13 b24f7b70 RPCServer@10.10.10.4: Client connecting: 10.10.10.4:41950
Info : Oct 12 14:37:13 b24f7b70 RPCConn: Connection from: 10.10.10.4:41950 new Session Key <d96d954e34f5824b9e428438b76976fa>
Info : Oct 12 14:37:13 b24f7b70 RPCConn: Card user <init@10.10.10.4> is connecting
?Debug : Oct 12 14:37:13 b24f7b70 DBA:Ctx: Looking for urgent DB context
?Debug : Oct 12 14:37:13 b24f7b70 DBA Groups: Group: -1 from 1
?Debug : Oct 12 14:37:13 b24f7b70 DBA:Ctx: Pushing back urgent DB context
-Stats : Oct 12 14:37:13 b24f7b70 DBA Groups: Stats: Uptime: 00:00:00. Events: 0; Errors: 0
?Debug : Oct 12 14:37:13 b24f7b70 StreamManager: connection <179> created
Info : Oct 12 14:37:13 b24f7b70 RPCConn[SSL]<init@10.10.10.4>: Access granted to [SSL]<init@10.10.10.4> (UID: -1)
?Debug : Oct 12 14:37:13 b24f7b70 RPCConn[SSL]<init@10.10.10.4>: SSL type requested: SSLv3(4)
?Debug : Oct 12 14:37:13 b24f7b70 RPCConn[SSL]<init@10.10.10.4>: Call: 0x10100 (rpcf_set_raduis_attr)
?Debug : Oct 12 14:37:13 b24f7b70 RPCConn[SSL]<init@10.10.10.4>: Real Call: 0x10100 (rpcf_set_raduis_attr)
?Debug : Oct 12 14:37:13 b24f7b70 DBCtx: <141597376> SQL query: DELETE FROM radius_data WHERE owner_id='1107' AND owner_type='10000'
?Debug : Oct 12 14:37:13 b24f7b70 UTM5 DBA: Calling reread custom radius attributes for iptraffic slink
?Debug : Oct 12 14:37:13 b24f7b70 DBCtx: <141597376> SQL SELECT query: SELECT id,vendor,attr,attr_type,value FROM radius_data WHERE owner_id='1107' AND owner_type='10000'
?Debug : Oct 12 14:37:13 b24f7b70 UTM5 DBA: Calling rehash for ip group
?Debug : Oct 12 14:37:13 b24f7b70 Radius: Ip-traffic slink <1107> custom radius attrs size <0>
?Debug : Oct 12 14:37:13 b24f7b70 Radius: Empty IP_group... Not sending...
?Debug : Oct 12 14:37:13 b24f7b70 RPCConn[SSL]<init@10.10.10.4>: Call 0x10100 (rpcf_set_raduis_attr) finished...
?Debug : Oct 12 14:37:13 b24f7b70 RPCConn[SSL]<init@10.10.10.4>: Stream cleared
Warn : Oct 12 14:37:13 b24f7b70 RPCConn[SSL]<init@10.10.10.4>: Session closed
?Debug : Oct 12 14:37:13 b24f7b70 RPCConn[SSL]<init@10.10.10.4>: Session Key <d96d954e34f5824b9e428438b76976fa> stored for UID -1 from <10.10.10.4>
?Debug : Oct 12 14:37:13 b24f7b70 RPCConn[SSL]<init@10.10.10.4>: SSL cleared
?Debug : Oct 12 14:37:13 b24f7b70 StreamManager: connection <179> closed
?Debug : Oct 12 14:37:13 b24f7b70 RPCConn[SSL]<init@10.10.10.4>: Session closed...
непонятно одно почему он удаляет вначале атрибуты
?Debug : Oct 12 14:37:13 b24f7b70 DBCtx: <141597376> SQL query: DELETE FROM radius_data WHERE owner_id='1107' AND owner_type='10000'
а потом делает выборку из удаленных (разве такое возможно,он ведь удалил WHERE owner_id='1107' AND owner_type='10000')
?Debug : Oct 12 14:37:13 b24f7b70 DBCtx: <141597376> SQL SELECT query: SELECT id,vendor,attr,attr_type,value FROM radius_data WHERE owner_id='1107' AND owner_type='10000'
соответствеено из базы удалились атрибуты соответствующие фильтру WHERE owner_id='1107' AND owner_type='10000'
функция
function rpcf_set_radius_attr($sid,$st,$vendor,$attr,$param1) { //0x10100
$ret = array();
if (!$this->connection->urfa_call(0x10100)) {
print "Error calling function ". __FUNCTION__ ."\n";
return FALSE;
}
$packet = $this->connection->getPacket();
$packet->DataSetInt($sid);
$packet->DataSetInt($st);
$packet->DataSetInt($cnt);
$packet->DataSetInt($vendor);
$packet->DataSetInt($attr);
$packet->DataSetInt($param1);
$packet->DataSetString($cval);
$this->connection->urfa_send_param($packet);
}
вызов функции print_r($urfa_admin->rpcf_set_radius_attr(1107,10000,0,11,123));
таил из дебага
Info : Oct 12 14:37:13 b24f7b70 RPCServer@10.10.10.4: Client connecting: 10.10.10.4:41950
Info : Oct 12 14:37:13 b24f7b70 RPCConn: Connection from: 10.10.10.4:41950 new Session Key <d96d954e34f5824b9e428438b76976fa>
Info : Oct 12 14:37:13 b24f7b70 RPCConn: Card user <init@10.10.10.4> is connecting
?Debug : Oct 12 14:37:13 b24f7b70 DBA:Ctx: Looking for urgent DB context
?Debug : Oct 12 14:37:13 b24f7b70 DBA Groups: Group: -1 from 1
?Debug : Oct 12 14:37:13 b24f7b70 DBA:Ctx: Pushing back urgent DB context
-Stats : Oct 12 14:37:13 b24f7b70 DBA Groups: Stats: Uptime: 00:00:00. Events: 0; Errors: 0
?Debug : Oct 12 14:37:13 b24f7b70 StreamManager: connection <179> created
Info : Oct 12 14:37:13 b24f7b70 RPCConn[SSL]<init@10.10.10.4>: Access granted to [SSL]<init@10.10.10.4> (UID: -1)
?Debug : Oct 12 14:37:13 b24f7b70 RPCConn[SSL]<init@10.10.10.4>: SSL type requested: SSLv3(4)
?Debug : Oct 12 14:37:13 b24f7b70 RPCConn[SSL]<init@10.10.10.4>: Call: 0x10100 (rpcf_set_raduis_attr)
?Debug : Oct 12 14:37:13 b24f7b70 RPCConn[SSL]<init@10.10.10.4>: Real Call: 0x10100 (rpcf_set_raduis_attr)
?Debug : Oct 12 14:37:13 b24f7b70 DBCtx: <141597376> SQL query: DELETE FROM radius_data WHERE owner_id='1107' AND owner_type='10000'
?Debug : Oct 12 14:37:13 b24f7b70 UTM5 DBA: Calling reread custom radius attributes for iptraffic slink
?Debug : Oct 12 14:37:13 b24f7b70 DBCtx: <141597376> SQL SELECT query: SELECT id,vendor,attr,attr_type,value FROM radius_data WHERE owner_id='1107' AND owner_type='10000'
?Debug : Oct 12 14:37:13 b24f7b70 UTM5 DBA: Calling rehash for ip group
?Debug : Oct 12 14:37:13 b24f7b70 Radius: Ip-traffic slink <1107> custom radius attrs size <0>
?Debug : Oct 12 14:37:13 b24f7b70 Radius: Empty IP_group... Not sending...
?Debug : Oct 12 14:37:13 b24f7b70 RPCConn[SSL]<init@10.10.10.4>: Call 0x10100 (rpcf_set_raduis_attr) finished...
?Debug : Oct 12 14:37:13 b24f7b70 RPCConn[SSL]<init@10.10.10.4>: Stream cleared
Warn : Oct 12 14:37:13 b24f7b70 RPCConn[SSL]<init@10.10.10.4>: Session closed
?Debug : Oct 12 14:37:13 b24f7b70 RPCConn[SSL]<init@10.10.10.4>: Session Key <d96d954e34f5824b9e428438b76976fa> stored for UID -1 from <10.10.10.4>
?Debug : Oct 12 14:37:13 b24f7b70 RPCConn[SSL]<init@10.10.10.4>: SSL cleared
?Debug : Oct 12 14:37:13 b24f7b70 StreamManager: connection <179> closed
?Debug : Oct 12 14:37:13 b24f7b70 RPCConn[SSL]<init@10.10.10.4>: Session closed...
непонятно одно почему он удаляет вначале атрибуты
?Debug : Oct 12 14:37:13 b24f7b70 DBCtx: <141597376> SQL query: DELETE FROM radius_data WHERE owner_id='1107' AND owner_type='10000'
а потом делает выборку из удаленных (разве такое возможно,он ведь удалил WHERE owner_id='1107' AND owner_type='10000')
?Debug : Oct 12 14:37:13 b24f7b70 DBCtx: <141597376> SQL SELECT query: SELECT id,vendor,attr,attr_type,value FROM radius_data WHERE owner_id='1107' AND owner_type='10000'
соответствеено из базы удалились атрибуты соответствующие фильтру WHERE owner_id='1107' AND owner_type='10000'
-
- Сообщения: 12
- Зарегистрирован: Чт сен 22, 2011 11:51
вот таил из дебага при редактировании\добавлении ЧЕРЕЗ АДМИНКУ атрибута для пользователя на услугу
?Debug : Oct 12 14:59:44 b23f6b70 DBCtx: <141597376> SQL query: DELETE FROM radius_data WHERE owner_id='1108' AND owner_type='10000'
?Debug : Oct 12 14:59:44 b23f6b70 DBCtx: <141597376> SQL query: INSERT INTO radius_data(owner_id,owner_type,vendor,attr,attr_type,value) VALUES('1108','10000','0','11','1','123123')
?Debug : Oct 12 14:59:44 b23f6b70 UTM5 DBA: Calling reread custom radius attributes for dialup slink
?Debug : Oct 12 14:59:44 b23f6b70 DBCtx: <141597376> SQL SELECT query: SELECT id,vendor,attr,attr_type,value FROM radius_data WHERE owner_id='1108' AND owner_type='10000'
?Debug : Oct 12 14:59:44 b23f6b70 UTM5 DBA: Found custom radius attribute <11> vendor <0>
?Debug : Oct 12 14:59:44 b23f6b70 UTM5 DBA: Calling rehash for dialup slink
?Debug : Oct 12 14:59:44 b23f6b70 Radius: Geting service id and account id for dialup slink: 1108
?Debug : Oct 12 14:59:44 b23f6b70 Radius: Sending RADIUS attrubutes ... size <1>
?Debug : Oct 12 14:59:44 b23f6b70 Radius: Vendor <0> attr <11>
?Debug : Oct 12 14:59:44 b23f6b70 Radius: End sending RADIUS attrubutes ... size <1>
?Debug : Oct 12 14:59:44 b23f6b70 Radius: DULink 1108: 'anton'/'anton' Callback <0>
?Debug : Oct 12 14:59:44 b23f6b70 RPCConn[SSL]<init@10.10.10.211>: Call 0x10100 (rpcf_set_raduis_attr) finished...
?Debug : Oct 12 14:59:44 b23f6b70 RPCConn[SSL]<init@10.10.10.211>: Stream cleared
как видим после действия DELETE (1)
в базе присутствует действие INSERT (2)
и как раз только после этого идет перечитывание атрибутов SELECT (3)
1-DELETE FROM radius_data WHERE owner_id='1108' AND owner_type='10000'
2-INSERT INTO radius_data(owner_id,owner_type,vendor,attr,attr_type,value) VALUES('1108','10000','0','11','1','123123')
3-SQL SELECT query: SELECT id,vendor,attr,attr_type,value FROM radius_data WHERE owner_id='1108' AND owner_type='10000'
?Debug : Oct 12 14:59:44 b23f6b70 DBCtx: <141597376> SQL query: DELETE FROM radius_data WHERE owner_id='1108' AND owner_type='10000'
?Debug : Oct 12 14:59:44 b23f6b70 DBCtx: <141597376> SQL query: INSERT INTO radius_data(owner_id,owner_type,vendor,attr,attr_type,value) VALUES('1108','10000','0','11','1','123123')
?Debug : Oct 12 14:59:44 b23f6b70 UTM5 DBA: Calling reread custom radius attributes for dialup slink
?Debug : Oct 12 14:59:44 b23f6b70 DBCtx: <141597376> SQL SELECT query: SELECT id,vendor,attr,attr_type,value FROM radius_data WHERE owner_id='1108' AND owner_type='10000'
?Debug : Oct 12 14:59:44 b23f6b70 UTM5 DBA: Found custom radius attribute <11> vendor <0>
?Debug : Oct 12 14:59:44 b23f6b70 UTM5 DBA: Calling rehash for dialup slink
?Debug : Oct 12 14:59:44 b23f6b70 Radius: Geting service id and account id for dialup slink: 1108
?Debug : Oct 12 14:59:44 b23f6b70 Radius: Sending RADIUS attrubutes ... size <1>
?Debug : Oct 12 14:59:44 b23f6b70 Radius: Vendor <0> attr <11>
?Debug : Oct 12 14:59:44 b23f6b70 Radius: End sending RADIUS attrubutes ... size <1>
?Debug : Oct 12 14:59:44 b23f6b70 Radius: DULink 1108: 'anton'/'anton' Callback <0>
?Debug : Oct 12 14:59:44 b23f6b70 RPCConn[SSL]<init@10.10.10.211>: Call 0x10100 (rpcf_set_raduis_attr) finished...
?Debug : Oct 12 14:59:44 b23f6b70 RPCConn[SSL]<init@10.10.10.211>: Stream cleared
как видим после действия DELETE (1)
в базе присутствует действие INSERT (2)
и как раз только после этого идет перечитывание атрибутов SELECT (3)
1-DELETE FROM radius_data WHERE owner_id='1108' AND owner_type='10000'
2-INSERT INTO radius_data(owner_id,owner_type,vendor,attr,attr_type,value) VALUES('1108','10000','0','11','1','123123')
3-SQL SELECT query: SELECT id,vendor,attr,attr_type,value FROM radius_data WHERE owner_id='1108' AND owner_type='10000'
-
- Сообщения: 12
- Зарегистрирован: Чт сен 22, 2011 11:51
to ds
спс, дело оказалось в сертификате.
теперь что-то еще не работает. на 007 скрипт работал а на 008 не хочет
завершается с ошибкой
в логе
в дебаге
спс, дело оказалось в сертификате.
теперь что-то еще не работает. на 007 скрипт работал а на 008 не хочет
Код: Выделить всё
<?php
require_once("/netup/utm5/urfa/URFAClient.php");
$urfa_admin = new URFAClient_Admin("user","пароль","192.168.8.204","11758",true,true);
$account_id='1';
$account=$urfa_admin->rpcf_get_accountinfo($account_id); //-0x4024
// print_r($account);
$account['unlimited']="1";
$d_unlim=$urfa_admin->rpcf_save_account(1, $account, 0, 0, 0); // 0x2032
?>
Код: Выделить всё
Error calling function rpcf_save_account
Код: Выделить всё
ERROR : Oct 12 22:59:53 b2bfcb90 RPCServer@0.0.0.0: Exception in void* rpcf_save_account(void*): #22
Warn : Oct 12 22:59:53 b2bfcb90 RPCConn[SSL]<init@192.168.8.204>: Session closed
Код: Выделить всё
Info : Oct 12 22:59:53 b2bfcb90 RPCServer@0.0.0.0: Client connecting: 192.168.8.204:37073
Info : Oct 12 22:59:53 b2bfcb90 RPCConn: Connection from: 192.168.8.204:37073 new Session Key <a9e3954e9f2e3d3737696fe29bcaae36>
Info : Oct 12 22:59:53 b2bfcb90 RPCConn: Card user <init@192.168.8.204> is connecting
?Debug : Oct 12 22:59:53 b2bfcb90 DBA:Ctx: Looking for urgent DB context
?Debug : Oct 12 22:59:53 b2bfcb90 DBA Groups: Group: -5 from 1
?Debug : Oct 12 22:59:53 b2bfcb90 DBA:Ctx: Pushing back urgent DB context
-Stats : Oct 12 22:59:53 b2bfcb90 DBA Groups: Stats: Uptime: 00:00:00. Events: 0; Errors: 0
?Debug : Oct 12 22:59:53 b2bfcb90 StreamManager: connection <41> created
Info : Oct 12 22:59:53 b2bfcb90 RPCConn[SSL]<init@192.168.8.204>: Access granted to [SSL]<init@192.168.8.204> (UID: -5)
?Debug : Oct 12 22:59:53 b2bfcb90 RPCConn[SSL]<init@192.168.8.204>: SSL type requested: SSLv3(4)
?Debug : Oct 12 22:59:53 b2bfcb90 RPCConn[SSL]<init@192.168.8.204>: Call: 0x2030 (rpcf_get_accountinfo)
?Debug : Oct 12 22:59:53 b2bfcb90 RPCConn[SSL]<init@192.168.8.204>: Real Call: 0x2030 (rpcf_get_accountinfo)
?Debug : Oct 12 22:59:53 b2bfcb90 RPCConn[SSL]<init@192.168.8.204>: Call 0x2030 (rpcf_get_accountinfo) finished...
?Debug : Oct 12 22:59:53 b2bfcb90 RPCConn[SSL]<init@192.168.8.204>: Stream cleared
?Debug : Oct 12 22:59:53 b2bfcb90 RPCConn[SSL]<init@192.168.8.204>: Call: 0x2032 (rpcf_save_account)
?Debug : Oct 12 22:59:53 b2bfcb90 RPCConn[SSL]<init@192.168.8.204>: Real Call: 0x2032 (rpcf_save_account)
ERROR : Oct 12 22:59:53 b2bfcb90 RPCServer@0.0.0.0: Exception in void* rpcf_save_account(void*): #22
?Debug : Oct 12 22:59:53 b2bfcb90 RPCConn[SSL]<init@192.168.8.204>: Call 0x2032 (rpcf_save_account) finished...
?Debug : Oct 12 22:59:53 b2bfcb90 RPCConn[SSL]<init@192.168.8.204>: Stream cleared
Warn : Oct 12 22:59:53 b2bfcb90 RPCConn[SSL]<init@192.168.8.204>: Session closed
?Debug : Oct 12 22:59:53 b2bfcb90 RPCConn[SSL]<init@192.168.8.204>: Session Key <a9e3954e9f2e3d3737696fe29bcaae36> stored for UID -5 from <192.168.8.204>
?Debug : Oct 12 22:59:53 b2bfcb90 StreamManager: connection <41> closed
?Debug : Oct 12 22:59:53 b2bfcb90 RPCConn[SSL]<init@192.168.8.204>: Session closed...
Всем здравствуйте!
Не так давно обновились до версии 5.2.1-008-upd4 Rev #11993.
Со старой версией биллинга urfaclient работал без каких-либо нареканий. После обновления естественно все закончилось.
С http://wiki.flintnet.ru/ была скачана последняя версия урфы, пропатчена и сертификат был положен в корень папки с урфой.
Теперь в качестве теста при запуске example.php строка
выдает
Понятно, что не отрабатывает urfa_call, но что с этим делать, понять не могу.
Прошу, подскажите, что не так.
Заранее, спасибо!
Не так давно обновились до версии 5.2.1-008-upd4 Rev #11993.
Со старой версией биллинга urfaclient работал без каких-либо нареканий. После обновления естественно все закончилось.
С http://wiki.flintnet.ru/ была скачана последняя версия урфы, пропатчена и сертификат был положен в корень папки с урфой.
Теперь в качестве теста при запуске example.php строка
Код: Выделить всё
$accountinfo = $urfa_admin->rpcf_get_accountinfo(736);
Код: Выделить всё
Error calling function rpcf_get_accountinfo
****************************************
Прошу, подскажите, что не так.
Заранее, спасибо!