freeswitch学习第一篇:freeswitch 添加自定义模块

从上个月开始从事freeswitch相关的开发工作。读文档和上网搜索,踩过太多坑,记录一下心得。以备以后复习

添加模块的方式尝试了很多种,试过的比较好的,比较方便的,如下

a、Makefile.am文件需要包含build目录下的modmake.rules

1、先写Makefile文件

Makefile 文件的内容是:

#BASE 是freeswitch的源码路径

BASE=/usr/src/freeswitch    

include $(BASE)/build/modmake.rules

就是这两句话,当然也可以写成一句。

2、写模块代码 简历模块文件夹和模块的代码文件名一致 例如mod_example/mod_example.c

这里说明一下,如果是.c文件的话,那么代码将会以c的方式编译代码,如果.cpp文件的话,那么将使用c++的方式编译代码。

mod_sample.c的代码如下

/*
 * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
 * Copyright (C) 2005/2012, Anthony Minessale II <anthm@freeswitch.org>
 *
 * 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.
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值