提交 222e839b authored 作者: Chris Parker's avatar Chris Parker

Adding cparker contrib directory, with first stab at mod_xml_radius

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk/contrib@14035 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 790e6ae5
AM_CFLAGS = $(SWITCH_AM_CFLAGS)
AM_CPPFLAGS = $(SWITCH_AM_CXXFLAGS)
AM_LDFLAGS = $(SWITCH_AM_LDFLAGS)
#we should set all these vars from configure, no reason to have these in each Makefile.am
LIBTOOL = echo "`link=\`echo $@|grep .la;echo $@|grep .so;echo $@|grep .dll\`;if test -n "$$link"; then echo Creating $@;fi`";`if test -z "$(VERBOSE)" ; \
then echo $(SHELL) $(switch_builddir)/quiet_libtool ;else echo $(SHELL) $(switch_builddir)/libtool; fi`
AM_MAKEFLAGS=`test -n "$(VERBOSE)" || echo -s`
# Dirty trick to override the link output
LIBS+=> $(MODNAME).log || error="yes";if test -n "$(VERBOSE)" -o "$$error" = "yes";then cat $(MODNAME).log;fi;if test "$$error" = "yes";then exit 1;fi
moddir=$(prefix)/mod
MODNAME=mod_xml_radius
mod_LTLIBRARIES = mod_xml_radius.la
mod_xml_radius_la_SOURCES = mod_xml_radius.c
mod_xml_radius_la_CFLAGS = $(AM_CFLAGS)
mod_xml_radius_la_CPPFLAGS = $(AM_CPPFLAGS)
mod_xml_radius_la_LIBADD=$(switch_builddir)/libfreeswitch.la
mod_xml_radius_la_LDFLAGS=-module -avoid-version -no-undefined
mod_xml_radius_la_LDFLAGS += -lfreeradius-client
#Override the linstall target so we just install the .so/.dylib
install-data-am: $(DESTDIR)$(PREFIX)/$(moddir)/$(MODNAME).$(DYNAMIC_LIB_EXTEN)
$(DESTDIR)$(PREFIX)/$(moddir)/$(MODNAME).$(DYNAMIC_LIB_EXTEN): $(MODNAME).la
@echo installing $(MODNAME).$(DYNAMIC_LIB_EXTEN)
@if [ -f .libs/$(MODNAME).$(DYNAMIC_LIB_EXTEN) ] ; then \
$(LIBTOOL) --mode=install $(INSTALL) .libs/$(MODNAME).$(DYNAMIC_LIB_EXTEN) $(DESTDIR)$(PREFIX)/$(moddir) >/dev/null ; \
else \
$(LIBTOOL) --mode=install $(INSTALL) $(MODNAME).$(DYNAMIC_LIB_EXTEN) $(DESTDIR)$(PREFIX)/$(moddir) >/dev/null ; \
fi
THIS MODULE IS HIGHLY EXPERIMENTAL. USE MAY RESULT IN HAIR LOSS, DISMEMBERMENT,
OR EVEN DEATH.
That out of the way, it is a way to provide a RADIUS interface to perform
authentication and authorization functionality to FreeSWITCH.
It uses the FreeRADIUS Client Library, which is part of the FreeRADIUS project.
The version used to create/test this library is the tagged release 1.1.6.
In order to use this module, you will need to edit the top level 'configure.in'
as well as 'modules.conf'.
More information/details can be found on the wiki:
http://wiki.freeswitch.org/wiki/Mod_xml_radius
Questions/comments/suggestions, please find 's3g_fault' on IRC.
Install/copy these into /usr/local/freeswitch/conf/autoload_configs
<configuration name="mod_xml_radius.conf" description="XML RADIUS Configuration">
<bindings>
<binding name="directory"/>
<!-- <binding name="dialplan"/> -->
</bindings>
<settings>
<!-- location of the radius dictionary file -->
<param name="dictionary" value="/usr/local/freeswitch/conf/radius/dictionary"/>
<!-- location of the radius sequence file -->
<param name="seqfile" value="/var/run/radius_auth.seq"/>
<!-- accounting servers, up to 8 allowed -->
<!-- value is "host:port:secret", port is optional -->
<!-- use IP ADDRESSES, not hostnames -->
<param name="authserver" value="127.0.0.1:1812:testing123"/>
<!--<param name="authserver" value="10.0.0.254:1813:testing123"/> -->
<!--<param name="authserver" value="192.168.10.10:1813:testing123"/> -->
<!-- number of retries for each server -->
<param name="radius_retries" value="3"/>
<!-- number of seconds to wait between retries -->
<param name="radius_timeout" value="5"/>
<!-- The length of time in seconds that we skip a nonresponsive RADIUS
server for transaction requests. Server(s) being in the "dead" state
are tried only after all other non-dead servers have been tried and
failed or timeouted. The deadtime interval starts when the server
does not respond to an authentication/accounting request transmissions.
When the interval expires, the "dead" server would be re-tried again,
and if it's still down then it will be considered "dead" for another
such interval and so on. This option is no-op if there is only one
server in the list. Set to 0 in order to disable the feature. -->
<param name="radius_deadtime" value="0"/>
</settings>
<templates>
<template name="not_found">
<document type="freeswitch/xml">
<section name="result">
<result status="not found"/>
</section>
</document>
</template>
<X-PRE-PROCESS cmd="include" data="xml_radius_templates/*.xml"/>
</templates>
</configuration>
<include>
<template name="directory">
<document type="freeswitch/xml">
<section name="directory" description="arbitrary stuff here">
<domain name="${domain}">
<groups>
<group name="default">
<users>
<user id="${user}" number-alias="${radius_alias}">
<params>
<param name="vm-password" value="${radius_vm_pass}"/>
</params>
<variables>
<variable name="international" value="${radius_international}"/>
<variable name="usenat" value="${radius_natuser}"/>
</variables>
</user>
</users>
</group>
</groups>
</domain>
</section>
</document>
</template>
</include>
差异被折叠。
/*
* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application Call Detail Recorder module
* Copyright 2006, Author: Yossi Neiman of Cartis Solutions, Inc. <freeswitch AT cartissolutions.com>
*
* Version: MPL 1.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application Call Detail Recorder module
*
* The Initial Developer of the Original Code is
* Chris Parker <cparker AT segv.org>
* Portions created by the Initial Developer are Copyright (C)
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Chris Parker <cparker AT segv.org>
*
* Description: Contains definitions and structs used by the radius cdr module.
*
* mod_radius_cdr.h
*
*/
#ifndef MODRADIUSCDR
#define MODRADIUSCDR
#define PW_FS_PEC 27880
#define PW_FS_AVPAIR 1
#define PW_FS_CLID 2
#define PW_FS_DIALPLAN 3
#define PW_FS_SRC 4
#define PW_FS_DST 5
#define PW_FS_SRC_CHANNEL 6
#define PW_FS_DST_CHANNEL 7
#define PW_FS_ANI 8
#define PW_FS_ANIII 9
#define PW_FS_LASTAPP 10
#define PW_FS_LASTDATA 11
#define PW_FS_DISPOSITION 12
#define PW_FS_HANGUPCAUSE 13
#define PW_FS_BILLUSEC 15
#define PW_FS_AMAFLAGS 16
#define PW_FS_RDNIS 17
#define PW_FS_CONTEXT 18
#define PW_FS_SOURCE 19
#define PW_FS_CALLSTARTDATE 20
#define PW_FS_CALLANSWERDATE 21
#define PW_FS_CALLTRANSFERDATE 22
#define PW_FS_CALLENDDATE 23
#endif
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论