Asterisk + radius

Source: Internet
Author: User

Asterisk is known as the Swiss army knife in the VoIP field, and radius is the AAA billing protocol. Also, let's see how asterisk + radius can be combined with each other...

AsteriskIs an open-source software VoIP PBX system, which is a pure software implementation solution running in a Linux environment.AsteriskIt is a fully functional application that provides many telecom functions to turn your x86 machine into your own switch and can also be used as an enterprise-class commercial switch.AsteriskThe exciting thing is that it provides commercial switch functions and scalability within the scope of the small business budget. You can use an old-fashioned Pentium 3 computer to make your organization look the same as a large enterprise in the world.

Asterisk official site: http://www.asterisk.org/

RADIUS: Remote Authentication Dial In User Service, remote user dialing Authentication System
Defined by rfc2865 and rfc2866, rfc2866 is currently the most widely used AAA protocol.

The RADIUS protocol was initially proposed by Livingston to authenticate and charge dial-up users. After several improvements, a general authentication and billing protocol was formed.

Radius rfc2865 Web site: http://www.ietf.org/rfc/rfc2865.txt

I. Preparations 

 

1. Get asterisk-1.4.5 source code wget -- passive-FTP ftp.digium.com/pub/asterisk/asterisk-1.4.5.tar.gzdecompress source code tar zxvf asterisk-1.4.5.tar.gz Ii. Adjust the code To add a module that uses radius for billing, three radius-related libraries are involved: appradius1.0, cpprad, and radiusclient-ng. cpprad is a module that uses C to implement radius communication protocol. appradius is a radius communication module dedicated to Asterisk. The underlying communication uses the library function of cpprad. radiusclient-ng is another radius communication library asterisk1.4.5 cdr_radius.c uses the radiusclient-ng library by default. The method of this project is as follows: 1. the implementation code in cpprad (radlib. c, md5.c) merge to the implementation code of appradius (app_radius.c, cdr_radius.c) 2. copy the implementation code app_radius.c of appradius to the app path of Asterisk. cdr_radius.c overwrites the CDR path of Asterisk. Files with the same name under the path, so the coupling relationship with radiusclient-ng is removed. 3. copy all header files of appradius and cpprad to the include folder of Asterisk. note that the compilation results of the above libraries, such as the libradiusclient-ng.so.2, cannot be put under the module path Folder/usr/lib/asterisk/modules/of Asterisk, all modules in this path will be loaded by default when the asterisk is started. However, these modules must meet the special requirements of Asterisk loading. Therefore, normal Linux modules do not take effect in this path. However, you can consider putting it under/usr/lib/for some modules. Iii. Compilation and deployment 1. clear the intermediate file that was compiled last time make clean 2. although the cdr_radius module asterisk1.4.5 has the source file cdr_radius.c, the module is not compiled by default because it depends on the radiusclient-ng library. Run make menuselect to find the cdr_radius module, [XXX] indicates that the module dependency is not compiled by default. Therefore, to compile cdr_radius.c, you must run the following command to compile this module .. /Configure -- prefix =/data/Asterisk -- Exec-Prefix =/data/Asterisk -- With-radius =/data/radiusclient-ng/3. run configure to set the initial conditions for compilation to specify the installation path. Specify the values of prefix and Exec-prefix. The second configure will instruct you to install asterisk to the/data/asterisk directory .. /Configure -- prefix =/data/Asterisk -- Exec-Prefix =/data/asterisk 4. run the make command to compile make 5. run make install to deploy make install 6. if this is the first installation, run make samples to copy the default configuration file make samples 7. learn about the common asterisk folder configuration files stored in the following directory by default/etc/asterisk/var/lib/asterisk/sounds/Save the voice files used by IVR (GSM suffix files)) logs of/var/spool/asteriskasterisk are saved in the following folders:/var/log/asterisk stores the ID of the process started by asterisk, therefore, the login user must have the permission to access this folder/var/run/asterisk. pid/var/run/asterisk. CTL 4. Configure AsteriskThe default configuration folder of Asterisk is/etc/asteriskextensions. conf, which sets the SIP-related settings for the dialing application scheme. 5. Run and debug Asterisk 1. run common Debugging commands. /asterisk & start asterisk in the background. /asterisk-vvvc starts Asterisk and displays debugging information on the console as much as possible. /asterisk-r connect to the asterisk Console SET verbose 9999 settings print details 2. common commands in the asterisk Console: SIP reload: Reload sip configuration information: SIP set debug settings: display more sip information: SIP set debug off disabled: display more sip information: SIP show channels: Display All active SIP Channel sip show peers display all defined sip peer dialplan show display dialing scheme dialplan reload call scheme stop gracefully stop asteriskstop now stop running asterisk module show all loaded module load cdr_radius.so load module cdr_radius.somodule reload cdr_radius.so reload module cdr_radius.somodule unload cdr_radius.so uninstall module cdr_radius.so core show applications. All applications are displayed, for example, dial, radius, hangup, answer, and other core show channels show all call channels core show codecs show all supported codecs core show functions show all function Functions

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.