http://blog.csdn.net/rx_wen/archive/2010/12/19/6085411.aspx
Port exosip to android platform isn't a difficult task because exosip
doesn't rely on any special system calls that aren't available on
android. It only requires osip to compile, which can also be easily
ported.
As an example, I created two applications to run against exosip lib. One
is a native application that can run in android shell, the other is an
java application that interact with exosip through jni. The dependency
relationship between modules is:
The diagram below depicts the organization of files. They're organized this way so that they can be compiled through android ndk
build system.
To comply with ndk build system's requirements, we create a
directory named jni under sip_jni and sip_exe module, and place actual
source file there. The Android.mk and Application.mk (optional) are
placed in the jni directory as well. Keeping files this way, we can
issue ndk-build
command right in sip_jni or sip_exe directories to compile applications.
Note that we don't create jni directory for libosip and libexosip, their
Android.mk is placed directly under libosip and libexosip directories.
This is because they are dependent on by application modules. We don't
need compile them directly, instead, the build system will build them
automatically while building applications. In order to help build system
find libosip and libexosip, we must set NDK_MODULE_PATH environment
variable to the directory that directly containing libosip and
libexosip. The build system will search for them based on directory
name, so their names matter.
To port exosip to android, the essential task is to create the Android.mk
file, which specifies source files, c flags, ld flags, dependent
libraries. We define HAVE_TIME_H and HAVE_SYS_SELECT_H to compile exosip
successfully. And we define ENABLE_TRACE and OSIP_MT to enable logging
and multi-threading. In the last line, $
(
call
import
-
module
,
libosip
)
tells the build system that exosip depends on osip, and all header files exported by osip (
LOCAL_EXPORT_C_INCLUDES
:=
$
(
LOCAL_C_INCLUDES
)
) will be included by exosip automatically.
import-module is a feature that isn't available in the
build system in android source tree. It enables us organizing our
projects in arbitrary manner. For example, we can place libosip and
libexosip directories in another directory. The build system can still
find them as long as NDK_MODULE_PATH is set to the directory containing
them. It's much more flexible than specifying dependency relationship
with relative path.
Sample:
The sample for this post is available at:
http://code.google.com/p/rxwen-blog-stuff/source/browse/trunk/android/exosip_sample/
It shows how to:
- use ndk build system
- use stl in c++ code
- create a very basic exosip application
- call native code from java
- call java code from native code
References:
ndk document
exosip user manual
分享到:
相关推荐
在Android平台上开发VoIP或SIP(Session Initiation Protocol)应用时,eXosip库是一个重要的组件。本文将深入探讨如何使用Android NDK(Native Development Kit)来编译适用于Android平台的eXosip库,包括静态库和...
使用ndk编译eXosip安卓端库执行脚本,ndk编译需要指定configure参数及设置相关路径,
**exoSip 开发者手册** exoSip是一款开源的SIP(Session Initiation Protocol)栈,用于在各种网络应用程序中实现VoIP、多媒体通信和其他基于SIP的服务。本手册将深入探讨exoSip的开发流程,调用方法以及相关的宏...
2. **SIP消息构造**:构建REGISTER请求消息,包括添加必要的头字段,如From、To、Call-ID、CSeq和Contact。 3. **发送与接收**:使用EXOSIP API发送REGISTER请求,并处理服务器返回的响应,如200 OK表示注册成功,...
【exOsip 使用详解】 exOsip 是一个基于 OSIP(Open Session Initiation Protocol)库的开源 SIP(Session Initiation Protocol)应用框架。SIP 是一种互联网协议,用于建立、修改和终止多媒体通信会话,如语音通话...
9. **平台兼容性**:Exosip支持多种操作系统,如Linux、Windows、Android等。了解不同平台的特性,以及如何在不同环境下部署和使用Exosip,可以提高代码的可移植性。 10. **实战应用**:通过实际项目来实践Exosip...
《eXosip2 API详解:构建SIP通信的核心技术》 SIP(Session Initiation Protocol)协议是一种用于控制多媒体通信会话(如语音和视频通话)的信令协议,广泛应用于VoIP(Voice over IP)系统。在SIP协议栈的实现中,...
**eXosip2源码 v4.0.0 知识点详解** eXosip2是一款基于OSIP(Open SIP Interface)协议栈的开源SIP(Session Initiation Protocol)库,它提供了完整的SIP应用程序开发框架。SIP是一种用于多媒体通信的互联网标准...
《eXosip开发者手册》是一本专注于eXosip2协议栈的使用指南,它为开发者提供了详尽的接口说明和操作步骤。eXosip2是一个强大的SIP(Session Initiation Protocol)堆栈,用于处理SIP通信中的各种事务,如呼叫建立、...
标题中的“eXosip osip 5.2.0 VS2019 项目工程”指的是一个基于Visual Studio 2019开发环境的工程,该工程包含了eXosip和osip库的版本5.2.0。eXosip是osip(Open SIP Library)的一个扩展,专为SIP(Session ...
exoSip开发手册.pdf
1.1 How-To initialize libeXosip2 初始化libeXosip2是建立与exoSip栈交互的第一步。这通常涉及设置全局配置参数,如端口号、代理服务器地址等,并创建一个上下文对象,供后续的SIP操作使用。 1.2 Call Management...
在本文中,我们将深入探讨如何在Linux平台上使用osip和eXosip库构建服务器和客户端应用程序。osip(OpenSIP)是一个开源SIP(Session Initiation Protocol)栈,而eXosip是osip的扩展,提供了一种更高级别的API,...
标题中的"uac.zip_ eXosip2_exosip_exosip uac windows_josua user agent_sip"揭示了这个压缩包内容的核心:它包含了一个与User Account Control(UAC)相关的Windows应用程序,该程序基于eXosip2库,实现了SIP...
#### 一、eXosip栈的初始化(How-To initialize libeXosip2) 在使用eXosip进行开发时,首先需要完成的是eXosip上下文和libosip库(解析器与状态机)的初始化工作。这一过程是后续所有操作的基础。 ##### 1.1 初始...
标题 "Windows下编译好的eXosip" 暗示了这是一个专为Windows操作系统编译的开源SIP(Session Initiation Protocol)库——eXosip。SIP是一种网络协议,常用于建立和管理多媒体通信会话,如VoIP电话、视频会议等。这...
eXosip是基于OSIP(Open SIP Library)的SIP栈实现,专为高性能和易用性设计。在本案例中,我们关注的是eXosip 3.6.0的动态库版本,这个版本被编译后用于直接调用,特别适用于GB28181标准的认证过程。 GB28181是...
**exoSip开发手册** exoSip是一款开源的SIP(Session Initiation Protocol)栈,用于构建VoIP(Voice over Internet Protocol)应用和多媒体通信系统。SIP是一种互联网协议,用于控制多媒体通信会话,如语音和视频...