This article is from csdn lidp http://blog.csdn.net/perfectpdl. please refer to this Article. Thank you.
I have created a freeswitch kernel research and exchange group, 45211986. Welcome to join. In addition, we provide the SIP-based communication server and client solution,
Develop the SIP/IMS video client and support access to sipSwitch, IMS core network, supported
Voice, video, and instant messaging functions. The video formats support h263, h264, and MPEG4 soft encoding solutions. The hardware coding/decoding interface is provided for interconnection and servers. If you are interested, contact me.
Freeswitch uses the Perl language mainly in two places: one is to connect the freeswitch event socket module using the Perl language, and the other is to write dialplan using the Perl language through the socket connection, which is similar to the AGI of Asterisk, to write dialplan, the module mod_perl is required. The first usage does not require mod_perl support.
A) install mod_perl:
Gdbm-devel and db4-devel need to be installed on centos
Yuminstall gdbm-devel db4-devel
Modify the modules. conf file and remove the comments of mod_perl.
Installation of Makemod_perl-install
Modify CONF/modules. conf. XML to remove the mod_perl annotation.
Fs_clireload
Freeswitch @ internal> reload mod_perl
-Errunloading module [no such module!]
+ Okreloading XML
+ Okmodule loaded
2012-08-. 247331 [info] mod_enum.c: 871 Enum reloaded
2012-08-. 247331 [info] switch_time.c: 1163 timezone reloaded 530 Definitions
2012-08-. 287826 [debug] switch_loadable_module.c: 1261 loading module withglobal namespace at request of Module
2012-08-. 287826 [info] mod_perl.c: 512 allocated Perl intrepreter.
2012-08-. 287826 [console] switch_loadable_module.c: 1328 successfully loaded [mod_perl]
2012-08-. 287826 [Notice] switch_loadable_module.c: 254 adding application 'perl'
2012-08-. 312383 [Notice] switch_loadable_module.c: 298 adding API function 'perlrrun'
2012-08-. 312383 [Notice] switch_loadable_module.c: 298 adding API function 'perl'
B) Use Perl to write dialplan
In dialplan, you can use the system app or Perl app to directly call the Perl script.
Used in XML dialplan
<Action application = "Perl" Data = "/path/to/Your/script. pl"/>
Or
<Actionapplication = "system" Data = "/path/to/APP. pl"/>
Call the Perl script.