简体   繁体   English

如何向现有的Kamailio Server添加新模块?

[英]How to add a new module to existing Kamailio Server?

I am using a Kamailio 4.4 server. 我正在使用Kamailio 4.4服务器。 And I would like to install http_async_client module to this server. 我想将http_async_client模块安装到此服务器。 I have looked on the module directory( /usr/local/lib64/kamailio/modules ) to check wheather this http_async _client module already exist there, but it was not there. 我查看了模块目录( / usr / local / lib64 / kamailio / modules ),以检查此http_async _client模块已经存在,但并不存在。

And I searched for a solution and only found the method to include new module at the compile time. 我搜索了一个解决方案,但在编译时才发现包含新模块的方法。

I could find the modules source code on GitHub . 我可以在GitHub上找到模块的源代码。 But I don't know the steps to install a new module to the existing Kamailio. 但是我不知道将新模块安装到现有Kamailio的步骤。

Update: I have tried with running the two commands below from directory /usr/local/src/kamailio-4.4/kamailio . 更新:我尝试从目录/usr/local/src/kamailio-4.4/kamailio中运行以下两个命令。 but got the following error 但出现以下错误

make modules-cfg include_modules="http_async_client"
make modules

Errors are: 错误是:

CC (gcc) [M http_async_client.so]               async_http.o
async_http.c:42:26: fatal error: event2/event.h: No such file or directory
compilation terminated.
../../Makefile.rules:97: recipe for target 'async_http.o' failed
make[1]: *** [async_http.o] Error 1
Makefile:511: recipe for target 'modules' failed
make: *** [modules] Error 1

Steps to load new module to Kamailio server. 步骤装入新的模块Kamailio服务器。 ( It may not be a direct way to do, but it works) (这可能不是直接的方法,但是可以)

  1. Check the modules is exist in the default module directly /usr/local/lib64/kamailio/modules . 直接在默认模块/ usr / local / lib64 / kamailio / modules中检查模块是否存在。
    If found, add loadmodule "module_name.so " in load module section in kamailio.cfg file. 如果找到,请在kamailio.cfg文件的装入模块”部分中添加装入模块“ module_name.so
  2. If the module is not found in default module directory, you can check for the source code of that module in the default module source code directory /usr/local/src/kamailio-4.4/kamailio/modules . 如果在默认模块目录中找不到该模块,则可以在默认模块源代码目录/usr/local/src/kamailio-4.4/kamailio/modules中检查该模块的源代码。
  3. If source code found, enter to the module directory. 如果找到源代码,请进入模块目录。 Then create modules' shared object file(.so) by following commands. 然后通过以下命令创建模块的共享对象文件(.so)。

    ./configure 。/配置
    make 使
    make test 做测试
    make install 进行安装

  4. Then you will get a shared object file(.so). 然后,您将获得一个共享对象文件(.so)。 Copy that file into the default module directory. 将该文件复制到默认模块目录。 and load this module from the kamailio.cfg file as mentioned in step 1. 并按照步骤1中的说明从kamailio.cfg文件中加载此模块。

  5. If module source code does not exist in the default source code directory, You need to download the source code from the web. 如果默认源代码目录中不存在模块源代码,则需要从Web上下载源代码。 And follow step 3 and 4. 然后执行步骤3和4。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM