linphone 移植到海斯机顶盒arm926成功运行

硬件准备:

1.usb voip ata一个

2.海斯arm926 开发板一个

3.usbrj11 一个

4.座机一部

5.网线

6.路由器一个

软件准备:

1.Asterisk服务端

2.linphone客户端

 

首先,在pc机上安装asterisk:

 

 

1、安装Asterisk依赖包清单

包--依赖关系

gcc--libpri, zaptel, asterisk

ncurses-devel--munuselect

libtermcap-devel--asterisk

kernel-devel--zaptel

kernel-smp-devel--zaptel

gcc-c++--asterisk

openssl-devel--asterisk

newt-devel--zaptel

zlib-devel--asterisk

unixODBC-devel--asterisk

libtool--asterisk

make--asterisk

注:很多包在安装光盘中都有,不需要再下载。

 

2Asterisk安装步骤

# cd /usr/src/asterisk-version ;进入源代码目录

# make clean ;清理生成的文件

# ./configure ;配置

# make menuselect ;选择要安装的模块

# make install ;安装Asterisk

# make config ;对于REDHAT系列系统,可将asterisk添加到/etc/rc.d/init.d

# make samples ;安装配置文件

 

3Asterisk简易配置

sip.conf

[general]

allowoverlap=no

bindport=5060

bindaddr=0.0.0.0

srvlookup=yes

qualify=yes

context=test

[1001]

type=friend

secret=test

host=dynamic

[1002]

type=friend

secret=test

host=dynamic

 

extensions.conf

添加:

[test]

exten => 1001,1,Dial(SIP/1001)

exten => 1002,1,Dial(SIP/1002)

 

4、客户端配置(X-Lite)

MENU -> System Settings -> SIP Proxy -> Default

Enable: YES

Display Name: 1001

Username: 1001

Authorization User: 1001

Password: test

Domain/Realm: xx.xx.xx.xx Asterisk服务器地址

SIP Proxy: xx.xx.xx.xx Astersk服务器地址

 

注:建议使用Default项,使用其它项会出现问题,导致拨不出去。

 

5Astersk管理

登录到Astersk服务器运行控制台: astersk -crvvv

查看登录用户 : sip shwo peers

查看详细记录: sip show peer 1001

重新加载拨号方案:dialplan reload

重新加载SIP方案:sip reload

 

6、语音邮箱简易设置

注册语音邮箱,在voicemail.conf中添加用户的语音邮箱和密码

voicemail.conf:

[test]

1001 => 1234, qiong, qiong@asterisk-server

1002 => 1234, ddd, ddd@astersik-server

 

在拨号方案中加入语音邮箱

extensions.conf:

[test]

exten => 1001,1,Dial(SIP/1001)

exten => 1001,2,VoiceMial(1001)

 

为用户定义邮箱

sip.conf:

[1001]

mailbox = 1001@test

 

重新加载配置后,客户端X-Lite界面上就会出现一个信封的标志,表示语音邮箱设置成功。

 

7、其它

其次, 安装linphone:

一)

 

Linphone依赖库准备:

 

