{"id":140,"date":"2023-10-25T10:04:19","date_gmt":"2023-10-25T02:04:19","guid":{"rendered":"https:\/\/www.liaoxinghui.com\/?p=140"},"modified":"2023-10-28T13:57:05","modified_gmt":"2023-10-28T05:57:05","slug":"freeswitch%e6%90%ad%e5%bb%ba%e5%8f%8a%e4%ba%8c%e6%ac%a1%e5%bc%80%e5%8f%91","status":"publish","type":"post","link":"https:\/\/www.liaoxinghui.com\/?p=140","title":{"rendered":"centos7 \u642d\u5efa Freeswitch"},"content":{"rendered":"<h2>Freeswitch\u5728\u5b89\u88c5\u7684\u65f6\u5019\u8fd8\u662f\u6bd4\u8f83\u9ebb\u70e6\uff0c\u5728\u7f16\u8bd1\u65f6\u4f1a\u9047\u5230\u5f88\u591a\u95ee\u9898\uff0c\u5728\u9047\u5230\u4e86\u5f88\u591a\u95ee\u9898\u540e\uff0c\u6211\u628a\u5b89\u88c5\u7684\u8fc7\u7a0b\u6574\u7406\u4e86\u4e00\u4e0b\uff0c\u7167\u6284\u4f5c\u4e1a\u57fa\u672c\u6ca1\u6709\u95ee\u9898\uff0c\u57fa\u7840\u73af\u5883\u662fCentos7.9 X64,\u6240\u6709\u7f16\u8bd1\u7684\u6e90\u6587\u4ef6\u8def\u5f84\u90fd\u5728\/usr\/local\/src\u4e0b\uff0c\u65b9\u4fbf\u4f60\u540e\u671f\u91cd\u65b0\u7f16\u8bd1\u6a21\u5757<\/h2>\n<h3>\u5148\u5b89\u88c5\u4f9d\u8d56<\/h3>\n<pre><code>yum install -y zlib-devel openssl-devel libjpeg-turbo-devel git sqlite-devel libcurl-devel speex-devel libedit-devel ldns-devel \nyum install -y gcc gcc-c++ libtool libtiff libtiff-devel autoconf automake libtool gcc-c++ ncurses-devel make zlib-devel\nyum install -y libjpeg-devel openssl-devel e2fsprogs-devel curl-devel pcre-devel speex-devel sqlite-devel\nyum install -y mysql-connector-odbc.x86_64 unixODBC-devel.x86_64<\/code><\/pre>\n<h3>\u8fd9\u4e2a\u662f\u540e\u9762\u9700\u8981\u94fe\u63a5\u6570\u636e\u5e93\u76f8\u5173\u7684\uff0c\u5982\u679c\u4f60\u4e0d\u7528\u6570\u636e\u5e93\u53ef\u4ee5\u65e0\u89c6<\/h3>\n<pre><code>yum install -y uuid uuid-devel libatomic.x86_64\nyum install -y unixODBC unixODBC-devel mysql-connector-odbc\nyum install -y libuuid libuuid-devel\nyum install -y autoconf automake libtool gcc-c++ ncurses-devel make zlib-devel libjpeg-devel\nyum install -y openssl-devel e2fsprogs-devel curl-devel pcre-devel speex-devel sqlite-devel\nyum install -y libshout-devel lame-devel libmpg123-devel<\/code><\/pre>\n<h3>\u5b89\u88c5noarch<\/h3>\n<pre><code>cd \/usr\/local\/src\/\nwget http:\/\/files.freeswitch.org\/freeswitch-release-1-6.noarch.rpm\nyum install -y freeswitch-release-1-6.noarch.rpm<\/code><\/pre>\n<h3>\u5904\u7406\u5b89\u88c5\u6e90<\/h3>\n<pre><code>cd \/etc\/yum.repos.d\/\nrm -rf freeswitch*\nyum clean all\nyum makecache\nyum -y update<\/code><\/pre>\n<h3>\u5b89\u88c5\u4f9d\u8d56<\/h3>\n<pre><code>yum install -y libatomic\nyum install -y git alsa-lib-devel autoconf automake bison broadvoice-devel bzip2 curl-devel libdb4-devel e2fsprogs-devel erlang flite-devel g722_1-devel gcc-c++ gdbm-devel gnutls-devel ilbc2-devel ldns-devel libcodec2-devel libcurl-devel libedit-devel libidn-devel libjpeg-devel libmemcached-devel libogg-devel libsilk-devel libsndfile-devel libtheora-devel libtiff-devel libtool libuuid-devel libvorbis-devel libxml2-devel lua-devel lzo-devel mongo-c-driver-devel ncurses-devel net-snmp-devel openssl-devel opus-devel pcre-devel perl perl-ExtUtils-Embed pkgconfig portaudio-devel postgresql-devel python-devel python-devel soundtouch-devel speex-devel sqlite-devel unbound-devel unixODBC-devel wget which yasm zlib-devel libshout-devel libmpg123-devel lame-devel<\/code><\/pre>\n<h3>\u5b89\u88c5cmake<\/h3>\n<pre><code>cmake-3.8.2\n\/\/\u68c0\u67e5\u662f\u5426\u5df2\u6709cmake\uff0c\u5982\u679c\u6709\u7684\u8bddremove\u6389\nyum info cmake\n\/\/\u5220\u9664cmake\u7248\u672c\n yum remove cmake -y\n\nwget https:\/\/cmake.org\/files\/v3.8\/cmake-3.8.2.tar.gz\ntar -zxvf cmake-3.8.2.tar.gz\ncd cmake-3.8.2\n.\/configure\nmake &amp;&amp; make install\n\n\u6dfb\u52a0\u8def\u5f84\nvi ~\/.bash_profile\n\u5c06\nPATH=$PATH:$HOME\/bin\n\u4fee\u6539\u4e3a\nPATH=$PATH:$HOME\/bin:\/usr\/local\/bin\u2028\u7136\u540e\u66f4\u65b0\u4e00\u4e0b\nsource ~\/.bash_profile<\/code><\/pre>\n<h3>\u5b89\u88c5libks<\/h3>\n<pre><code>cd \/usr\/local\/src\/\ngit clone https:\/\/github.com\/signalwire\/libks.git\ncd libks\ncmake .\nmake\nmake install<\/code><\/pre>\n<h3>\u5b89\u88c5signalwire-c<\/h3>\n<pre><code> cd \/usr\/local\/src\/\n git clone https:\/\/github.com\/signalwire\/signalwire-c.git\n cd signalwire-c\/\n cmake .\n make\n make install\n ln -sf \/usr\/local\/lib64\/pkgconfig\/signalwire_client.pc \/usr\/lib64\/pkgconfig\/signalwire_client.pc<\/code><\/pre>\n<h3>\u5b89\u88c5x264<\/h3>\n<pre><code>cd \/usr\/local\/src\/\ngit clone http:\/\/git.videolan.org\/git\/x264.git\ncd x264\n.\/configure  --disable-asm\nmake &amp;&amp; make install<\/code><\/pre>\n<h3>\u5b89\u88c5mod_av<\/h3>\n<pre><code>cd \/usr\/local\/src\/\nwget http:\/\/download1.rpmfusion.org\/free\/el\/updates\/7\/x86_64\/x\/x264-libs-0.148-24.20170521gitaaa9aa8.el7.x86_64.rpm\nwget http:\/\/download1.rpmfusion.org\/free\/el\/updates\/7\/x86_64\/x\/x264-devel-0.148-24.20170521gitaaa9aa8.el7.x86_64.rpm\nrpm -hiv x264-libs-0.148-24.20170521gitaaa9aa8.el7.x86_64.rpm\nrpm -hiv x264-devel-0.148-24.20170521gitaaa9aa8.el7.x86_64.rpm<\/code><\/pre>\n<h3>\u5b89\u88c5libpng<\/h3>\n<pre><code>git clone https:\/\/freeswitch.org\/stash\/scm\/sd\/libpng.git\n cd libpng\n.\/configure\nmake &amp;&amp; make install\ncp \/usr\/local\/lib\/pkgconfig\/libpng* \/usr\/lib64\/pkgconfig\/<\/code><\/pre>\n<h3>\u5b89\u88c5libav<\/h3>\n<pre><code>cd \/usr\/local\/src\/\ngit clone https:\/\/gitee.com\/nwaycn\/libav.git\ncd libav\n.\/configure --enable-pic --enable-shared  --enable-libx264 --enable-gpl --extra-libs=&quot;-ldl&quot;\nmake &amp;&amp; make install\ncp \/usr\/local\/lib\/pkgconfig\/libavcodec.pc    \/usr\/lib64\/pkgconfig\/\ncp \/usr\/local\/lib\/pkgconfig\/libavdevice.pc   \/usr\/lib64\/pkgconfig\/\ncp \/usr\/local\/lib\/pkgconfig\/libavfilter.pc   \/usr\/lib64\/pkgconfig\/\ncp \/usr\/local\/lib\/pkgconfig\/libavformat.pc   \/usr\/lib64\/pkgconfig\/\ncp \/usr\/local\/lib\/pkgconfig\/libavresample.pc \/usr\/lib64\/pkgconfig\/\ncp \/usr\/local\/lib\/pkgconfig\/libavutil.pc     \/usr\/lib64\/pkgconfig\/\ncp \/usr\/local\/lib\/pkgconfig\/libswscale.pc    \/usr\/lib64\/pkgconfig\/\n\ncp \/usr\/local\/lib\/pkgconfig\/libavcodec.pc    \/usr\/lib64\/pkgconfig\/&amp;&amp;cp \/usr\/local\/lib\/pkgconfig\/libavdevice.pc   \/usr\/lib64\/pkgconfig\/&amp;&amp;cp \/usr\/local\/lib&amp;&amp;pkgconfig\/libavfilter.pc   \/usr\/lib64\/pkgconfig\/&amp;&amp;cp \/usr\/local\/lib\/pkgconfig\/libavformat.pc   \/usr\/lib64\/pkgconfig\/&amp;&amp;cp \/usr\/local\/lib\/pkgconfig\/libavresample.pc \/usr\/lib64\/pkgconfig\/&amp;&amp;cp \/usr\/local\/lib\/pkgconfig\/libavutil.pc \/usr\/lib64\/pkgconfig\/&amp;&amp;cp \/usr\/local\/lib\/pkgconfig\/libswscale.pc    \/usr\/lib64\/pkgconfig\/<\/code><\/pre>\n<h3>\u5b89\u88c5opus<\/h3>\n<pre><code>cd \/usr\/local\/src\/\ngit clone https:\/\/freeswitch.org\/stash\/scm\/sd\/opus.git\ncd opus\n.\/autogen.sh \n.\/configure --libdir=\/home\/opp\/pjsiprel\/lib\/\nmake &amp;&amp; make install<\/code><\/pre>\n<h3>\u5b89\u88c5sofia-sip<\/h3>\n<pre><code>cd \/usr\/local\/src\/\ngit clone https:\/\/github.com\/freeswitch\/sofia-sip\ncd sofia-sip\n.\/bootstrap.sh\n.\/configure\nmake &amp;&amp; make install<\/code><\/pre>\n<h3>\u5b89\u88c5spandsp<\/h3>\n<pre><code>git clone https:\/\/github.com\/freeswitch\/spandsp\ncd spandsp\n.\/bootstrap.sh\n.\/configure\nmake &amp;&amp; make install\nexport PKG_CONFIG_PATH=\/usr\/local\/lib\/pkgconfig<\/code><\/pre>\n<h3>\u5b89\u88c5libopus-devel rmp\u5305<\/h3>\n<pre><code>vim \/etc\/yum.repos.d\/linuxtech.repo\n[linuxtech]\nname=LinuxTECH\nbaseurl=http:\/\/pkgrepo.linuxtech.net\/el6\/release\/\nenabled=1\ngpgcheck=1\ngpgkey=http:\/\/pkgrepo.linuxtech.net\/el6\/release\/RPM-GPG-KEY-LinuxTECH.NET\n\n# \u521b\u5efa\u4ed3\u5e93,\u91cd\u65b0\u5b89\u88c5\nyum install -y libopus-devel<\/code><\/pre>\n<h3>\u5b89\u88c5yasm<\/h3>\n<pre><code>git clone https:\/\/github.com\/yasm\/yasm.git \ncd yasm\n.\/autogen.sh\nmake &amp;&amp; make install<\/code><\/pre>\n<h3>\u5b89\u88c5FressSwitch,\u603b\u7b97\u5230\u5b89\u88c5\u672c\u4f53\u4e86<\/h3>\n<pre><code>cd \/usr\/local\/src\/ \nwget http:\/\/files.freeswitch.org\/freeswitch-1.10.2.-release.tar.gz\ntar vzxf freeswitch-1.10.2.-release.tar.gz\ncd freeswitch-1.10.2.-release\n#\u5982\u679c\u8981\u542f\u7528odbc .\/configure --enable-core-odbc-support<\/code><\/pre>\n<h3>\u56e0\u4e3a\u6211\u7684\u9879\u76ee\u9700\u8981\u6240\u4ee5\u5b89\u88c5\u4e0b\u5217\u6a21\u5757,MP3\u7684\u6a21\u5757\u5f3a\u70c8\u5efa\u8bae\u5927\u5bb6\u5b89\u88c5\uff0cWAV\u592a\u5360\u7a7a\u95f4\u4e86\uff0c\u4e14\u6709\u5f55\u97f3\u9700\u6c42\u7684\u8bdd\u4f1a\u9020\u6210\u5927\u91cf\u7684I\/O\uff0c\u5f00\u542f\u7f13\u5b58\u4f1a\u597d\u4e00\u4e9b\uff0c\u4f46\u662f\u8bbe\u5907\u6027\u80fd\u8ddf\u4e0d\u4e0a\u4f1a\u6709\u83ab\u540d\u7684\u95ee\u9898\uff0c\u4f8b\u5982\u5f55\u97f3\u6389\u5e27\uff0c\u6742\u97f3\u7b49<\/h3>\n<h3>\u5728\u5f00\u59cb\u7f16\u8bd1\u524d\u73b0\u5c06odbc\u53camp3\u6a21\u5757\u6253\u5f00,\u4e00\u8d77\u7f16\u8bd1<\/h3>\n<pre><code>formats\/mod_shout  #MP3\u6587\u4ef6\u652f\u6301\u6a21\u5757\nevent_handlers\/mod_odbc_cdr #\u8bdd\u5355\u6301\u4e45\u5316\u5230mysql,\u5982\u679c\u8981\u62c9\u8bdd\u5355\u5c31\u9700\u8981\n\n.\/configure\nmake &amp;&amp; make install  #\u7f16\u8bd1\u65f6\u95f4\u5f88\u957f\nln -sf \/usr\/local\/freeswitch\/bin\/freeswitch \/usr\/bin\/\nln -sf \/usr\/local\/freeswitch\/bin\/fs_cli \/usr\/bin\/<\/code><\/pre>\n<ul>\n\n<li>\u4e0b\u9762\u662f\u4e00\u4e9b\u5e2e\u52a9\u548c\u63d0\u793a\n<pre><code>freeswitch -nc -rp # \u540e\u53f0\u542f\u52a8freeswitch\u670d\u52a1\nfreeswitch -nonat -nc -rp  \/\/\u4e0d\u68c0\u67e5\u8def\u7531\u7a7f\u900f\u884c\uff0c\u52a0\u4e0a\u6b64\u53c2\u6570\u540e\u4f1a\u542f\u52a8\u5f88\u5feb\nfreeswitch -stop #\u505c\u6b62freeswitch\u670d\u52a1\nfs_cli\n# freeswitch -help\n-help                  -- \u663e\u793a\u672c\u5e2e\u52a9\u4fe1\u606f\n-version               -- \u663e\u793a\u7248\u672c\u4fe1\u606f\n-rp                    -- \u5f00\u542f\u9ad8\u4f18\u5148\u7ea7\uff08\u5b9e\u65f6\uff09\u8bbe\u7f6e\n\n-nosql                 -- \u4e0d\u4f7f\u7528SQL\uff0cshow channels \u7c7b\u7684\u547d\u4ee4\u5c06\u4e0d\u80fd\u663e\u793a\u7ed3\u679c\n-nonat                 -- \u5982\u679c\u8def\u7531\u5668\u652f\u6301uPnP\u6216NAT-PMP\uff0c\u5219FreeSWITCH\u53ef\u4ee5\u81ea\u52a8\u89e3\u51b3NAT\u7a7f\u8d8a\u95ee\u9898\u3002\u5982\u679c\u8def\u7531\u5668\u4e0d\u652f\u6301\uff0c\u5219\u8be5\u9009\u9879\u53ef\u4ee5\u4f7f\u542f\u52a8\u66f4\u5feb\n\n-stop                  -- \u5173\u95ed FreeSWITCH\uff0c\u5b83\u4f1a\u5728run\u76ee\u5f55\u4e2d\u67e5\u627e PID\u6587\u4ef6\n-nc                    -- \u542f\u52a8\u5230\u540e\u53f0\u6a21\u5f0f\uff0c\u6ca1\u6709\u63a7\u5236\u53f0<\/code><\/pre>\n<\/li>\n<\/ul>\n<h3>\u540e\u7eed\u6211\u4e5f\u4f1a\u9646\u7eed\u653e\u51fa\u4e00\u4e9b\u6559\u7a0b\uff0c\u6301\u4e45\u5316\u901a\u8bdd\u6e05\u5355\u5230\u6570\u636e\u5e93\uff0c\u4f7f\u7528minio\u7ba1\u7406\u5f55\u97f3\uff0c\u5bf9\u63a5\u7b2c\u4e09\u65b9\u7f51\u5173\uff0c\u65b9\u4fbf\u5c0f\u4f19\u4f34\u4e8c\u6b21\u5f00\u53d1\u3002<\/h3>\n<ul>\n\n<li><a href=\"https:\/\/www.liaoxinghui.com\/freeswitch%e8%ae%be%e7%bd%ae%e6%97%a5%e5%bf%97%e5%a4%a7%e5%b0%8f.html\">Freeswitch\u914d\u7f6e\u65e5\u5fd7\uff0c\u9632\u6b62\u65e5\u5fd7\u8fc7\u5927<\/a><\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>Freeswitch\u5728\u5b89\u88c5\u7684\u65f6\u5019\u8fd8\u662f\u6bd4\u8f83\u9ebb\u70e6\uff0c\u5728\u7f16\u8bd1\u65f6\u4f1a\u9047\u5230\u5f88\u591a\u95ee\u9898\uff0c\u5728\u9047\u5230\u4e86\u5f88\u591a\u95ee\u9898\u540e\uff0c\u6211\u628a\u5b89\u88c5\u7684\u8fc7\u7a0b\u6574\u7406\u4e86\u4e00\u4e0b\uff0c\u7167\u6284\u4f5c\u4e1a\u57fa\u672c\u6ca1\u6709\u95ee\u9898\uff0c &hellip;<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23,7],"tags":[24,26,25],"class_list":["post-140","post","type-post","status-publish","format-standard","hentry","category-freeswitch","category-linux","tag-freeswitch","tag-miniofreeswitch"],"views":589,"_links":{"self":[{"href":"https:\/\/www.liaoxinghui.com\/index.php?rest_route=\/wp\/v2\/posts\/140","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.liaoxinghui.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.liaoxinghui.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.liaoxinghui.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.liaoxinghui.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=140"}],"version-history":[{"count":4,"href":"https:\/\/www.liaoxinghui.com\/index.php?rest_route=\/wp\/v2\/posts\/140\/revisions"}],"predecessor-version":[{"id":207,"href":"https:\/\/www.liaoxinghui.com\/index.php?rest_route=\/wp\/v2\/posts\/140\/revisions\/207"}],"wp:attachment":[{"href":"https:\/\/www.liaoxinghui.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=140"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.liaoxinghui.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=140"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.liaoxinghui.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=140"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}