{"id":1427,"date":"2020-12-22T08:09:11","date_gmt":"2020-12-22T00:09:11","guid":{"rendered":"https:\/\/www.wjxy.net.cn\/?p=1427"},"modified":"2023-10-04T06:32:39","modified_gmt":"2023-10-03T22:32:39","slug":"%e9%80%9a%e8%bf%87%e4%bd%bf%e7%94%a8%e5%bc%80%e6%ba%90%e8%bd%af%e4%bb%b6asterisk%ef%bc%8c%e8%87%aa%e5%b7%b1%e5%8a%a8%e6%89%8b%e6%90%ad%e5%bb%ba%e5%85%8d%e8%b4%b9voip%e6%9c%8d%e5%8a%a1%e5%99%a8","status":"publish","type":"post","link":"https:\/\/www.wjxy.net.cn\/?p=1427","title":{"rendered":"\u901a\u8fc7\u4f7f\u7528\u5f00\u6e90\u8f6f\u4ef6Asterisk\uff0c\u81ea\u5df1\u52a8\u624b\u642d\u5efa\u514d\u8d39VoIP\u670d\u52a1\u5668\u3002"},"content":{"rendered":"<p>1. \u8fd9\u91cc\u4ee5 Debian \u4e3a\u4f8b\u5b50\uff0c\u5b89\u88c5 Asterisk<\/p>\n<pre>apt-get update\r\napt-get install asterisk<\/pre>\n<p>2. \u9884\u8bbe\u7f6e Asterisk\uff0c\u4fee\u6539 sip.conf \u548c extensions.conf \u6587\u4ef6\uff0c\u662f\u4e3a\u4e86\u521b\u5efa\u4e24\u4e2a\u53ef\u4f9b\u6d4b\u8bd5\u7684 SIP \u8d26\u53f7<\/p>\n<pre>nano \/etc\/asterisk\/sip.conf<\/pre>\n<p>\u5728\u6587\u4ef6\u7684\u5f00\u5934\u90e8\u5206\u6dfb\u52a0\u5982\u4e0b\u4fe1\u606f\uff1a<\/p>\n<pre>[general]\r\ncontext = default\r\nbindport = 5060\r\nbindaddr = 0.0.0.0\r\ntcpbindaddr = 0.0.0.0\r\ntcpenable = yes\r\n\r\n[1001]\r\ntype = friend\r\nusername = 1001\r\nsecret=1001\r\nhost=dynamic\r\ndisallow = all\r\nallow = ulaw\r\ntransport = udp\r\ncontext=from-1001\r\n\r\n[1002]\r\ntype = friend \r\nusername = 1002 \r\nsecret = 1002\r\nhost = dynamic\r\ndisallow = all\r\nallow = ulaw\r\ntransport = udp\r\ncontext=from-1002\r\n\r\n<\/pre>\n<p>\u8fd9\u91cc\u7684\u610f\u601d\u662f\uff0cAsterisk \u4f1a\u542c\u53d6\u6765\u81ea\u6240\u6709 IP \u7684\u8bf7\u6c42\uff0c\u76d1\u542c\u7aef\u53e3\u4e3a 5060\uff0c\u5e76\u4e14\u542f\u7528 TCP \u534f\u8bae\u7684\u652f\u6301\u3002\u7136\u540e\u5b9a\u4e49\u4e86\u4e24\u4e2a\u5206\u673a\u53f7\u7801\uff0c\u5206\u522b\u7ed9\u4e861001\u548c1002 \u4e24\u4e2a\u7528\u6237\u3002<\/p>\n<pre>vim \/etc\/asterisk\/extensions.conf<\/pre>\n<p>\u5728\u6587\u4ef6\u7684\u5f00\u5934\u90e8\u5206\u6dfb\u52a0\u5982\u4e0b\u4fe1\u606f\uff1a<\/p>\n<pre>[general]\r\nstatic=yes\r\nwriteprotect=no\r\n\r\n[from-1001]\r\nexten =&gt; 1001,1,Answer()\r\nexten =&gt; 1001,n,Dial(SIP\/${EXTEN},20,tr)\r\nexten =&gt; 1001,n,Hangup\r\n\r\n[from-1002]\r\nexten =&gt; 1002,1,Answer()\r\nexten =&gt; 1002,n,Dial(SIP\/${EXTEN},20,tr)\r\nexten =&gt; 1002,n,Hangup\r\n\r\n<\/pre>\n<p>\u8fd9\u91cc\u7684\u610f\u601d\u662f\uff0c\u786e\u8ba4\u8fd9\u4e24\u4e2a\u5206\u673a\u53f7\u7801\u7684\u5b58\u5728\u3002<\/p>\n<p>3. \u91cd\u542f Asterisk<\/p>\n<pre>\/etc\/init.d\/asterisk restart<\/pre>\n<p>4. \u914d\u7f6e\u5ba2\u6237\u7aef\u7a0b\u5e8f\uff0c\u8fd9\u91cc\u5206\u522b\u7528 X-Lite\uff0cBlink\uff0cCSipSimple \u505a\u6f14\u793a\uff0c\u6559\u4f60\u5982\u4f55\u8bbe\u7f6e<\/p>\n<p>\u6240\u6709\u7684\u53c2\u6570\u90fd\u6765\u6e90\u4e8e sip.conf \u6587\u4ef6\uff1a<\/p>\n<ul>\n<li>Account name \/ Display name = callerid<\/li>\n<li>User ID \/ Authorization name = \u5206\u673a\u53f7\u7801 (\u65b9\u62ec\u53f7\u91cc\u9762\u7684 e.g. 1001)<\/li>\n<li>Password = secret<\/li>\n<li>The Domain = Server IP Address<\/li>\n<\/ul>\n<p>\u914d\u7f6e X-Lite\uff1a \u83dc\u5355 Softphone \u2013 Account Settings<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-1428\" title=\"asterisk_x_lite\" src=\"https:\/\/www.wjxy.net.cn\/wp-content\/uploads\/2020\/12\/\u901a\u8fc7\u4f7f\u7528\u5f00\u6e90\u8f6f\u4ef6asterisk\uff0c\u81ea\u5df1\u52a8\u624b\u642d\u5efa\u514d\u8d39voip\u670d\u52a1\u5668.jpg\" alt=\"\" width=\"382\" height=\"678\" srcset=\"https:\/\/www.wjxy.net.cn\/wp-content\/uploads\/2020\/12\/\u901a\u8fc7\u4f7f\u7528\u5f00\u6e90\u8f6f\u4ef6asterisk\uff0c\u81ea\u5df1\u52a8\u624b\u642d\u5efa\u514d\u8d39voip\u670d\u52a1\u5668.jpg 382w, https:\/\/www.wjxy.net.cn\/wp-content\/uploads\/2020\/12\/\u901a\u8fc7\u4f7f\u7528\u5f00\u6e90\u8f6f\u4ef6asterisk\uff0c\u81ea\u5df1\u52a8\u624b\u642d\u5efa\u514d\u8d39voip\u670d\u52a1\u5668-169x300.jpg 169w\" sizes=\"(max-width: 382px) 100vw, 382px\" \/><\/p>\n<p>\u914d\u7f6e Blink\uff1a \u83dc\u5355 Blink \u2013 Accounts \u2013 Add account<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-1429\" title=\"asterisk_blink\" src=\"https:\/\/www.wjxy.net.cn\/wp-content\/uploads\/2020\/12\/\u901a\u8fc7\u4f7f\u7528\u5f00\u6e90\u8f6f\u4ef6asterisk\uff0c\u81ea\u5df1\u52a8\u624b\u642d\u5efa\u514d\u8d39voip\u670d\u52a1\u5668-1.jpg\" alt=\"\" width=\"549\" height=\"502\" srcset=\"https:\/\/www.wjxy.net.cn\/wp-content\/uploads\/2020\/12\/\u901a\u8fc7\u4f7f\u7528\u5f00\u6e90\u8f6f\u4ef6asterisk\uff0c\u81ea\u5df1\u52a8\u624b\u642d\u5efa\u514d\u8d39voip\u670d\u52a1\u5668-1.jpg 549w, https:\/\/www.wjxy.net.cn\/wp-content\/uploads\/2020\/12\/\u901a\u8fc7\u4f7f\u7528\u5f00\u6e90\u8f6f\u4ef6asterisk\uff0c\u81ea\u5df1\u52a8\u624b\u642d\u5efa\u514d\u8d39voip\u670d\u52a1\u5668-1-300x274.jpg 300w\" sizes=\"(max-width: 549px) 100vw, 549px\" \/><\/p>\n<p>\u914d\u7f6e CSipSimple (Android)\uff1a \u83dc\u5355 Accounts \u2013 Add account \u2013 Generic wizards \u2013 Basic<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-1430\" title=\"asterisk_csipsimple\" src=\"https:\/\/www.wjxy.net.cn\/wp-content\/uploads\/2020\/12\/\u901a\u8fc7\u4f7f\u7528\u5f00\u6e90\u8f6f\u4ef6asterisk\uff0c\u81ea\u5df1\u52a8\u624b\u642d\u5efa\u514d\u8d39voip\u670d\u52a1\u5668.png\" alt=\"\" width=\"480\" height=\"800\" srcset=\"https:\/\/www.wjxy.net.cn\/wp-content\/uploads\/2020\/12\/\u901a\u8fc7\u4f7f\u7528\u5f00\u6e90\u8f6f\u4ef6asterisk\uff0c\u81ea\u5df1\u52a8\u624b\u642d\u5efa\u514d\u8d39voip\u670d\u52a1\u5668.png 480w, https:\/\/www.wjxy.net.cn\/wp-content\/uploads\/2020\/12\/\u901a\u8fc7\u4f7f\u7528\u5f00\u6e90\u8f6f\u4ef6asterisk\uff0c\u81ea\u5df1\u52a8\u624b\u642d\u5efa\u514d\u8d39voip\u670d\u52a1\u5668-180x300.png 180w\" sizes=\"(max-width: 480px) 100vw, 480px\" \/><\/p>\n<p>5. \u62e8\u6253 VoIP \u7684\u65b9\u5f0f\u5c31\u662f\u76f4\u63a5\u5728\u5ba2\u6237\u7aef\u7a0b\u5e8f\u91cc\u8f93\u5165\u5bf9\u65b9\u7684\u5206\u673a\u53f7\u7801\u5373\u53ef<\/p>\n<p>6. \u5c31\u8fd9\u4e48\u591a\u4e86\uff0c\u5982\u679c\u6709\u8fde\u901a\u95ee\u9898\uff0c\u8bf7\u6ce8\u610f\u9632\u706b\u5899\u7684\u8bbe\u7f6e<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. \u8fd9\u91cc\u4ee5 Debian \u4e3a\u4f8b\u5b50\uff0c\u5b89\u88c5 Asterisk apt-get update apt-get in [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"_links":{"self":[{"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=\/wp\/v2\/posts\/1427"}],"collection":[{"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1427"}],"version-history":[{"count":2,"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=\/wp\/v2\/posts\/1427\/revisions"}],"predecessor-version":[{"id":1432,"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=\/wp\/v2\/posts\/1427\/revisions\/1432"}],"wp:attachment":[{"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1427"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1427"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1427"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}