[OpenSIPS-Users] ACC_RADIUS makes opensips crash

Denis Putyato denis7979 at mail.ru
Fri Jul 16 15:40:12 CEST 2010


Yes, Cisco dictionary included in the dictionary of the
RADIUS server and server really send attr. that i want.

I attach a pcap file (radius3.log) of session between opensips and radius server.

-----Original Message-----
From: users-bounces at lists.opensips.org [mailto:users-bounces at lists.opensips.org] On Behalf Of Irina Stanescu
Sent: Friday, July 16, 2010 5:13 PM
To: OpenSIPS users mailling list
Subject: Re: [OpenSIPS-Users] ACC_RADIUS makes opensips crash

Hello Denis,

Is the cisco specific dictionary included in the dictionary of the
RADIUS server too?

Also, to be able to extract a certain AVP from a RADIUS reply, you
need to make sure you have configured the server to return the
attributes you want. You can find a brief tutorial on this here [1].


Regards,
Irina Stanescu


[1] http://www.opensips.org/Resources/DocsTutRadius#toc4


On Fri, Jul 16, 2010 at 12:20 PM, Denis Putyato <denis7979 at mail.ru> wrote:
> Hello, Irina
>
> Now it works, thank you. But, if you don't mind,  one more question about RADIUS.
> I want to use Cisco dictionary for auth. subscribers.
> Dictionary is a main file used for radius in my opensips. I insert into this file such string " $INCLUDE /etc/radiusclient-ng/dictionary.cisco " where dictionary.cisco is a cisco specific dictionary.
>
> a little part of opensips.cfg
> {...
> ...
> modparam("aaa_radius", "sets", "set1 = (User-Name = $avp(i:20), User-Password=$avp(i:50))")
> modparam("aaa_radius", "sets", "set2 = (Cisco-AVPair = $var(duration))")
> ...
> ...
> radius_send_auth("set1","set2");
> ...
> ...
> }
>
> After made a call I can see such string in syslog
> " /usr/local/opensips/sbin/opensips[7435]: ERROR:aaa_radius:send_auth_func: attribute was not found in received radius message "
>
> # cat /etc/radiusclient-ng/dictionary.cisco | grep Cisco
> ...
> VENDOR          Cisco                           9
> BEGIN-VENDOR    Cisco
> ATTRIBUTE       Cisco-AVPair                            1       string  vendor=Cisco
> ...
>
> -----Original Message-----
> From: users-bounces at lists.opensips.org [mailto:users-bounces at lists.opensips.org] On Behalf Of Irina Stanescu
> Sent: Thursday, July 15, 2010 6:11 PM
> To: OpenSIPS users mailling list
> Subject: Re: [OpenSIPS-Users] ACC_RADIUS makes opensips crash
>
> Hello Denis,
>
> I think the problem in you case is that the radius dictionary does not contain an entry for "SIP-AVP", and that is why attr is null, causing the crash.
>
> I added a fix on the trunk and i also attached the patch to this email in case you don't use the trunk version. Please let me know if there are any other issues.
>
> Regards,
> Irina Stanescu
>
> On Thu, Jul 15, 2010 at 3:29 PM, Denis Putyato <denis7979 at mail.ru> wrote:
>> Bogdan, i made another call which makes opensips crash
>>
>> ...
>> Core was generated by `/usr/local/opensips/sbin/opensips -P /var/run/opensips.pid'.
>> Program terminated with signal 11, Segmentation fault.
>> [New process 8833]
>> #0  0xb7a0adf1 in send_auth_func (msg=0x81c113c, s1=0x81bcd34,
>> s2=0x81bcd48) at aaa_radius.c:369
>> 369             for(; (vp = rc_avpair_get(vp, attr->value, 0)); vp =
>> vp->next)
>> (gdb) bt
>> #0  0xb7a0adf1 in send_auth_func (msg=0x81c113c, s1=0x81bcd34,
>> s2=0x81bcd48) at aaa_radius.c:369
>> #1  0x08056111 in do_action (a=0x81b7404, msg=0x81c113c) at
>> action.c:967
>> #2  0x08054f9e in run_action_list (a=0x81b5e14, msg=0x81c113c) at
>> action.c:139
>> #3  0x08057f97 in do_action (a=0x81b7680, msg=0x81c113c) at
>> action.c:706
>> #4  0x08054f9e in run_action_list (a=0x81b5938, msg=0x81c113c) at
>> action.c:139
>> #5  0x08057946 in do_action (a=0x81aa660, msg=0x81c113c) at
>> action.c:119
>> #6  0x08054f9e in run_action_list (a=0x81aa660, msg=0x81c113c) at
>> action.c:139
>> #7  0x08057f97 in do_action (a=0x81aa758, msg=0x81c113c) at
>> action.c:706
>> #8  0x08054f9e in run_action_list (a=0x81aa758, msg=0x81c113c) at
>> action.c:139
>> #9  0x08057f97 in do_action (a=0x81aaff4, msg=0x81c113c) at
>> action.c:706 #10 0x08054f9e in run_action_list (a=0x81aaff4,
>> msg=0x81c113c) at action.c:139
>> #11 0x08057f97 in do_action (a=0x81ac2d8, msg=0x81c113c) at
>> action.c:706
>> #12 0x08054f9e in run_action_list (a=0x81a9f24, msg=0x81c113c) at
>> action.c:139
>> #13 0x08057946 in do_action (a=0x81b428c, msg=0x81c113c) at
>> action.c:119
>> #14 0x08054f9e in run_action_list (a=0x81b1ab0, msg=0x81c113c) at
>> action.c:139
>> #15 0x08057946 in do_action (a=0x81b1308, msg=0x81c113c) at
>> action.c:119
>> #16 0x08054f9e in run_action_list (a=0x81b1308, msg=0x81c113c) at
>> action.c:139
>> #17 0x08057f97 in do_action (a=0x81b14cc, msg=0x81c113c) at
>> action.c:706
>> #18 0x08054f9e in run_action_list (a=0x81b0a70, msg=0x81c113c) at
>> action.c:139
>> #19 0x08057946 in do_action (a=0x81b078c, msg=0x81c113c) at
>> action.c:119 #20 0x08054f9e in run_action_list (a=0x81ad9e0,
>> msg=0x81c113c) at action.c:139
>> #21 0x08057946 in do_action (a=0x81ad50c, msg=0x81c113c) at
>> action.c:119
>> #22 0x08054f9e in run_action_list (a=0x81aca9c, msg=0x81c113c) at
>> action.c:139
>> #23 0x08057946 in do_action (a=0x81a9cb4, msg=0x81c113c) at
>> action.c:119
>> #24 0x08054f9e in run_action_list (a=0x81a6c50, msg=0x81c113c) at
>> action.c:139
>> #25 0x08057f97 in do_action (a=0x81a9d8c, msg=0x81c113c) at
>> action.c:706
>> #26 0x08054f9e in run_action_list (a=0x81a47e0, msg=0x81c113c) at
>> action.c:139
>> #27 0x080590bf in run_top_route (a=0x81a47e0, msg=0x81c113c) at
>> action.c:119
>> #28 0x08098b9c in receive_msg (
>>    buf=0x8178200 "INVITE sip:4483706 at 213.170.75.90:5060
>> SIP/2.0\r\nVia: SIP/2.0/UDP
>> 213.170.75.90:5050;branch=z9hG4bK6912c413;rport\r\nMax-Forwards:
>> 70\r\nFrom: \"3364079\"
>> <sip:3364079 at 213.170.75.90:5050>;tag=as477593c3\r\nTo: "..., len=826,
>>    rcv_info=0xbfeaed48) at receive.c:162
>> #29 0x080da834 in udp_rcv_loop () at udp_server.c:492 #30 0x0806ee80
>> in main (argc=3, argv=0xbfeaeee4) at main.c:818
>> (gdb) print vp
>> $1 = (VALUE_PAIR *) 0x854c8f8
>> (gdb) print attr
>> $2 = (DICT_ATTR *) 0x0
>> (gdb)
>>
>> -----Original Message-----
>> From: users-bounces at lists.opensips.org
>> [mailto:users-bounces at lists.opensips.org] On Behalf Of Bogdan-Andrei
>> Iancu
>> Sent: Thursday, July 15, 2010 3:48 PM
>> To: OpenSIPS users mailling list
>> Subject: Re: [OpenSIPS-Users] ACC_RADIUS makes opensips crash
>>
>> Hi Denis,
>>
>> That's perfect - thank you.
>>
>> Could you print in GDB the following values : vp , attr.
>>
>> Regards,
>> Bogdan
>>
>> Denis Putyato wrote:
>>> Hello, Bogdan
>>>
>>> Is this information you asked?
>>>
>>> gdb /usr/local/opensips/sbin/opensips /core GNU gdb 6.8-debian
>>> Copyright (C) 2008 Free Software Foundation, Inc.
>>> License GPLv3+: GNU GPL version 3 or later
>>> <http://gnu.org/licenses/gpl.html>
>>> This is free software: you are free to change and redistribute it.
>>> There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
>>> and "show warranty" for details.
>>> This GDB was configured as "i486-linux-gnu"...
>>>
>>> warning: Can't read pathname for load map: Input/output error.
>>> ...
>>> ...
>>> Core was generated by `/usr/local/opensips/sbin/opensips -P /var/run/opensips.pid'.
>>> Program terminated with signal 11, Segmentation fault.
>>> [New process 24328]
>>> #0  0xb79b7df1 in send_auth_func (msg=0x81c0fd4, s1=0x81bcbcc,
>>> s2=0x81bcbe0) at aaa_radius.c:369
>>> 369           for(; (vp = rc_avpair_get(vp, attr->value, 0)); vp =
>>> vp->next)
>>> (gdb) bt
>>> #0  0xb79b7df1 in send_auth_func (msg=0x81c0fd4, s1=0x81bcbcc,
>>> s2=0x81bcbe0) at aaa_radius.c:369
>>> #1  0x08056111 in do_action (a=0x81b729c, msg=0x81c0fd4) at
>>> action..c:967
>>> #2  0x08054f9e in run_action_list (a=0x81b5e14, msg=0x81c0fd4) at
>>> action.c:139
>>> #3  0x08057f97 in do_action (a=0x81b7518, msg=0x81c0fd4) at
>>> action..c:706
>>> #4  0x08054f9e in run_action_list (a=0x81b5938, msg=0x81c0fd4) at
>>> action.c:139
>>> #5  0x08057946 in do_action (a=0x81aa660, msg=0x81c0fd4) at
>>> action..c:119
>>> #6  0x08054f9e in run_action_list (a=0x81aa660, msg=0x81c0fd4) at
>>> action.c:139
>>> #7  0x08057f97 in do_action (a=0x81aa758, msg=0x81c0fd4) at
>>> action..c:706
>>> #8  0x08054f9e in run_action_list (a=0x81aa758, msg=0x81c0fd4) at
>>> action.c:139
>>> #9  0x08057f97 in do_action (a=0x81aaff4, msg=0x81c0fd4) at
>>> action..c:706 #10 0x08054f9e in run_action_list (a=0x81aaff4,
>>> msg=0x81c0fd4) at action.c:139
>>> #11 0x08057f97 in do_action (a=0x81ac2d8, msg=0x81c0fd4) at
>>> action.c:706
>>> #12 0x08054f9e in run_action_list (a=0x81a9f24, msg=0x81c0fd4) at
>>> action.c:139
>>> #13 0x08057946 in do_action (a=0x81b428c, msg=0x81c0fd4) at
>>> action.c:119
>>> #14 0x08054f9e in run_action_list (a=0x81b1ab0, msg=0x81c0fd4) at
>>> action.c:139
>>> #15 0x08057946 in do_action (a=0x81b1308, msg=0x81c0fd4) at
>>> action.c:119
>>> #16 0x08054f9e in run_action_list (a=0x81b1308, msg=0x81c0fd4) at
>>> action.c:139
>>> #17 0x08057f97 in do_action (a=0x81b14cc, msg=0x81c0fd4) at
>>> action.c:706
>>> #18 0x08054f9e in run_action_list (a=0x81b0a70, msg=0x81c0fd4) at
>>> action.c:139
>>> #19 0x08057946 in do_action (a=0x81b078c, msg=0x81c0fd4) at
>>> action.c:119 #20 0x08054f9e in run_action_list (a=0x81ad9e0,
>>> msg=0x81c0fd4) at action.c:139
>>> #21 0x08057946 in do_action (a=0x81ad50c, msg=0x81c0fd4) at
>>> action.c:119
>>> #22 0x08054f9e in run_action_list (a=0x81aca9c, msg=0x81c0fd4) at
>>> action.c:139
>>> #23 0x08057946 in do_action (a=0x81a9cb4, msg=0x81c0fd4) at
>>> action.c:119
>>> #24 0x08054f9e in run_action_list (a=0x81a6c50, msg=0x81c0fd4) at
>>> action.c:139
>>> #25 0x08057f97 in do_action (a=0x81a9d8c, msg=0x81c0fd4) at
>>> action.c:706
>>> #26 0x08054f9e in run_action_list (a=0x81a47e0, msg=0x81c0fd4) at
>>> action.c:139
>>> #27 0x080590bf in run_top_route (a=0x81a47e0, msg=0x81c0fd4) at
>>> action.c:119
>>> #28 0x08098b9c in receive_msg (
>>>     buf=0x8178200 "INVITE sip:3364000 at 1.1.1.1:5060 SIP/2.0\r\nVia:
>>> SIP/2.0/UDP
>>> 1.1.1.1:5050;branch=z9hG4bK7d781018;rport\r\nMax-Forwards:
>>> 70\r\nFrom: \"3364079\"
>>> <sip:3364079 at 1.1.1.1:5050>;tag=as3bb11c83\r\nTo: "...., len=826,
>>>     rcv_info=0xbfb599f8) at receive.c:162
>>> #29 0x080da834 in udp_rcv_loop () at udp_server.c:492 #30 0x0806ee80
>>> in main (argc=3, argv=0xbfb59b94) at main.c:818
>>>
>>> -----Original Message-----
>>> From: users-bounces at lists.opensips.org
>>> [mailto:users-bounces at lists.opensips.org] On Behalf Of Bogdan-Andrei
>>> Iancu
>>> Sent: Wednesday, July 14, 2010 7:37 PM
>>> To: OpenSIPS users mailling list
>>> Subject: Re: [OpenSIPS-Users] ACC_RADIUS makes opensips crash
>>>
>>> Hi Denis,
>>>
>>> do you get a coredump file? if so, could you get a bracktrace from it
>>> and post it here?
>>>
>>> Regards,
>>> Bogdan
>>>
>>> Denis Putyato wrote:
>>>
>>>> Hello everybody!
>>>>
>>>> There is a problem with radius_send_auth(); function.
>>>>
>>>> This function is called from request route and after opensips
>>>> received “Access-Accept” from radius server it is crashes with such error:
>>>>
>>>> Jul 14 14:59:02 kam /usr/local/opensips/sbin/opensips[21556]:
>>>> DBG:aaa_radius:send_auth_func: radius authentication message sent
>>>>
>>>> Jul 14 14:59:02 kam kernel: [118250.317522] opensips[21556]:
>>>> segfault at 24 ip b7a53df1 sp bf8f5590 error 4 in
>>>> aaa_radius.so[b7a51000+7000]
>>>>
>>>> Jul 14 14:59:02 kam /usr/local/opensips/sbin/opensips[21561]:
>>>> CRITICAL:core:receive_fd: EOF on 7
>>>>
>>>> Opensips.cfg:
>>>>
>>>>>>>>
>>>>>>>>
>>>> modparam("aaa_radius", "radius_config",
>>>> "/etc/radiusclient-ng/radiusclient.conf")
>>>>
>>>> modparam("aaa_radius", "sets", "set1 = (User-Name = $avp(i:20),
>>>> User-Password=$avp(i:50))")
>>>>
>>>> modparam("aaa_radius", "sets", "set2 = (Session-Timeout =
>>>> $var(time))")
>>>>
>>>>>>>>
>>>>>>>>
>>>> route [7] {
>>>>
>>>>>>>>
>>>> radius_send_auth("set1","set2");
>>>>
>>>>>>>>
>>>>>>>>
>>>> }
>>>>
>>>> $avp(i:20) – tel. number
>>>>
>>>> $avp(i:50) – empty value. Has been inserted because radius server
>>>> didn’t accept request from opensips without User-Password field
>>>>
>>>> Session-Timeout is ONLY one attribute that opensips receives from
>>>> radius server.
>>>>
>>>> #cat /etc/radiusclient-ng/dictionary | grep Session-Timeout
>>>>
>>>> ATTRIBUTE Session-Timeout 27 integer
>>>>
>>>> Thank you for any help.
>>>>
>>>> --------------------------------------------------------------------
>>>> ----
>>>>
>>>> _______________________________________________
>>>> Users mailing list
>>>> Users at lists.opensips.org
>>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>>
>>>>
>>>
>>>
>>>
>>
>>
>> --
>> Bogdan-Andrei Iancu
>> OpenSIPS Bootcamp
>> 20 - 24 September 2010, Frankfurt, Germany www.voice-system.ro
>>
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>

_______________________________________________
Users mailing list
Users at lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
-------------- next part --------------
A non-text attachment was scrubbed...
Name: radius3.log
Type: application/octet-stream
Size: 233 bytes
Desc: not available
Url : http://lists.opensips.org/pipermail/users/attachments/20100716/c3e21140/attachment.obj 


More information about the Users mailing list