[OpenSIPS-Users] mediaproxy and radius integration
Gabriel Bermudez
elgabo81 at gmail.com
Tue Jan 27 17:14:15 CET 2009
Hi Ruud
Ruud Klaver escribió:
> Hi Gabriel,
>
> On 26 Jan 2009, at 22:54, Gabriel Bermudez wrote:
>
>> Hi Ruud,
>>
>> Ruud Klaver escribió:
>>> Hi,
>>>
>>> On 26 Jan 2009, at 17:01, Gabriel Bermudez wrote:
>>>
>>>> Hi,
>>>>
>>>> I have tried to change from localhost to 127.0.0.1 and to my ip
>>>> address
>>>> and still it doesn't works.
>>>> With what version are you working, I'm using version 2.3.2. I'm also
>>>> using Ubuntu server 8.10 and downloaded the deb files for ag-project's
>>>> debian repository.
>>>> Could any that has installed mediaproxy give us a hand, please?
>>>> Thanks for your help.
>>>>
>>>> Regards,
>>>>
>>>>
>>>>
>>>> Авдиенко Михаил escribió:
>>>>> Gabriel Bermudez wrote:
>>>>>
>>>>>
>>>>>> Hi list,
>>>>>>
>>>>>
>>>>>
>>>>>> Got this issue with mediaproxy. The mediaproxy dispatcher is not
>>>>>> able to
>>>>>> read the radius configuration file
>>>>>>
>>>>>
>>>>>
>>>>>> [Radius]
>>>>>> config_file = /etc/radiusclient-ng/radiusclient.conf
>>>>>> additional_dictionary = radius/dictionary.opensips
>>>>>>
>>>>>
>>>>>
>>>>>> The file is there, opensips can read it, but mediaproxy dispatcher
>>>>>> can't?!. This log output
>>>>>>
>>>>>
>>>>>
>>>>>> Jan 23 18:28:55 ripley media-dispatcher[6834]: [-] Log opened.
>>>>>> Jan 23 18:28:55 ripley media-dispatcher[6834]: [-] Starting
>>>>>> MediaProxy
>>>>>> Dispatcher 2.3.2
>>>>>> Jan 23 18:28:55 ripley media-dispatcher[6834]: [-] Twisted is using
>>>>>> epollreactor
>>>>>> Jan 23 18:28:55 ripley media-dispatcher[6834]: [-] fatal error:
>>>>>> cannot
>>>>>> read the RADIUS configuration file
>>>>>> Jan 23 18:28:55 ripley media-dispatcher[6834]: [-] fatal error:
>>>>>> failed
>>>>>> to create MediaProxy Dispatcher: 'localhost'
>>>>>>
>>>>>
>>>>>
>>>>>> Don't know what I'm doing wrong. Thanks for you advice.
>>>>>>
>>>>>
>>>>>
>>>>>> Regards,
>>>>>>
>>>>>
>>>>> I have this issue too. I discovered that it's related to the
>>>>> 'acctserver'
>>>>> option in radiusclient.conf file.
>>>>> I've played with this option trying to add two acctservers and
>>>>> replacing
>>>>> localhost 127.0.0.1 and vice-versa.
>>>>> Sometimes mediaproxy-dispatcher parses file ok, but do not send any
>>>>> accounting, sometimes it tries
>>>>> to create MediaProxy Dispatcher at one of the addresses specified via
>>>>> acctserver ("failed to create MediaProxy Dispatcher: 'localhost'")
>>>>> but sometimes it works as expected. I can not find out logic of this
>>>>> errors(
>>>
>>>
>>> I agree that's not a very helpful error, it should report more.
>>> Could you change the following to make it give a full traceback:
>>> in mediaproxy/interfaces/accounting/radius.py on line 94, replace
>>> "raise RuntimeError(str(e))" with just "raise". It won't be very
>>> descriptive, but at least you can give me the full traceback and I
>>> can analyze what went wrong.
>>>
>>> Ruud Klaver
>>> AG Projects
>>
>> Here is the stacktrace you asked for:
>>
>> Jan 26 16:30:55 ripley media-dispatcher[14677]: [-] Log opened.
>> Jan 26 16:30:55 ripley media-dispatcher[14677]: [-] Starting
>> MediaProxy Dispatcher 2.3.2
>> Jan 26 16:30:55 ripley media-dispatcher[14677]: [-] Twisted is using
>> epollreactor
>> Jan 26 16:30:55 ripley media-dispatcher[14677]: [-] fatal error:
>> cannot read the RADIUS configuration file
>> Jan 26 16:30:55 ripley media-dispatcher[14677]: [-] fatal error:
>> failed to create MediaProxy Dispatcher: 'localhost'
>> Jan 26 16:30:55 ripley media-dispatcher[14677]: [-] Traceback (most
>> recent call last):
>> Jan 26 16:30:55 ripley media-dispatcher[14677]: [-] ---
>> <exception caught here> ---
>> Jan 26 16:30:55 ripley media-dispatcher[14677]: [-] File
>> "/usr/bin/media-dispatcher", line 52, in <module>
>> Jan 26 16:30:55 ripley media-dispatcher[14677]: [-]
>> dispatcher = Dispatcher()
>> Jan 26 16:30:55 ripley media-dispatcher[14677]: [-] File
>> "/var/lib/python-support/python2.5/mediaproxy/dispatcher.py", line
>> 481, in __init__
>> Jan 26 16:30:55 ripley media-dispatcher[14677]: [-]
>> self.accounting = [__import__("mediaproxy.interfaces.accounting.%s" %
>> mod.lower(), globals(), locals(), [""]).Accounting() for mod in
>> set(Config.accounting)]
>> Jan 26 16:30:55 ripley media-dispatcher[14677]: [-] File
>> "/var/lib/python-support/python2.5/mediaproxy/interfaces/accounting/radius.py",
>> line 53, in __init__
>> Jan 26 16:30:55 ripley media-dispatcher[14677]: [-]
>> self.radius = RadiusAccounting()
>> Jan 26 16:30:55 ripley media-dispatcher[14677]: [-] File
>> "/var/lib/python-support/python2.5/mediaproxy/interfaces/accounting/radius.py",
>> line 81, in __init__
>> Jan 26 16:30:55 ripley media-dispatcher[14677]: [-] secret =
>> secrets[server]
>> Jan 26 16:30:55 ripley media-dispatcher[14677]: [-]
>> exceptions.KeyError: 'localhost'
>>
>> Hope it helps, also the config.ini file
>>
>> [Relay]
>> dispatchers = 127.0.0.1 192.168.2.24 200.93.233.229
>>
>> [Dispatcher]
>> socket_path = dispatcher.sock
>> listen = 0.0.0.0
>> accounting = radius, database
>>
>> [TLS]
>> certs_path = tls
>>
>> [Database]
>> dburi = mysql://mediaproxy:aag18281@localhost/mediaproxy
>>
>> [Radius]
>> config_file = /etc/opensips/radius/client.conf
>> additional_dictionary = radius/dictionary
>>
>> [OpenSIPS]
>>
>>
>> The /etc/opensips/radius/client.conf is a symlink to
>> /etc/radiusclient-ng/radiusclient.conf
>> Thanks for your help.
>>
>> Regards,
>
> It seems it cannot parse the password for the server "localhost" from
> the servers file. Could you please post me the contents of your
> clients.conf and servers files? Obviously you should obfuscate the
> passwords contained in it.
>
> Ruud Klaver
> AG Projects
You were right about the parsing, the server file had the following:
#Server Name or Client/Server pair Key
#---------------- ---------------
127.0.0.1 xxxxxx
I changed it to
#Server Name or Client/Server pair Key
#---------------- ---------------
localhost xxxxxx
And it started to work. Here is the client.conf file
auth_order radius,local
login_tries 4
login_timeout 60
nologin /etc/nologin
issue /etc/radiusclient-ng/issue
authserver localhost
acctserver localhost
servers /etc/radiusclient-ng/servers
dictionary /etc/radiusclient-ng/dictionary
login_radius /usr/sbin/login.radius
seqfile /var/run/radius.seq
mapfile /etc/radiusclient-ng/port-id-map
default_realm
radius_timeout 10
radius_retries 3
bindaddr *
Also I had to install python-mysqldb package to get rid of this error:
Jan 27 10:12:40 ripley media-dispatcher[24457]: [-] Log opened.
Jan 27 10:12:40 ripley media-dispatcher[24457]: [-] Starting MediaProxy
Dispatcher 2.3.2
Jan 27 10:12:40 ripley media-dispatcher[24457]: [-] Twisted is using
epollreactor
Jan 27 10:12:40 ripley media-dispatcher[24457]: [-] fatal error: failed
to create MediaProxy Dispatcher: No module named MySQLdb
Jan 27 10:12:40 ripley media-dispatcher[24457]: [-] Traceback (most
recent call last):
Jan 27 10:12:40 ripley media-dispatcher[24457]: [-] --- <exception
caught here> ---
Jan 27 10:12:40 ripley media-dispatcher[24457]: [-] File
"/usr/bin/media-dispatcher", line 52, in <module>
Jan 27 10:12:40 ripley media-dispatcher[24457]: [-] dispatcher =
Dispatcher()
Jan 27 10:12:40 ripley media-dispatcher[24457]: [-] File
"/var/lib/python-support/python2.5/mediaproxy/dispatcher.py", line 481,
in __init__
Jan 27 10:12:40 ripley media-dispatcher[24457]: [-]
self.accounting = [__import__("mediaproxy.interfaces.accounting.%s" %
mod.lower(), globals(), locals(), [""]).Accounting() for mod in
set(Config.accounting)]
Jan 27 10:12:40 ripley media-dispatcher[24457]: [-] File
"/var/lib/python-support/python2.5/mediaproxy/interfaces/accounting/database.py",
line 35, in <module>
Jan 27 10:12:40 ripley media-dispatcher[24457]: [-] connection =
connectionForURI(Config.dburi)
Jan 27 10:12:40 ripley media-dispatcher[24457]: [-] File
"/usr/lib/python2.5/site-packages/sqlobject/dbconnection.py", line 934,
in connectionForURI
Jan 27 10:12:40 ripley media-dispatcher[24457]: [-] conn =
connCls.connectionFromURI(uri)
Jan 27 10:12:40 ripley media-dispatcher[24457]: [-] File
"/usr/lib/python2.5/site-packages/sqlobject/mysql/mysqlconnection.py",
line 57, in connectionFromURI
Jan 27 10:12:40 ripley media-dispatcher[24457]: [-] host=host or
'localhost', port=port or 0, **args)
Jan 27 10:12:40 ripley media-dispatcher[24457]: [-] File
"/usr/lib/python2.5/site-packages/sqlobject/mysql/mysqlconnection.py",
line 24, in __init__
Jan 27 10:12:40 ripley media-dispatcher[24457]: [-] import
MySQLdb, MySQLdb.constants.CR, MySQLdb.constants.ER
Jan 27 10:12:40 ripley media-dispatcher[24457]: [-]
exceptions.ImportError: No module named MySQLdb
Just in case someone else bumps into this one too.
Ruud, once more thank you very much for you're help.
Regards,
More information about the Users
mailing list