移植linphone到FriendlyARM-smart210虚拟机使用:Ubuntu 12.04交叉工具链使用:arm-linux-gcc4.5.1,这个编译器是友善之臂提供的嵌入式linux版本:3.0.8将编译器添加到环境变量中:gedit /etc/profile
在最后一行加入export PATH=/usr/local/arm/4.5.1/bin:$PATH更新环境变量:source /etc/profile查看arm编译器版本:arm-linux-gcc -v根据项目需求,移植一个只有语音功能的linphone(无需界面与视频)linphone移植需要依赖其他库:libogg-1.3.0.tar.gz http://freecode.com/projects/liboggspeex-1.2rc1.tar.gz http://www.speex.org/downloads/libosip2-3.3.0.tar.gz http://ftp.gnu.org/gnu/osip/libeXosip2-3.3.0.tar.gz http://download.savannah.gnu.org/releases/exosip/ (与libosip2使用同一版本)readline-6.2.tar.gz(如未加此库,会出现linphonecsh无法注册到服务器的问题)linphone-3.2.0.tar.gz http://download.savannah.gnu.org/releases/linphone/设置好交叉编译器环境变量创建目录 /home/linphone/build,/home/linphone/arm_target,/home/linphone/sources将所有安装包放入/home/linphone/sources,并解压到该文件夹下tar -zxvf libogg-1.3.0.tar.gztar -zxvf readline-6.2.tar.gztar -zxvf speex-1.2rc1.tar.gztar -zxvf libosip2-3.3.0.tar.gztar -zxvf libeXosip2-3.3.0.tar.gztar -zxvf linphone-3.2.0.tar.gz交叉编译liboggmkdir /home/linphone/build/liboggcd /home/linphone/build/libogg../../sources/libogg-1.3.0/configure--prefix=/home/linphone/arm_targetCC=arm-linux-gcc
--host=arm-linux--enable-static --disable-sharedmakemake install(一般情况下没有错误发生)交叉编译speexmkdir /home/linphone/build/speexcd /home/linphone/build/speex../../sources/speex-1.2rc1/configure--host=arm-linux--prefix=/home/linphone/arm_target--enable-static--disable-shared--with-ogg=/home/linphone/arm_target/CC=arm-linux-gcc(加上此语句在config过程中会抱错,所以暂时去掉此语句)makemake install (一般情况下没有错误发生)交叉编译libosip2mkdir /home/linphone/build/libosip2cd /home/linphone/build/libosip2../../sources/libosip2-3.3.0/configure CC=arm-linux-gcc--host=arm-linux--prefix=/home/linphone/arm_target --enable-shared --disable-staticmake (一般情况下没有错误发生)make install交叉编译libeXosip2mkdir /home/linphone/build/libeXosip2cd /home/linphone/build/libeXosip2../../sources/libeXosip2-3.3.0/configure CC=arm-linux-gcc --host=arm-linux--prefix=/home/linphone/arm_target --enable-shared --disable-static PKG_CONFIG_PATH=/home/linphone/arm_target/lib/pkgconfig/makemake install (libeXosip2版本需要与libosip2的版本一直,否则编译不通过)交叉编译readline (一般情况下没有错误发生)mkdir /home/linphone/build/readlinecd /home/linphone/build/readline../../sources/readline-6.2/configure --host=arm-linux--prefix=/home/linphone/arm_target--with-gnu-ld
--disable-staticmakemake install交叉编译linphonemkdir /home/linphone/build/linphonecd /home/linphone/build/linphone../../sources/linphone-3.2.0/configure --host=arm-linux --disable-static --prefix=/home/linphone/arm_target --enable-alsa=yes --disable-glib --with-osip=/home/linphone/arm_target --with-speex=/home/linphone/arm_target SPEEX_CFLAGS="-I/home/linphone/arm_target/include"
SPEEX_LIBS="-L/home/linphone/arm_target/lib -lspeex -lspeexdsp" OSIP_CFLAGS="-I/home/linphone/arm_target/include" OSIP_LIBS="-L/home/linphone/arm_target/lib -leXosip2 -losipparser2" --disable-video --disable-gtk_ui PKG_CONFIG_PATH=/home/linphone/arm_target/lib/pkgconfig/
READLINE_CFLAGS="-I/home/linphone/arm_target/include" READLINE_LIBS="-L/home/linphone/arm_target/lib"makemake install注意:之前使用libeXosip2-4.0.0,编译linphone会报一堆错误,果断改用3.3.0版本,问题就没出现了,编译到后面出现config.h中的宏定义重复定义,只需在该文件中把相应的宏定义注释就解决了。mount -t nfs -o nolock 192.168.2.133:/root/workspace /tmp如果挂载后传输文件时出现:nfs: server 192.168.2.133 not responding, still trying的错误,可能是因为nfs-udp方式传输不稳定造成,使用以下语句挂载:mount -t nfs -o intr,nolock,rsize=1024,wsize=1024 192.168.2.133:/root/workspace /tmp挂载后要注意虚拟机ubuntu12.04中/etc/exports指定的共享文件目录为/root/workspace,因此要先把/home/linphone/arm_target目录拷贝到此共享目录中,再将arm_target/bin里的linphonec
linphonecsh拷贝到开发板文件系统的/usr/local/bin,之后在开发板终端里运行这两个程序.缺少库则从arm_target/lib拷贝到开发板的/usr/local/lib,如果arm_target/lib中没有需要的库文件,则从交叉工具链/usr/local/arm/4.5.1/中寻找.开发板测试1.以windows下的sip server 2008为服务器(linphonecsh在windows下可注册成功,在linux下的asterisk不能注册成功):linphonecsh initlinphonecsh register --host IP --username user --password passwdlinphonecsh register --host 192.168.2.12 --username1002 --password1002linphonecsh generic 'autoanswer enable'linphonecsh generic 'soundcard use 1'linphonecsh generic 'soundcard use /dev/dsp'linphonecsh generic "proxy list" linphonecsh dial "sip:1001@192.168.2.12"linphonecsh hanguplinphonecsh exit2.以linux下的asterisk为服务器(linphonec可注册成功):./linphoneclinphonec>proxy add指定sip服务器 sip:1003@192.168.2.134 回车指定本终端identity sip:1003@192.168.2.134 回车注册超期时间 600 回车linphonec> call 1001 呼叫另一终端linphonec> terminate退出linphonelinphonec使用参考:Linphonec is a terminal based version of linphone that reads commands from the user prompt.Example:Start linphonec in a terminal$ linphonec Ready Warning: video is disabled in linphonec, use -V or -C or -D to enable.Place an outgoing calllinphonec> call sip:594305005@someproxy.netAlternatively, if someproxy.net is your default proxy configuration (entered via 'proxy add' command), you call simply like thislinphonec> call 594305005Terminate a calllinphonec> terminateAt any time you can list available commands using 'help':linphonec> help Commands are: --------------------------- help Print commands help call Call a SIP uri chat Chat with a SIP uri terminate Terminate the current call answer Answer a call autoanswer Show/set auto-answer mode proxy Manage proxies soundcard Manage soundcards webcam Manage webcams staticpic Manage static pictures when nowebcam ipv6 Use IPV6 refer Refer the current call to the specified destination. nat Set nat address stun Set stun server address firewall Set firewall policy call-logs Calls history friend Manage friends play play from a wav file record record to a wav file quit Exit linphonec register Register in one line to a proxy unregister Unregister from default proxy duration Print duration in seconds of the last call. status Print various status information ports Network ports configuration speak Speak a sentence using espeak TTS engine codec Audio codec configuration vcodec Video codec configuration ec Echo cancellation mute Mute microphone and suspend voice transmission. unmute Unmute microphone and resume voice transmission. nortp-on-a Set the rtp_no_xmit_on_audio_mute configuration parameter --------------------------- Type 'help ' for more details. ——————————————————————————————————————————————经过测试,运行linphone导致arm linux无法重启,可试下一下步骤cd /kill -9 linphonec的pidreboot