radius accounting

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

radius accounting

Peter Chamula
hello

i am trying to set up opensips with freeradius accounting, opensips and
freeradius are on separate servers
freeradius is patched (at least i hope so, becouse there were some problems)

in opensips.conf i need to add some field for radius
modparam("acc", "radius_extra",       "User-Name=$Au; \
                                       Calling-Station-Id=$from; \
                                       Called-Station-Id=$to; \
                                       Sip-Translated-Request-URI=$ru; \
                                       Sip-RPid=$avp(s:rpid); \
                                       Source-IP=$avp(s:source_ip); \
                                       Source-Port=$avp(s:source_port); \
                                       SIP-Proxy-IP=$avp(s:sip_proxy_ip); \
                                       Canonical-URI=$avp(s:can_uri); \
                                       Billing-Party=$avp(billing_party); \
                                     
Divert-Reason=$avp(s:divert_reason); \
                                       User-Agent=$hdr(user-agent); \
                                       Contact=$hdr(contact); \
                                       Event=$hdr(event); \
                                       ENUM-TLD=$avp(s:enum_tld)")

with this i am getting errors

if i try something more simple
modparam("acc", "radius_extra","User-Name=$Au; Calling-Station-Id=$from;
Called-Station-Id=$to; Sip-Translated-Request-URI=$
ru;")
works only with
modparam("acc", "radius_extra","User-Name=$Au; Calling-Station-Id=$from;
Called-Station-Id=$to")

ERROR:acc:parse_acc_extra: parse failed in <User-Name=$Au;
Calling-Station-Id=$from; Called-Station-Id=$to;
Sip-Translated-Request-URI=$ru;> around position 95

so error must be in Sip-Translated-Request-URI
my radius client config is set to modparam("acc", "radius_config",
"/usr/local/etc/radiusclient-ng/radiusclient.conf")

in this config dictionary points to dictionary    
/usr/local/etc/radiusclient-ng/dictionary
here i included this

$INCLUDE        /usr/local/etc/radiusclient-ng/dictionary.opensips
$INCLUDE        /usr/local/etc/radiusclient-ng/dictionary.mediaproxy

Sip-Translated-Request-URI is in dictionar.opensips

ATTRIBUTE Sip-Translated-Request-URI   107  string     # Proprietary, acc

please , can someone help me ?



--
Regards

Peter Chamula


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

chamula.vcf (116 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: radius accounting

Gabriel Bermudez
Hi Peter

Peter Chamula escribió:

> hello
>
> i am trying to set up opensips with freeradius accounting, opensips and
> freeradius are on separate servers
> freeradius is patched (at least i hope so, becouse there were some problems)
>
> in opensips.conf i need to add some field for radius
> modparam("acc", "radius_extra",       "User-Name=$Au; \
>                                        Calling-Station-Id=$from; \
>                                        Called-Station-Id=$to; \
>                                        Sip-Translated-Request-URI=$ru; \
>                                        Sip-RPid=$avp(s:rpid); \
>                                        Source-IP=$avp(s:source_ip); \
>                                        Source-Port=$avp(s:source_port); \
>                                        SIP-Proxy-IP=$avp(s:sip_proxy_ip); \
>                                        Canonical-URI=$avp(s:can_uri); \
>                                        Billing-Party=$avp(billing_party); \
>                                      
> Divert-Reason=$avp(s:divert_reason); \
>                                        User-Agent=$hdr(user-agent); \
>                                        Contact=$hdr(contact); \
>                                        Event=$hdr(event); \
>                                        ENUM-TLD=$avp(s:enum_tld)")
>
> with this i am getting errors
>
> if i try something more simple
> modparam("acc", "radius_extra","User-Name=$Au; Calling-Station-Id=$from;
> Called-Station-Id=$to; Sip-Translated-Request-URI=$
> ru;")
> works only with
> modparam("acc", "radius_extra","User-Name=$Au; Calling-Station-Id=$from;
> Called-Station-Id=$to")
>
> ERROR:acc:parse_acc_extra: parse failed in <User-Name=$Au;
> Calling-Station-Id=$from; Called-Station-Id=$to;
> Sip-Translated-Request-URI=$ru;> around position 95
>
> so error must be in Sip-Translated-Request-URI
> my radius client config is set to modparam("acc", "radius_config",
> "/usr/local/etc/radiusclient-ng/radiusclient.conf")
>
> in this config dictionary points to dictionary    
> /usr/local/etc/radiusclient-ng/dictionary
> here i included this
>
> $INCLUDE        /usr/local/etc/radiusclient-ng/dictionary.opensips
> $INCLUDE        /usr/local/etc/radiusclient-ng/dictionary.mediaproxy
>
> Sip-Translated-Request-URI is in dictionar.opensips
>
> ATTRIBUTE Sip-Translated-Request-URI   107  string     # Proprietary, acc
>
> please , can someone help me ?
>
>
>
>  
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>  

Something similar happened to me I change from

Billing-Party=$avp(billing_party); \ -> Billing-Party=$avp(s:billing_party); \

Try it out and tell us your experience

Regardas,

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: radius accounting

Bogdan-Andrei Iancu
In reply to this post by Peter Chamula
Hello Peter

Remove the trailing semicolon from the end of the string and it should work.

Regards,
Bogdan

Peter Chamula wrote:
> if i try something more simple
> modparam("acc", "radius_extra","User-Name=$Au; Calling-Station-Id=$from;
> Called-Station-Id=$to; Sip-Translated-Request-URI=$
> ru;")
>  
     ^^

> works only with
> modparam("acc", "radius_extra","User-Name=$Au; Calling-Station-Id=$from;
> Called-Station-Id=$to")
>
> ERROR:acc:parse_acc_extra: parse failed in <User-Name=$Au;
> Calling-Station-Id=$from; Called-Station-Id=$to;
> Sip-Translated-Request-URI=$ru;> around position 95
>
> so error must be in Sip-Translated-Request-URI
> my radius client config is set to modparam("acc", "radius_config",
> "/usr/local/etc/radiusclient-ng/radiusclient.conf")
>  


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: radius accounting

Peter Chamula
In reply to this post by Gabriel Bermudez
Hi, thanks for reply

it really helped me
but than i have nothing in this field in radius db
it is same with these fields

Sip-RPid=$avp(s:rpid); \
Source-IP=$avp(s:source_ip); \
Source-Port=$avp(s:source_port); \
SIP-Proxy-IP=$avp(s:sip_proxy_ip); \
Canonical-URI=$avp(s:can_uri); \

Billing-Party=$avp(billing_party); \

only working is canonical-uri, after adition this lines to route login

route {
       ...
       setflag(ACCOUNTING_FLAG);
       $avp(s:can_uri) = $ru;
       ...
}

but i dont know how to define other fields (espacialy billing-party, it
is very important to me)

thanks

Regards
Peter

Gabriel Bermudez  wrote / napísal(a):

> Hi Peter
>
> Peter Chamula escribió:
>  
>> hello
>>
>> i am trying to set up opensips with freeradius accounting, opensips and
>> freeradius are on separate servers
>> freeradius is patched (at least i hope so, becouse there were some problems)
>>
>> in opensips.conf i need to add some field for radius
>> modparam("acc", "radius_extra",       "User-Name=$Au; \
>>                                        Calling-Station-Id=$from; \
>>                                        Called-Station-Id=$to; \
>>                                        Sip-Translated-Request-URI=$ru; \
>>                                        Sip-RPid=$avp(s:rpid); \
>>                                        Source-IP=$avp(s:source_ip); \
>>                                        Source-Port=$avp(s:source_port); \
>>                                        SIP-Proxy-IP=$avp(s:sip_proxy_ip); \
>>                                        Canonical-URI=$avp(s:can_uri); \
>>                                        Billing-Party=$avp(billing_party); \
>>                                      
>> Divert-Reason=$avp(s:divert_reason); \
>>                                        User-Agent=$hdr(user-agent); \
>>                                        Contact=$hdr(contact); \
>>                                        Event=$hdr(event); \
>>                                        ENUM-TLD=$avp(s:enum_tld)")
>>
>> with this i am getting errors
>>
>> if i try something more simple
>> modparam("acc", "radius_extra","User-Name=$Au; Calling-Station-Id=$from;
>> Called-Station-Id=$to; Sip-Translated-Request-URI=$
>> ru;")
>> works only with
>> modparam("acc", "radius_extra","User-Name=$Au; Calling-Station-Id=$from;
>> Called-Station-Id=$to")
>>
>> ERROR:acc:parse_acc_extra: parse failed in <User-Name=$Au;
>> Calling-Station-Id=$from; Called-Station-Id=$to;
>> Sip-Translated-Request-URI=$ru;> around position 95
>>
>> so error must be in Sip-Translated-Request-URI
>> my radius client config is set to modparam("acc", "radius_config",
>> "/usr/local/etc/radiusclient-ng/radiusclient.conf")
>>
>> in this config dictionary points to dictionary    
>> /usr/local/etc/radiusclient-ng/dictionary
>> here i included this
>>
>> $INCLUDE        /usr/local/etc/radiusclient-ng/dictionary.opensips
>> $INCLUDE        /usr/local/etc/radiusclient-ng/dictionary.mediaproxy
>>
>> Sip-Translated-Request-URI is in dictionar.opensips
>>
>> ATTRIBUTE Sip-Translated-Request-URI   107  string     # Proprietary, acc
>>
>> please , can someone help me ?
>>
>>
>>
>>  
>> _______________________________________________
>> Users mailing list
>> [hidden email]
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>  
>>    
>
> Something similar happened to me I change from
>
> Billing-Party=$avp(billing_party); \ -> Billing-Party=$avp(s:billing_party); \
>
> Try it out and tell us your experience
>
> Regardas,
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>  


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

chamula.vcf (116 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: radius accounting

Bogdan-Andrei Iancu
In reply to this post by Peter Chamula
Hello Peter

Remove the trailing semicolon from the end of the "radius_extra" string  
and it should work.

Regards,
Bogdan

Peter Chamula wrote:

> if i try something more simple
> modparam("acc", "radius_extra","User-Name=$Au; Calling-Station-Id=$from;
> Called-Station-Id=$to; Sip-Translated-Request-URI=$
> ru;")
> works only with
> modparam("acc", "radius_extra","User-Name=$Au; Calling-Station-Id=$from;
> Called-Station-Id=$to")
>
> ERROR:acc:parse_acc_extra: parse failed in <User-Name=$Au;
> Calling-Station-Id=$from; Called-Station-Id=$to;
> Sip-Translated-Request-URI=$ru;> around position 95
>
>
>
>  
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>  


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: radius accounting

Bogdan-Andrei Iancu
In reply to this post by Peter Chamula
Hi Peter,

You can to populate those AVPs from your script, as you did for the
s:can_uri. In some cases, there is not need to use the intermediary IPs,
but to directly get the values from PVs:

Source-IP=$si; \
Source-Port=$sp; \
SIP-Proxy-IP=$aRi; \


See     http://www.opensips.org/index.php?n=Resources.DocsCoreVar   for
info about Pvs.

Regards,
Bogdan

Peter Chamula wrote:

> Hi, thanks for reply
>
> it really helped me
> but than i have nothing in this field in radius db
> it is same with these fields
>
> Sip-RPid=$avp(s:rpid); \
> Source-IP=$avp(s:source_ip); \
> Source-Port=$avp(s:source_port); \
> SIP-Proxy-IP=$avp(s:sip_proxy_ip); \
> Canonical-URI=$avp(s:can_uri); \
>
> Billing-Party=$avp(billing_party); \
>
> only working is canonical-uri, after adition this lines to route login
>
> route {
>        ...
>        setflag(ACCOUNTING_FLAG);
>        $avp(s:can_uri) = $ru;
>        ...
> }
>
> but i dont know how to define other fields (espacialy billing-party, it
> is very important to me)
>
> thanks
>
> Regards
> Peter
>
> Gabriel Bermudez  wrote / napísal(a):
>  
>> Hi Peter
>>
>> Peter Chamula escribió:
>>  
>>    
>>> hello
>>>
>>> i am trying to set up opensips with freeradius accounting, opensips and
>>> freeradius are on separate servers
>>> freeradius is patched (at least i hope so, becouse there were some problems)
>>>
>>> in opensips.conf i need to add some field for radius
>>> modparam("acc", "radius_extra",       "User-Name=$Au; \
>>>                                        Calling-Station-Id=$from; \
>>>                                        Called-Station-Id=$to; \
>>>                                        Sip-Translated-Request-URI=$ru; \
>>>                                        Sip-RPid=$avp(s:rpid); \
>>>                                        Source-IP=$avp(s:source_ip); \
>>>                                        Source-Port=$avp(s:source_port); \
>>>                                        SIP-Proxy-IP=$avp(s:sip_proxy_ip); \
>>>                                        Canonical-URI=$avp(s:can_uri); \
>>>                                        Billing-Party=$avp(billing_party); \
>>>                                      
>>> Divert-Reason=$avp(s:divert_reason); \
>>>                                        User-Agent=$hdr(user-agent); \
>>>                                        Contact=$hdr(contact); \
>>>                                        Event=$hdr(event); \
>>>                                        ENUM-TLD=$avp(s:enum_tld)")
>>>
>>> with this i am getting errors
>>>
>>> if i try something more simple
>>> modparam("acc", "radius_extra","User-Name=$Au; Calling-Station-Id=$from;
>>> Called-Station-Id=$to; Sip-Translated-Request-URI=$
>>> ru;")
>>> works only with
>>> modparam("acc", "radius_extra","User-Name=$Au; Calling-Station-Id=$from;
>>> Called-Station-Id=$to")
>>>
>>> ERROR:acc:parse_acc_extra: parse failed in <User-Name=$Au;
>>> Calling-Station-Id=$from; Called-Station-Id=$to;
>>> Sip-Translated-Request-URI=$ru;> around position 95
>>>
>>> so error must be in Sip-Translated-Request-URI
>>> my radius client config is set to modparam("acc", "radius_config",
>>> "/usr/local/etc/radiusclient-ng/radiusclient.conf")
>>>
>>> in this config dictionary points to dictionary    
>>> /usr/local/etc/radiusclient-ng/dictionary
>>> here i included this
>>>
>>> $INCLUDE        /usr/local/etc/radiusclient-ng/dictionary.opensips
>>> $INCLUDE        /usr/local/etc/radiusclient-ng/dictionary.mediaproxy
>>>
>>> Sip-Translated-Request-URI is in dictionar.opensips
>>>
>>> ATTRIBUTE Sip-Translated-Request-URI   107  string     # Proprietary, acc
>>>
>>> please , can someone help me ?
>>>
>>>
>>>
>>>  
>>> _______________________________________________
>>> Users mailing list
>>> [hidden email]
>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>  
>>>    
>>>      
>> Something similar happened to me I change from
>>
>> Billing-Party=$avp(billing_party); \ -> Billing-Party=$avp(s:billing_party); \
>>
>> Try it out and tell us your experience
>>
>> Regardas,
>>
>> _______________________________________________
>> Users mailing list
>> [hidden email]
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>  
>>    
>
>
>  
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>  


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users