freeswitch与perl 语言相干

freeswitch与perl 语言相关freeswitch用perl语言主要有两个地方,一个为用perl语言连接freeswitch event so

freeswitch与perl 语言相关


freeswitch用perl语言主要有两个地方,一个为用perl语言连接freeswitch event socket模块,通过socket连接控制freeswitch,另一个地方为用perl语言写dialplan,这与asterisk的agi类似,写dialplan需要模块mod_perl,第一种用法并不需要mod_perl支持。

a)安装mod_perl过程:

Centos上需要安装gdbm-devel 和 db4-devel

yuminstall   gdbm-devel  db4-devel

修改Modules.conf文件,去掉mod_perl的注释

Makemod_perl-install 安装

修改conf/modules.conf.xml 去掉mod_perl注释

fs_clireload

freeswitch@internal>reload mod_perl

-ERRunloading module [No such module!]

+OKReloading XML

+OKmodule loaded

2012-08-2011:23:28.247331 [INFO] mod_enum.c:871 ENUM Reloaded

2012-08-2011:23:28.247331 [INFO] switch_time.c:1163 Timezone reloaded 530 definitions

2012-08-2011:23:28.287826 [DEBUG] switch_loadable_module.c:1261 Loading module withglobal namespace at request of module

2012-08-2011:23:28.287826 [INFO] mod_perl.c:512 Allocated perl intrepreter.

2012-08-2011:23:28.287826 [CONSOLE] switch_loadable_module.c:1328 Successfully Loaded[mod_perl]

2012-08-2011:23:28.287826 [NOTICE] switch_loadable_module.c:254 Adding Application 'perl'

2012-08-2011:23:28.312383 [NOTICE] switch_loadable_module.c:298 Adding API Function'perlrun'

2012-08-2011:23:28.312383 [NOTICE] switch_loadable_module.c:298 Adding API Function'perl'

b) 使用perl写dialplan

dialplan中直接可以用system app或者 perl app直接调用perl脚本。

Xml dialplan中用

<action application="perl" data="/path/to/your/script.pl" />

或者

<actionapplication="system" data="/path/to/app.pl"/>

调用perl脚本。