libogg-1.1.3.tar.gz(http://downloads.xiph.org/releases/ogg/libogg-1.1.3.tar.gz

       speex-1.2beta3.tar.gz(依赖于libogg)

       libosip2-3.3.0.tar.gz(http://ftp.gnu.org/gnu/osip/libosip2-3.3.0.tar.gz

       libeXosip2-3.3.0.tar.gz(http://ftp.twaren.net/Unix/NonGNU/exosip/libeXosip2-3.3.0.tar.gz

       依赖库打包下载地址:http://download.csdn.net/source/1743975

       readline(optional)

       intltool-0.35.0.tar.gz(optional)

       ffmpeg(提供Linphone视频支持,如不需视频功能可不要)

 

Linphone版本:

      

       linphone-3.2.0.tar.gz

 

O S:

      

       Fedora9(VmWare下)

 

 

 

(二)

 

在Linux的/home/cena/目录下新建目录linphone在其中建立sources、build、x86_target、arm_target ;注:这里cena为用户名,以下类同!

 

 

[root @BCD  cena]#  mkdir –p /home/cena/linphone/sources,/home/cena/linphone/build /

                     /home/cena/linphone/x86_target, /home/cena/linphone/arm_target

 
 

 

将相应的库与Linphone源码拷贝到sources目录下

 

       |soureces

              --| libogg-1.1.3.tar.gz

              --| libosip2-3.3.0.tar.gz

              --| libeXosip2-3.3.0.tar.gz

              --| speex-1.2beta3.tar.gz

              --| linphone-3.2.0.tar.gz

 

 

将所有压缩文件解压准备编译;

 

[root @BCD  cena]#  cd linphone/sources

[root @BCD  sources]#  tar zxvf libogg-1.1.3.tar.gz

[root @BCD  sources]#  tar zxvf libosip2-3.3.0.tar.gz

[root @BCD  sources]#  tar zxvf libeXosip2-3.3.0.tar.gz

[root @BCD  sources]#  tar zxvf speex-1.2beta3.tar.gz

[root @BCD  sources]#  tar zxvf linphone-3.2.0.tar.gz

 
 

 

进入libogg目录,配置编译libogg

 

 

[root @BCD  sources]#  cd ../build/libogg

[root @BCD  libogg]#../../sources/libogg-1.1.3/configure --prefix=/home/cena/linphone/x86_target/

[root @BCD  libogg]#  make

[root @BCD  libogg]#  make install

 
 

 

进入speex目录,配置编译speex

 

 

[root @BCD  libogg]#  cd ../speex

[root @BCD  speex]#  ../../sources/speex-1.2beta3/configure --prefix=/home/cena/linphone/x86_target/ --with-ogg=/home/cena/linphone/x86_target/

[root @BCD  speex]#  make

[root @BCD  speex]#  make install

 
 

 

进入libosip目录,配置编译libosip

 

 

[root @BCD  speex]#  cd ../libosip

[root @BCD  libosip]# ../../sources/libosip2-3.3.0/configure --prefix=/home/cena/linphone/x86_target/

[root @BCD  libosip]#  make

[root @BCD  libosip]#  make install

 
 

 

 

进入libeXosip目录,配置编译libeXosip

 

 

[root @BCD  libosip]#  cd ../libeXosip

[root @BCD  libeXosip]# ../../sources/libeXosip2-3.3.0/configure --prefix=/home/cena/linphone/x86_target/ PKG_CONFIG_PATH=/home/cena/linphone/x86_target/lib/pkgconfig

[root @BCD  libeXosip]#  make ; make install

 
 

 

注:这里如果上一步的libosip的安装不是默认的,那么在配置libeXosip时要附上

       PKG_CONFIG_PATH=安装目录/lib/pkgconfig

 

进入linphone目录,配置编译linphone

 

 

[root @BCD  libeXosip]#  cd .../linphone

[root @BCD  linphone]#  ../../sources/linphone-3.2.0/configure --prefix=/home/cena/linphone/x86_target/ --disable-video --enable-gtk_ui=no --with-osip=/home/cena/linphone/x86_target/ PKG_CONFIG_PATH=/home/cena/linphone/x86_target/lib/pkgconfig

[root @BCD  linphone]#  make

[root @BCD  linphone]#  make install

 
 

 

注: --enable-gtk_ui=no 目的是去除gtk的ui,否则编译过程中会需要gtk+库。

        --disable-video 目的是裁剪掉视频功能,否则编译过程会需要ffmeg库。

        --with-osip 目的是指明编译过程所需要的osip库的位置。

 

P1:configure过程中可能会报intltool not found,这时只需要下载intltool-0.35.0.tar.gz安装即可,最好安装到/usr下

P2:

make过程中,会出现linphone-3.2.0/mediastreamer2/src/msconf.c:272 和274行的SPEEX_PREPROCESS_GET_PSD_SIZE和SPEEX_PREPROCESS_GET_PSD未定义的错误。

在x86_target/include/speex找到speex_preprocess.h文件在其中加入以上两个宏的定义。

#define SPEEX_PREPROCESS_GET_PSD_SIZE       34

#define SPEEX_PREPROCESS_GET_PSD                35

 

P3:make过程中,会出现config.h和coreapi中以及x86_target/include/osipparser2中的几个文件重定义的错误,经查对源代码可知道是config.h被引用了2次所致。故将coreapi中的sipsetup.c和siplogin.c中的第21行#include <../config.h>注释掉即可

 

再次编译,成功!!!安装后可在x86_target/bin下找到linphonec

 

Linphone的交叉编译
Cross-tools:arm-linux-gcc-3.4.1

 

O S:Fedra9(VMware)

 

进入libogg库编译

 

 

[root @BCD  cena]#  cd linphone/build/libogg

[root @BCD  libogg]# ../../sources/libogg-1.1.3/configure --prefix=/home/cena/linphone/arm_target/

                   CC=arm-linux-gcc --host=arm-linux --enable-static --disable-shared

[root @BCD  libogg]# make

[root @BCD  libogg]# make install

 
 

 

编译speex库

 

 

[root @BCD  libogg]# cd  ../speex

[root @BCD  speex]# ../../sources/speex-1.2beta3/configure --prefix=/home/cena/linphone/arm_target/ CC=arm-linux-gcc --host=arm-linux  --with-ogg=/home/cena/linphone/arm_target/ --enable-static –disable-shared

[root @BCD  speex]# make

[root @BCD  speex]# make install

 
 

 

编译libosip库

 

 

[root @BCD  speex]#  cd  ../libosip

[root @BCD  libosip]# ../../sources/libosip2-3.3.0/configure --prefix=/home/cena/linphone/arm_target/

                   CC=arm-linux-gcc --host=arm-linux –enable-shared –disable-static

[root @BCD  libosip]# make

[root @BCD  libosip]# make install

 
 

 

注:这里libosip库编译成动态库,否则编译linphone时会出错。

 

编译libeXosip库

注:仍然编译为动态库,原因同上。

 

 

 

[root @BCD  libosip]# cd  ../libeXosip

[root @BCD  libeXosip]# ../../sources/libeXosip2-3.3.0/configure --prefix=/home/cena/linphone/arm_target/

CC=arm-linux-gcc --host=arm-linux –enable-shared –disable-static

                  PKG_CONFIG_PATH=/home/cena/linphone/arm_target/lib/pkgconfig

[root @BCD  libeXosip]# make

[root @BCD  libeXosip]# make install

 
 

 

编译linphone

 

 

[root @BCD  libeXosip]# cd  ../linphone

[root @BCD linphone]# ../../sources/linphone-3.2.0/configure --prefix=/home/cena/linphone/arm_target/ --host=arm-linux CC=arm-linux-gcc --enable-static --disable-shared --disable-nls --disable-manual --enable-gtk_ui=no --disable-glib --with-osip=/home/cena/linphone/arm_target/ --enable-alsa=no --enable-video=no  --enable-strict=no  --enable-artsc=no

PKG_CONFIG_PATH=/home/cena/linphone/arm_target/lib/pkgconfig

[root @BCD linphone]# make

[root @BCD linphone]# make install

 
 

 

P1:

make过程中会报

linphone-3.2.0/mediastreamer2/src/msticker.c:248: error: `CLOCK_MONOTONIC' undeclared (first use in this function)

打开msticker.c文件找到该位置。无法确定是来自哪个头文件,无奈下将该else语段注释掉。

 

P2:

make过程中,会出现linphone-3.2.0/mediastreamer2/src/msconf.c:272 和274行的SPEEX_PREPROCESS_GET_PSD_SIZE和SPEEX_PREPROCESS_GET_PSD未定义的错误。

在x86_target/include/speex找到speex_preprocess.h文件在其中加入以上两个宏的定义。

#define SPEEX_PREPROCESS_GET_PSD_SIZE       34

#define SPEEX_PREPROCESS_GET_PSD                35

 

 

再次编译,成功!!!安装后可在arm_target/bin下找到linphonec

 

注:这里alsa被禁止了,alsa是声音的编码库,只有移植了alsa到arm上linphone才能进行语音通话,现阶段只能进行sip协议的互通测试。

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值