{"id":781,"date":"2026-04-09T13:53:49","date_gmt":"2026-04-09T05:53:49","guid":{"rendered":"https:\/\/www.liaoxinghui.com\/?p=781"},"modified":"2026-04-09T13:53:49","modified_gmt":"2026-04-09T05:53:49","slug":"freeswitch-sip-trunk-compatibility-traps","status":"publish","type":"post","link":"https:\/\/www.liaoxinghui.com\/?p=781","title":{"rendered":"\u5bf9\u63a5\u8fd0\u8425\u5546SIP\u4e2d\u7ee7\uff0c\u6211\u8e29\u8fc7\u7684\u90a3\u4e9b\u5751\u591f\u5199\u672c\u4e66\u4e86"},"content":{"rendered":"<h2>\u5927\u6982\u80cc\u666f\u5982\u4e0b<\/h2>\n<p>\u4e0a\u5468\u63a5\u4e86\u4e2a\u6d3b\u513f\uff1a\u65b0\u63a5\u5165\u4e00\u5bb6\u8fd0\u8425\u5546\u7684SIP\u4e2d\u7ee7\uff0c\u53f7\u79f0\u662f&#8221;\u6807\u51c6\u5bf9\u63a5&#8221;\uff0c\u7ed3\u679c\u547c\u5165\u547c\u51fa\u5168\u7279\u4e48\u7ffb\u8f66\u3002<\/p>\n<p>\u8bf4\u5b9e\u8bdd\uff0c\u6211\u5e72\u4e86\u8fd9\u4e48\u591a\u5e74VoIP\uff0c\u5bf9\u63a5\u8fc7\u7684\u8fd0\u8425\u5546\u4e5f\u4e0d\u5c11\u4e86\uff0c\u4ece\u6765\u6ca1\u9047\u5230\u8fc7\u4e00\u4e2a\u80fd\u4e00\u6b21\u6027\u8d70\u901a\u7684\u3002\u6bcf\u5bb6\u90fd\u8bf4\u81ea\u5df1\u7b26\u5408RFC\uff0c\u4e0d\u4fe1\u4f60\u53bb\u770b\u4ed6\u4eec\u7684\u5bf9\u63a5\u6587\u6863\u2014\u2014\u90a3\u73a9\u610f\u513f\u8981\u4e48\u8fc7\u671f\u4e86\uff0c\u8981\u4e48\u5199\u7684\u548c\u5b9e\u9645\u8dd1\u7684\u6839\u672c\u4e0d\u662f\u4e00\u56de\u4e8b\u3002<\/p>\n<p>\u8fd9\u6b21\u4e5f\u4e0d\u4f8b\u5916\u3002<\/p>\n<p>\u4e1a\u52a1\u573a\u666f\u662f\u8fd9\u6837\u7684\uff1a<\/p>\n<ul>\n<li>FreeSWITCH 1.10.7\uff0c\u8dd1\u5728CentOS 7\u4e0a<\/li>\n<li>\u9700\u8981\u540c\u65f6\u652f\u6301\u547c\u5165\u548c\u547c\u51fa<\/li>\n<li>\u8fd0\u8425\u5546\u90a3\u8fb9\u7ed9\u7684\u6587\u6863\u5199\u7684\u662f&#8221;SIP\u6807\u51c6\u534f\u8bae&#8221;\uff0c\u5b9e\u9645\u5bf9\u63a5\u7684\u65f6\u5019\u53d1\u73b0\u4ed6\u4eec\u7684&#8221;\u6807\u51c6&#8221;\u548c\u6211\u7684&#8221;\u6807\u51c6&#8221;\u4e0d\u662f\u4e00\u4e2a\u6807\u51c6<\/li>\n<\/ul>\n<p>\u5148\u8bf4\u7ed3\u8bba\u518d\u5410\u69fd\uff1a\u8fd9\u6b21\u95ee\u9898\u51fa\u5728\u4e09\u4e2a\u5730\u65b9\u2014\u2014<\/p>\n<ol>\n<li>Digest\u8ba4\u8bc1\u7684realm\u5339\u914d<\/li>\n<li>Contact\u5934\u57df\u7684\u683c\u5f0f\u8981\u6c42<\/li>\n<li>\u53f7\u7801E.164\u683c\u5f0f\u8f6c\u6362\u65f6\u673a<\/li>\n<\/ol>\n<p>\u6bcf\u4e2a\u90fd\u6298\u817e\u4e86\u6211\u81f3\u5c11\u534a\u5929\uff0c\u73b0\u5728\u60f3\u8d77\u6765\u8fd8\u9690\u9690\u5934\u75bc\u3002<\/p>\n<h2>\u7b2c\u4e00\u4e2a\u5751\uff1aDigest\u8ba4\u8bc1\u7684realm<\/h2>\n<p>\u8fd0\u8425\u5546\u90a3\u8fb9\u53d1\u6765\u914d\u7f6e\uff0c\u544a\u8bc9\u6211SIP\u4e2d\u7ee7\u7528\u7684\u662fDigest\u8ba4\u8bc1\u3002\u6211\u5fc3\u60f3\u8fd9\u6709\u5565\u96be\u7684\uff0cFreeSWITCH\u539f\u751f\u652f\u6301\u3002<\/p>\n<p>\u7ed3\u679c\u5462\uff1f<\/p>\n<pre><code>Authorization header is missing, cannot authenticate<\/code><\/pre>\n<p>Wireshark\u6293\u5305\u4e00\u770b\uff0c\u8fd0\u8425\u5546\u56de\u4e86 401\uff0c\u4f46WWW-Authenticate\u5934\u91cc\u5e26\u7684realm\u662f&#8221;CC_SIP&#8221;\uff0c\u800c\u6211sofia\u914d\u7f6e\u91cc\u586b\u7684\u662f\u8fd0\u8425\u5546\u7ed9\u7684\u7528\u6237\u540d\u3002<\/p>\n<p>\u8fd9\u91cc\u6709\u4e2a\u5173\u952e\u70b9\uff1a\u6709\u4e9b\u8fd0\u8425\u5546\u7684SIP\u8bbe\u5907\u5728Digest\u8ba4\u8bc1\u65f6\uff0crealm\u5b57\u6bb5\u586b\u7684\u4e0d\u662f\u7528\u6237\u540d\uff0c\u800c\u662f\u4ed6\u4eec\u7cfb\u7edf\u5185\u90e8\u5b9a\u4e49\u7684\u57df\u6807\u8bc6\u3002\u5982\u679c\u4f60\u7684\u914d\u7f6e\u91cc\u6ca1\u6709\u6b63\u786e\u5339\u914d\u8fd9\u4e2arealm\uff0c\u6bcf\u6b21\u8ba4\u8bc1\u8bf7\u6c42\u90fd\u4f1a\u88ab\u62d2\u3002<\/p>\n<p>\u68c0\u67e5\u4e00\u4e0b\u4f60\u7684 sofia.conf.xml \u914d\u7f6e\uff1a<\/p>\n<pre><code class=\"lang-xml language-xml xml\">&lt;profile name=&quot;carrier&quot;&gt;\n\n&lt;settings&gt;\n    &lt;param name=&quot;auth-calls&quot; value=&quot;true&quot;\/&gt;\n    &lt;param name=&quot;auth-realm&quot; value=&quot;CC_SIP&quot;\/&gt;\n  &lt;\/settings&gt;\n\n&lt;gateways&gt;\n    &lt;gateway name=&quot;carrier-gw&quot;&gt;\n      &lt;param name=&quot;username&quot; value=&quot;your_username&quot;\/&gt;\n      &lt;param name=&quot;password&quot; value=&quot;your_password&quot;\/&gt;\n      &lt;param name=&quot;realm&quot; value=&quot;CC_SIP&quot;\/&gt;\n      &lt;param name=&quot;from-user&quot; value=&quot;your_username&quot;\/&gt;\n    &lt;\/gateway&gt;\n  &lt;\/gateways&gt;\n&lt;\/profile&gt;<\/code><\/pre>\n<p>\u6ce8\u610frealm\u8fd9\u4e2a\u53c2\u6570\uff0c\u5f88\u591a\u4eba\u5ffd\u7565\u4e86\u3002\u8fd0\u8425\u5546\u90a3\u8fb9\u8fd4\u56de\u7684401\u91ccWWW-Authenticate\u5934\u662f\u8fd9\u6837\u7684\uff1a<\/p>\n<pre><code>WWW-Authenticate: Digest realm=&quot;CC_SIP&quot;, nonce=&quot;xxxx&quot;, qop=&quot;auth&quot;, algorithm=MD5<\/code><\/pre>\n<p>\u5982\u679c\u4f60\u7684gateway\u914d\u7f6e\u91cc\u6ca1\u6709\u663e\u5f0f\u6307\u5b9arealm\u4e3a&#8221;CC_SIP&#8221;\uff0cFreeSWITCH\u9ed8\u8ba4\u4f1a\u7528from-user\u4f5c\u4e3arealm\u53bb\u7b97\u6458\u8981\uff0c\u7ed3\u679c\u4e24\u8fb9\u7b97\u51fa\u6765\u7684MD5\u5bf9\u4e0d\u4e0a\u3002<\/p>\n<p><strong>\u6280\u672f\u5224\u65ad<\/strong>\uff1a\u4e3a\u4ec0\u4e48\u6211\u5224\u65ad\u662frealm\u7684\u95ee\u9898\u800c\u4e0d\u662f\u5bc6\u7801\u9519\u8bef\uff1f\u56e0\u4e3a\u4ece\u6293\u5305\u6765\u770b\uff0c\u8fd0\u8425\u5546\u8fd4\u56de\u7684\u662f407\u800c\u4e0d\u662f401\u3002Proxy-Authenticate\u548cWWW-Authenticate\u7684\u533a\u522b\u610f\u5473\u7740\u8fd9\u53ef\u80fd\u662f\u4ee3\u7406\u8ba4\u8bc1\u800c\u975e\u670d\u52a1\u7aef\u8ba4\u8bc1\uff0c\u9700\u8981\u68c0\u67e5INVITE\u6d88\u606f\u91cc\u7684Proxy-Authorization\u5934\u57df\u3002<\/p>\n<p>\u4f46\u66f4\u76f4\u63a5\u7684\u8bc1\u636e\u662f\uff1a\u6211\u624b\u52a8\u7528htdigest\u7b97\u4e86\u4e0b\u6458\u8981\uff0c\u786e\u8ba4\u5bc6\u7801\u6ca1\u95ee\u9898\u4e4b\u540e\u624d\u6000\u7591\u5230realm\u5934\u4e0a\u3002<\/p>\n<p>\u9a8c\u8bc1\u65b9\u6cd5\uff1a<\/p>\n<pre><code class=\"lang-bash language-bash bash\"># \u7528openssl\u624b\u52a8\u7b97\u4e00\u4e0bDigest response\uff0c\u5bf9\u6bd4\u6293\u5305\u91cc\u7684\u503c\nprintf &quot;your_username:CC_SIP:your_password&quot; | openssl md5 -hex<\/code><\/pre>\n<p>\u628a\u8ba1\u7b97\u7ed3\u679c\u548cWireshark\u91cc\u6293\u5230\u7684Authorization\u5934\u91ccresponse\u5b57\u6bb5\u6bd4\u5bf9\uff0c\u4e00\u81f4\u5c31\u8bf4\u660e\u5bc6\u7801\u6ca1\u9519\uff0c\u4e0d\u4e00\u81f4\u5c31\u8981\u68c0\u67e5realm\u3002<\/p>\n<h2>\u7b2c\u4e8c\u4e2a\u5751\uff1aContact\u5934\u57df\u683c\u5f0f<\/h2>\n<p>\u8ba4\u8bc1\u95ee\u9898\u89e3\u51b3\u4e4b\u540e\uff0c\u547c\u51fa\u80fd\u53d1\u8d77\u4e86\uff0c\u4f46\u662f\u8fd0\u8425\u5546\u90a3\u8fb9\u8bf4\u6536\u4e0d\u5230\u6211\u7684BYE\uff0c\u547c\u53eb\u4e00\u76f4\u6302\u5728\u90a3\u513f\u8f6c\u5708\u3002<\/p>\n<p>FreeSWITCH\u9ed8\u8ba4\u751f\u6210\u7684Contact\u5934\u662f\u8fd9\u6837\u7684\uff1a<\/p>\n<pre><code>Contact: &lt;sip:mod_sofia@192.168.1.100:5060&gt;<\/code><\/pre>\n<p>\u6709\u4e9b\u8fd0\u8425\u5546\uff08\u5c24\u5176\u662f\u90a3\u4e9b\u7528\u534e\u4e3a\u6216\u4e2d\u5174\u8bbe\u5907\u7684\uff09\u4f1a\u6821\u9a8cContact\u5934\u7684\u683c\u5f0f\uff0c\u8981\u6c42\u5fc5\u987b\u662f\u7528\u6237\u4fa7\u7684\u771f\u5b9e\u53f7\u7801\uff0c\u800c\u4e0d\u662f\u4e00\u4e2aIP\u5730\u5740\u6216\u8005\u7cfb\u7edf\u6807\u8bc6\u3002<\/p>\n<p>\u4ed6\u4eec\u7684\u903b\u8f91\u662f\uff1a\u5982\u679cContact\u91cc\u586b\u7684\u662fIP\u5730\u5740\uff0c\u90a3\u6211\u600e\u4e48\u77e5\u9053\u8fd9\u4e2a\u547c\u53eb\u662f\u4ece\u54ea\u4e2a\u5206\u673a\u53d1\u51fa\u6765\u7684\uff1f\u6ca1\u6cd5\u8def\u7531\u56de\u8bdd\u3002<\/p>\n<p>\u89e3\u51b3\u65b9\u6848\uff1a\u5728sofia gateway\u914d\u7f6e\u91cc\u52a0\u4e0a caller-id-in-from\uff1a<\/p>\n<pre><code class=\"lang-xml language-xml xml\">&lt;gateway name=&quot;carrier-gw&quot;&gt;\n  &lt;param name=&quot;caller-id-in-from&quot; value=&quot;true&quot;\/&gt;\n  &lt;param name=&quot;contact-params&quot; value=&quot;transport=tcp&quot;\/&gt;\n  &lt;param name=&quot;send-Contact&quot; value=&quot;true&quot;\/&gt;\n&lt;\/gateway&gt;<\/code><\/pre>\n<p>\u6216\u8005\u66f4\u66b4\u529b\u7684\u505a\u6cd5\uff0c\u5728sip_profiles\u91cc\u76f4\u63a5\u6539\uff1a<\/p>\n<pre><code class=\"lang-xml language-xml xml\">&lt;param name=&quot;NDLB-force-contact&quot; value=&quot;true&quot;\/&gt;\n&lt;param name=&quot;NDLB-received-in-contact&quot; value=&quot;true&quot;\/&gt;<\/code><\/pre>\n<p>\u4f46\u662f\u6ce8\u610f\uff0c\u8fd9\u4e24\u4e2a\u53c2\u6570\u4f1a\u5f71\u54cd\u5168\u5c40\u884c\u4e3a\uff0c\u53ef\u80fd\u5f15\u8d77\u5176\u4ed6\u95ee\u9898\uff0c\u6240\u4ee5\u6700\u597d\u53ea\u5728\u7279\u5b9agateway\u4e0a\u914d\u7f6e\u3002<\/p>\n<p><strong>\u65b9\u6848\u53d6\u820d<\/strong>\uff1a<\/p>\n<ul>\n<li>\u65b9\u6848A\uff1a\u6539caller-id-in-from\uff0c\u8ba9Contact\u7528\u4e3b\u53eb\u53f7\u7801<\/li>\n<li>\u65b9\u6848B\uff1a\u6539NDLB-force-contact\uff0c\u7528\u5bf9\u65b9IP\u5730\u5740\u66ff\u6362Contact<\/li>\n<li>\u65b9\u6848C\uff1a\u76f4\u63a5\u548c\u8fd0\u8425\u5546\u6c9f\u901a\uff0c\u8ba9\u4ed6\u4eec\u653e\u884c\u8fd9\u79cd\u683c\u5f0f<\/li>\n<\/ul>\n<p>\u6211\u9009\u4e86\u65b9\u6848A\uff0c\u56e0\u4e3a\u8fd0\u8425\u5546\u90a3\u8fb9\u8bf4\u4ed6\u4eec\u7684\u8bbe\u5907\u652f\u6301\u914d\u7f6e\u767d\u540d\u5355\uff0c\u653e\u884cIP\u6216\u8005\u7279\u6b8a\u683c\u5f0f\u9700\u8981\u8d70\u5de5\u5355\u5ba1\u6279\uff0c\u4e0d\u77e5\u9053\u8981\u7b49\u591a\u4e45\u3002\u65b9\u6848B\u6709\u5168\u5c40\u526f\u4f5c\u7528\uff0c\u6700\u540e\u53ef\u80fd\u5bfc\u81f4\u5176\u4ed6\u6b63\u5e38\u901a\u8bdd\u51fa\u95ee\u9898\u3002<\/p>\n<h2>\u7b2c\u4e09\u4e2a\u5751\uff1a\u53f7\u7801\u683c\u5f0f\u2014\u2014\u8fd9\u662f\u6700\u8ba9\u6211\u5d29\u6e83\u7684<\/h2>\n<p>\u547c\u5165\u547c\u51fa\u90fd\u901a\u4e86\uff0c\u4f46\u662f\uff01<\/p>\n<p>\u547c\u51fa\u7684\u53f7\u7801\u6709\u65f6\u5019\u80fd\u901a\uff0c\u6709\u65f6\u5019\u4e0d\u80fd\u901a\u3002\u6293\u5305\u4e00\u770b\uff0c\u8fd0\u8425\u5546\u90a3\u8fb9\u6536\u5230\u7684\u53f7\u7801\u683c\u5f0f\u4e0d\u4e00\u81f4\u3002<\/p>\n<p>\u95ee\u9898\u5728\u4e8eE.164\u683c\u5f0f\u3002<\/p>\n<p>\u4e2d\u56fd\u8fd0\u8425\u5546\u7684\u89c4\u8303\u662f\uff1a<\/p>\n<ul>\n<li>\u62e8\u6253\u56fd\u5185\u53f7\u7801\uff1a\u53bb\u6389+86\uff0c\u524d\u7f00\u52a00086\u6216\u800586<\/li>\n<li>\u62e8\u6253\u56fd\u9645\u53f7\u7801\uff1a\u4fdd\u7559+\u53f7\uff0c\u683c\u5f0f\u4e3a+\u56fd\u5bb6\u4ee3\u7801+\u53f7\u7801<\/li>\n<\/ul>\n<p>\u4f46\u5f88\u591a\u7cfb\u7edf\u8bbe\u8ba1\u7684\u65f6\u5019\u6ca1\u8003\u8651\u8fd9\u4e2a\uff0c\u6216\u8005\u8f6c\u6362\u65f6\u673a\u4e0d\u5bf9\u3002<\/p>\n<p>FreeSWITCH\u7684\u53f7\u7801\u8f6c\u6362\u4e3b\u8981\u9760 dialplan \u91cc\u7684 regex \u548c lua \u811a\u672c\u3002\u5e38\u89c1\u7684\u95ee\u9898\u662f\uff1a<\/p>\n<ol>\n<li>\u51fa\u5c40\u7684\u65f6\u5019\u6ca1\u6709\u505aE.164\u8f6c\u6362\uff0c\u53f7\u7801\u8fd8\u662f\u672c\u5730\u683c\u5f0f\uff08138xxxx\uff09\uff0c\u8fd0\u8425\u5546\u90a3\u8fb9\u65e0\u6cd5\u8bc6\u522b<\/li>\n<li>\u547c\u5165\u7684\u65f6\u5019\u505a\u4e86\u53cc\u91cd\u8f6c\u6362\uff0c\u6bd4\u5982\u5df2\u7ecf\u8f6c\u8fc7\u7684\u53c8\u88ab\u8f6c\u4e86\u4e00\u904d<\/li>\n<li>\u6765\u7535\u663e\u793a\u7684\u53f7\u7801\u6ca1\u6709\u8f6c\u6362\uff0c\u5bfc\u81f4\u5728\u8f6f\u7535\u8bdd\u4e0a\u663e\u793a\u4e3a\u4e71\u7801<\/li>\n<\/ol>\n<p>\u6211\u7684\u505a\u6cd5\u662f\u5728\u51fa\u5c40dialplan\u91cc\u7edf\u4e00\u505a\u8f6c\u6362\uff1a<\/p>\n<pre><code class=\"lang-xml language-xml xml\">&lt;extension name=&quot;outbound-number-translation&quot;&gt;\n  &lt;condition field=&quot;destination_number&quot; expression=&quot;^(\\d{11})$&quot;&gt;\n    &lt;!-- \u56fd\u5185\u624b\u673a\u53f7\uff0c\u8f6c\u6362\u4e3aE.164\u683c\u5f0f --&gt;\n    &lt;action application=&quot;set&quot; data=&quot;effective_caller_id_number=+86$1&quot;\/&gt;\n    &lt;action application=&quot;set&quot; data=&quot;destination_number=0086$1&quot;\/&gt;\n  &lt;\/condition&gt;\n  &lt;condition field=&quot;destination_number&quot; expression=&quot;^(\\d{10})$&quot;&gt;\n    &lt;!-- \u56fa\u8bdd\uff0c\u8003\u8651\u533a\u53f7 --&gt;\n    &lt;action application=&quot;set&quot; data=&quot;destination_number=008610$1&quot;\/&gt;\n  &lt;\/condition&gt;\n&lt;\/extension&gt;<\/code><\/pre>\n<p>\u4f46\u8fd9\u8fd8\u4e0d\u591f\uff0c\u56e0\u4e3a\u6211\u53d1\u73b0\u8fd0\u8425\u5546\u90a3\u8fb9\u5bf9\u67d0\u4e9b\u53f7\u6bb5\uff08\u6bd4\u598295xxx\u3001400xxx\uff09\u7684\u8def\u7531\u8981\u6c42\u53c8\u4e0d\u4e00\u6837\u3002<\/p>\n<p>\u6240\u4ee5\u540e\u6765\u6211\u628a\u8fd9\u4e9b\u8f6c\u6362\u89c4\u5219\u90fd\u62bd\u51fa\u6765\uff0c\u505a\u6210\u4e86\u4e00\u4e2alookup\u8868\uff1a<\/p>\n<pre><code class=\"lang-lua language-lua lua\">-- \/usr\/local\/freeswitch\/scripts\/number_translate.lua\n\nlocal number_rules = {\n  -- \u683c\u5f0f\uff1apattern -&gt; {prefix, suffix, format}\n  {&quot;^1[3-9]%d%d%d%d%d%d%d%d%d$&quot;, &quot;0086&quot;, &quot;&quot;, &quot;mobile&quot;},\n  {&quot;^0[1-9]%d%d%d$&quot;, &quot;0086&quot;, &quot;&quot;, &quot;landline&quot;},\n  {&quot;^400%d%d%d%d%d%d%d$&quot;, &quot;&quot;, &quot;&quot;, &quot;tollfree&quot;},\n  {&quot;^95%d%d%d$&quot;, &quot;&quot;, &quot;&quot;, &quot;special&quot;},\n}\n\nlocal function translate_number(num)\n  for _, rule in ipairs(number_rules) do\n    local pattern, prefix, suffix, num_type = rule[1], rule[2], rule[3], rule[4]\n    if string.match(num, pattern) then\n      -- \u6839\u636e\u53f7\u7801\u7c7b\u578b\u505a\u4e0d\u540c\u5904\u7406\n      if num_type == &quot;tollfree&quot; then\n        return &quot;&quot;, num  -- 400\/800\u53f7\u7801\u76f4\u63a5\u53d1\n      else\n        return prefix .. num .. suffix, num\n      end\n    end\n  end\n  return num, num  -- \u9ed8\u8ba4\u8fd4\u56de\u539f\u53f7\u7801\nend\n\nreturn translate_number<\/code><\/pre>\n<p><strong>\u8fb9\u754c\u6761\u4ef6<\/strong>\uff1a<\/p>\n<ul>\n<li>\u643a\u53f7\u8f6c\u7f51\u7684\u53f7\u7801\u5904\u7406\uff1a\u67d0\u4e9b\u53f7\u6bb5\u5df2\u7ecf\u8f6c\u7f51\uff0c\u4f46\u53f7\u7801\u672c\u8eab\u6ca1\u53d8\uff0c\u8fd0\u8425\u5546\u8def\u7531\u4f1a\u8d70\u4e0d\u540c\u7684\u7f51\u5173<\/li>\n<li>\u865a\u62df\u53f7\u6bb5\u7684\u5904\u7406\uff1a\u7269\u8054\u7f51\u5361\u3001\u90e8\u5206\u4f01\u4e1a\u53f7\u6bb5\u7684\u8def\u7531\u89c4\u5219\u7279\u6b8a<\/li>\n<li>\u56fd\u9645\u6f2b\u6e38\u53f7\u7801\uff1a\u624b\u673a\u5728\u5883\u5916\u6f2b\u6e38\u65f6\uff0c\u4e3b\u53eb\u53f7\u7801\u53ef\u80fd\u662f+86\u5f00\u5934\uff0c\u9700\u8981\u533a\u5206\u5904\u7406<\/li>\n<\/ul>\n<h2>\u9a8c\u6536\u6807\u51c6\uff1a\u600e\u4e48\u8bc1\u660e\u6211\u4fee\u597d\u4e86<\/h2>\n<ol>\n<li><strong>SIP\u6ce8\u518c\u7a33\u5b9a\u6027<\/strong>\uff1a\u8fde\u7eed\u6ce8\u518c24\u5c0f\u65f6\u4e0d\u65ad\u7ebf\uff0c\u8fd0\u8425\u5546\u4fa7\u770b\u5230\u7684\u6ce8\u518c\u72b6\u6001\u4e00\u81f4<\/li>\n<\/ol>\n<pre><code class=\"lang-bash language-bash bash\"># \u68c0\u67e5\u6ce8\u518c\u72b6\u6001\nsofia status profile carrier gateway carrier-gw\n\n# \u5e94\u8be5\u770b\u5230 State: REGED \u800c\u4e0d\u662f FAIL_WAIT<\/code><\/pre>\n<ol start=\"2\">\n<li><strong>\u547c\u51fa\u901a\u8bdd<\/strong>\uff1a\u8fde\u7eed\u62e8\u625350\u901a\u56fd\u5185\u7535\u8bdd\uff0c\u6210\u529f\u7387100%<\/li>\n<\/ol>\n<pre><code class=\"lang-bash language-bash bash\"># \u7528originate\u547d\u4ee4\u6279\u91cf\u6d4b\u8bd5\nfor i in {1..50}; do\n  fs_cli -x &quot;originate sofia\/gateway\/carrier-gw\/138xxxxxxxx &amp;echo()&quot; &amp;\ndone\nwait<\/code><\/pre>\n<ol start=\"3\">\n<li>\n<p><strong>\u547c\u5165\u901a\u8bdd<\/strong>\uff1a\u8ba9\u8fd0\u8425\u5546\u4fa7\u914d\u5408\uff0c\u8fde\u7eed\u547c\u5165100\u901a\uff0c\u6210\u529f\u7387100%<\/p>\n<\/li>\n<li>\n<p><strong>\u6293\u5305\u9a8c\u8bc1<\/strong>\uff1a\u7528tshark\u8fc7\u6ee4\u4e00\u4e0b\uff0c\u786e\u4fdd\u6240\u6709SIP\u6d88\u606f\u7684\u5934\u57df\u683c\u5f0f\u7b26\u5408\u9884\u671f<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"lang-bash language-bash bash\"># \u63d0\u53d6\u6240\u6709BYE\u6d88\u606f\u7684Contact\u5934\uff0c\u786e\u8ba4\u683c\u5f0f\u6b63\u786e\ntshark -r capture.pcap -Y &quot;sip.Method == BYE&quot; -T fields -e sip.contact | uniq -c<\/code><\/pre>\n<h2>\u590d\u76d8\uff1a\u8fd9\u4e9b\u5751\u7684\u603b\u7ed3<\/h2>\n<ol>\n<li>\n<p><strong>\u8fd0\u8425\u5546\u6587\u6863\u6c38\u8fdc\u662f\u53c2\u8003\uff0c\u4e0d\u8981\u5f53\u5723\u7ecf<\/strong><\/p>\n<p>\u4ed6\u4eec\u7684\u6280\u672f\u652f\u6301\u5de5\u7a0b\u5e08\u53ef\u80fd\u4e5f\u641e\u4e0d\u6e05\u695a\u81ea\u5df1\u7684\u8bbe\u5907\u5230\u5e95\u600e\u4e48\u914d\u7f6e\u7684\u3002\u6211\u9047\u5230\u8fc7\u4e00\u4e2a\u8fd0\u8425\u5546\uff0c\u4ed6\u4eec\u7ed9\u7684SIP\u4e2d\u7ee7\u914d\u7f6e\u6587\u6863\u91cc\u5199\u7684\u5bc6\u7801\u662f\u9519\u7684\uff0c\u4f46\u6280\u672f\u652f\u6301\u4e00\u53e3\u54ac\u5b9a\u6587\u6863\u6ca1\u95ee\u9898\u3002\u6700\u540e\u662f\u6211\u4eec\u76f4\u63a5\u6253\u7535\u8bdd\u7ed9\u4ed6\u4eec\u7684\u6838\u5fc3\u7f51\u56e2\u961f\uff0c\u4eba\u5bb6\u7ffb\u5c71\u8d8a\u5cad\u627e\u4e86\u534a\u5929\u624d\u53d1\u73b0\u914d\u7f6e\u5728\u53e6\u4e00\u5957\u7cfb\u7edf\u91cc\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u6293\u5305\u662f\u7239\uff0c\u6709\u95ee\u9898\u5148\u6293\u5305<\/strong><\/p>\n<p>SIP\u76f8\u5173\u7684bug\uff0c80%\u4ee5\u4e0a\u9760Wireshark\/tshark\u6293\u5305\u5c31\u80fd\u5b9a\u4f4d\u3002\u5269\u4e0b\u768420%\u662f\u8fd0\u8425\u5546\u90a3\u8fb9\u7684\u95ee\u9898\uff0c\u4f60\u6293\u4e86\u5305\u7529\u7ed9\u4ed6\u4eec\uff0c\u4ed6\u4eec\u4e5f\u5f97\u8ba4\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u53f7\u7801\u8f6c\u6362\u8981\u505a\u5728\u8fb9\u754c\uff0c\u4e0d\u8981\u6563\u843d\u5728\u5404\u5904<\/strong><\/p>\n<p>\u65e9\u671f\u7cfb\u7edf\u8bbe\u8ba1\u7684\u65f6\u5019\uff0c\u53f7\u7801\u8f6c\u6362\u903b\u8f91\u53ef\u80fd\u6563\u843d\u5728dialplan\u3001lua\u811a\u672c\u3001\u751a\u81f3\u6570\u636e\u5e93\u91cc\u3002\u540e\u6765\u7ef4\u62a4\u7684\u65f6\u5019\u6839\u672c\u4e0d\u77e5\u9053\u54ea\u4e2a\u73af\u8282\u6539\u4e86\u5565\uff0c\u5bfc\u81f4\u6709\u4e9b\u53f7\u7801\u88ab\u8f6c\u4e86\u4e24\u904d\uff0c\u6709\u4e9b\u538b\u6839\u6ca1\u8f6c\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u548c\u8fd0\u8425\u5546\u7684\u6280\u672f\u5bf9\u63a5\u8981\u627e\u5bf9\u4eba<\/strong><\/p>\n<p>\u4e00\u822c\u7684\u5ba2\u670d\u6216\u8005\u5ba2\u6237\u7ecf\u7406\u542c\u4e0d\u61c2\u4f60\u8bf4\u5565\uff0c\u4ed6\u4eec\u53ea\u4f1a\u8bf4&#8221;\u6211\u4eec\u5df2\u7ecf\u8bb0\u5f55\u4e86\u60a8\u7684\u9700\u6c42\uff0c\u4f1a\u8f6c\u4ea4\u6280\u672f\u90e8\u95e8\u5904\u7406&#8221;\u3002\u4f46\u6280\u672f\u90e8\u95e8\u5904\u7406\u7684\u901f\u5ea6\u561b\u2026\u2026\u5efa\u8bae\u627e\u90a3\u79cd\u80fd\u52a0\u5fae\u4fe1\u76f4\u63a5\u6c9f\u901a\u7684\uff0c\u6216\u8005\u8ba9\u4ed6\u4eec\u62c9\u4e2a\u6280\u672f\u7fa4\uff0c\u628a\u6838\u5fc3\u7f51\u3001\u7f51\u7ba1\u3001\u8bbe\u5907\u5382\u5546\u7684\u4eba\u90fd\u62c9\u8fdb\u6765\uff0c\u4e0d\u7136\u4e00\u4e2a\u95ee\u9898\u80fd\u62d6\u4f60\u4e00\u5468\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u5907\u4efd\u914d\u7f6e\uff01\u5907\u4efd\u914d\u7f6e\uff01\u5907\u4efd\u914d\u7f6e\uff01<\/strong><\/p>\n<p>\u91cd\u8981\u7684\u4e8b\u60c5\u8bf4\u4e09\u904d\u3002\u6bcf\u6b21\u6539\u914d\u7f6e\u4e4b\u524d\uff0c\u8bb0\u5f97\u5148\u5907\u4efd\u539f\u6765\u7684\u3002\u8fd0\u8425\u5546\u7684\u8bbe\u5907\u6709\u65f6\u5019\u4f1a\u53d1\u4e00\u4e9b\u83ab\u540d\u5176\u5999\u7684\u6d88\u606f\uff0c\u4f60\u7684FreeSWITCH\u53ef\u80fd\u88ab\u5e26\u504f\u4e86\uff0c\u6539\u56de\u53bb\u7684\u65f6\u5019\u624d\u77e5\u9053\u54ea\u4e2a\u662f\u6709\u6548\u7684\u3002<\/p>\n<\/li>\n<\/ol>\n<p>\u6700\u540e\uff0cFreeSWITCH\u662f\u4e2a\u597d\u4ea7\u54c1\uff0c\u4f46\u5bf9\u63a5\u8fd0\u8425\u5546\u8fd9\u4e8b\u513f\uff0c\u672c\u8d28\u4e0a\u662f\u548c\u4e00\u4e2a\u4e0d\u786e\u5b9a\u7684\u7cfb\u7edf\u535a\u5f08\u3002\u80fd\u505a\u7684\u5c31\u662f\uff1a\u591a\u6293\u5305\uff0c\u591a\u8bb0\u5f55\uff0c\u591a\u6c9f\u901a\uff0c\u5c11\u8e29\u5751\u3002<\/p>\n<p>\u5982\u679c\u4f60\u4eec\u516c\u53f8\u4e5f\u8981\u63a5SIP\u4e2d\u7ee7\uff0c\u795d\u4f60\u597d\u8fd0\u3002\u771f\u7684\u3002<\/p>","protected":false},"excerpt":{"rendered":"<p>\u5410\u69fd\u5411\u590d\u76d8\uff1a\u5bf9\u63a5\u65b0\u8fd0\u8425\u5546SIP\u4e2d\u7ee7\u65f6\uff0c\u8ba4\u8bc1\u673a\u5236\u3001\u5934\u57df\u683c\u5f0f\u3001\u53f7\u7801\u8f6c\u6362\u8f6e\u6d41\u5751\u4e86\u6211\u4e00\u904d\u3002\u8bb0\u5f55\u4e00\u4e0b\u5f53\u65f6\u7684\u6392\u67e5\u601d\u8def\u548c\u6700\u7ec8\u65b9\u6848\uff0c\u7ed9\u540e\u6765\u4eba\u907f\u5751\u3002<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23,236,500],"tags":[13,15,14,301,669],"class_list":["post-781","post","type-post","status-publish","format-standard","hentry","category-freeswitch","category-voip","category-500","tag-freeswitch","tag-sip","tag-voip","tag-301","tag-669"],"views":22,"_links":{"self":[{"href":"https:\/\/www.liaoxinghui.com\/index.php?rest_route=\/wp\/v2\/posts\/781","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=781"}],"version-history":[{"count":1,"href":"https:\/\/www.liaoxinghui.com\/index.php?rest_route=\/wp\/v2\/posts\/781\/revisions"}],"predecessor-version":[{"id":797,"href":"https:\/\/www.liaoxinghui.com\/index.php?rest_route=\/wp\/v2\/posts\/781\/revisions\/797"}],"wp:attachment":[{"href":"https:\/\/www.liaoxinghui.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=781"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.liaoxinghui.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=781"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.liaoxinghui.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=781"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}