baresip 源码较为linphone 、pjsip 简单些 如果自己控制音视频比较简单些 更容易修改源码
安卓开发参考baresip android 编译、运行教程2 :视频通话-优快云博客
1.下载
http://www.creytiv.com/pub/baresip-0.6.3.tar.gz
http://www.creytiv.com/pub/re-0.6.0.tar.gz
http://www.creytiv.com/pub/rem-0.6.0.tar.gz
下载后放到同个文件夹并重命名为 baresip rem re
2.先运行官方的例子
在baresip的baresip\mk\win32 的文件夹有个默认的vc 项目 打开baresip.sln 执行编译
vs2015 2017如果无法打开包括文件"dirent.h":No such file or directory 到dirent/include at master · tronkko/dirent · GitHub下载个放到vs 的Community\VC\Auxiliary\VS\include 下
最后编译成功后运行效果如下
输入/help输出:
/about About box
/accept a Accept incoming call
/answermode .. Set answer mode
/auloop .. Start audio-loop <srate ch>
/auloop_stop Stop audio-loop
/auplay .. Switch audio player
/ausrc .. Switch audio source
/callstat c Call status
/conf_reload Reload config file
/config Print configuration
/contact_next > Set next contact
/contact_prev < Set previous contact
/contacts C List contacts
/dial .. d .. Dial
/dialcontact D Dial current contact
/hangup b Hangup call
/help h Help menu
/insmod .. Load module
/listcalls l List active calls
/loglevel v Log level toggle
/main Main loop debug
/memstat y Memory status
/message .. M .. Message current contact
/modules Module debug
/netstat n Network debug
/options .. o .. Options
/play .. Play audio file
/quit q Quit
/reginfo r Registration info
/rmmod .. Unload module
/sipstat i SIP debug
/sysinfo s System info
/timers Timer debug
/uadel .. Delete User-Agent
/uafind .. Find User-Agent <aor>
/uanew .. Create User-Agent
/uanext T Toggle UAs
/uastat u UA debug
/uuid Print UUID
/vidloop .. Start video-loop <codec>
/vidloop_stop Stop video-loop
/vidsrc .. Switch video source
输入注册的sip信息便会看到注册成功的信息
/uanew <sip:1000@192.168.0.102:5060>;auth_pass=h1234
使用dial 拨打 就可以实现通话了
/dial sip:1001@192.168.0.102:5060
3.制作一个lib库在自己的程序调用
关闭vs 在目录下修改baresip.vcxproj 去掉 不需要main.c
<ClCompile Include="..\..\src\main.c" />