{"id":28822,"date":"2019-07-01T10:31:26","date_gmt":"2019-07-01T02:31:26","guid":{"rendered":"https:\/\/www.nby.me\/?p=28822"},"modified":"2025-01-22T17:15:31","modified_gmt":"2025-01-22T09:15:31","slug":"asteriskgoip-%e5%b0%86sim%e5%8d%a1%e8%bd%ac%e4%b8%basip","status":"publish","type":"post","link":"https:\/\/nby.me\/?p=28822","title":{"rendered":"Asterisk+GOIP \u5c06SIM\u5361\u8f6c\u4e3aSIP"},"content":{"rendered":"<p><!--more--><\/p>\n<p><a href=\"https:\/\/nby.me\/?page_id=29024\">\u7248\u6743\u58f0\u660e<\/a><\/p>\n<p>\u8d77\u56e0\uff1a<br \/>\n\u5728\u51e0\u5e74\u524d\u6211\u4e70\u4e86\u4e2a\u5317\u4eac\u94c1\u901a\u5546\u52a1\u901a\u7684\u65e0\u7ebf\u5ea7\u673a\uff0c\u7c7b\u4f3c\u4e8e\u5c0f\u7075\u901a\uff0c\u5fc5\u987b\u5904\u4e8e\u5317\u4eac\u79fb\u52a8\u8986\u76d6\u8303\u56f4\u5185\u624d\u53ef\u4ee5\u4f7f\u7528\u3002\u4f46\u662f\u6700\u8fd1\u51e0\u5e74\u4e0d\u5728\u5317\u4eac\u79df\u623f\u5b50\u4e86\uff0c\u51fa\u4e86\u5317\u4eac\u5c31\u6ca1\u6709\u4fe1\u53f7\u3002<br \/>\n\u6240\u4ee5\uff0c\u6211\u60f3\u627e\u4e2a\u670b\u53cb\uff0c\u628a\u673a\u5668\u6254\u5230\u670b\u53cb\u5bb6\uff0c\u53ef\u662f\u4e5f\u4e0d\u80fd\u8001\u9ebb\u70e6\u4eba\u5bb6\u5e2e\u5fd9\u63a5\u7535\u8bdd\u554a\u3002\u3002\u3002\u6240\u4ee5\uff0c\u6211\u5728\u60f3\u6709\u5565\u529e\u6cd5\u80fd\u628aSIM\u5361\u8f6c\u6210VOIP\uff0c\u53ea\u8981\u673a\u5668\u653e\u5728\u5317\u4eac\uff0c\u63d2\u4e0a\u7535\u5c31\u4e0d\u7528\u7ba1\u4e86\uff0c\u767b\u9646VOIP\u8d26\u53f7\u5c31\u80fd\u5728\u4efb\u4f55\u5730\u70b9\u63a5\u6253\u7535\u8bdd\u3002<\/p>\n<p>\u4e4b\u540e\u6211\u5c31\u770b\u5230\u6709\u4e2a\u786c\u4ef6\u8bbe\u5907\u53eb\u505aGOIP\uff0c\u53ef\u4ee5\u628aSIM\u5361\u8f6c\u4e3aVOIP\u5ba2\u6237\u7aef\u3002<\/p>\n<p>\u5f53\u7136\uff0c\u6211\u4e5f\u770b\u5230\u4e86\u5176\u4ed6\u4eba\u6811\u8393\u6d3e+USB\u5361\u6258\u7684\u6559\u7a0b\uff08https:\/\/steemit.com\/cn\/@ety001\/5zehat\uff09\uff0c\u4f46\u662f\u6211\u89c9\u5f97\u8fd8\u662f\u4e70\u73b0\u6210\u7684\u8bbe\u5907\u6bd4\u8f83\u7a33\u5b9a\u3002<\/p>\n<p>\u6211\u4e3b\u8981\u53c2\u8003\u4e86\u4ee5\u4e0b\u6587\u7ae0\uff1a<br \/>\nhttps:\/\/joybean.org\/2018\/05\/30\/iphone-multi-card-multi-standby-schema-solution-voip-and-goip<br \/>\nhttps:\/\/github.com\/tangaza\/Tangaza\/wiki\/Connecting-a-GoIP-GSM-VoIP-gateway-to-an-Asterisk-AGI<\/p>\n<p>\u6211\u7684Asterisk\u91c7\u7528VPS\uff0c\u7cfb\u7edf\u662fUbuntu 18.04,Asterisk\u76f4\u63a5apt install\u5b89\u88c5\u597d\u3002<br \/>\n\u5b89\u88c5\u597d\u540e\u53ea\u9700\u8981\u4fee\u6539\u4e24\u4e2a\u6587\u4ef6\u3002\u914d\u7f6e\u6587\u4ef6\u7684\u5177\u4f53\u53d8\u91cf\u53ef\u4ee5\u53c2\u8003\uff1a<br \/>\nhttps:\/\/github.com\/asterisk\/asterisk\/blob\/master\/configs\/samples\/sip.conf.sample<br \/>\nhttps:\/\/github.com\/asterisk\/asterisk\/blob\/master\/configs\/samples\/extensions.conf.sample<br \/>\nhttps:\/\/www.cnblogs.com\/Loadhao\/p\/6835331.html<br \/>\nhttps:\/\/blog.csdn.net\/u013132673\/article\/details\/52571371<br \/>\nhttps:\/\/jyqc688.iteye.com\/blog\/2277289<br \/>\nhttps:\/\/www.cnblogs.com\/lr393993507\/p\/5309913.html<br \/>\nhttps:\/\/www.voip-info.org\/asterisk-config-sipconf\/<br \/>\nhttps:\/\/www.voip-info.org\/asterisk-config-extensionsconf\/<\/p>\n<p>\/etc\/asterisk\/sip.conf<br \/>\n\u5728general\u4fee\u6539\u4ee5\u4e0b\u5185\u5bb9\uff1a<br \/>\n\u589e\u52a0\uff1a<br \/>\nbindport=5060<br \/>\nbindaddr=0.0.0.0<br \/>\n\u4fee\u6539\uff1a<br \/>\ncontext=default<br \/>\ntcpenable=yes<br \/>\nallowoverlap=yes  ;\u7528\u4e8e\u652f\u6301\u63a5\u901a\u540e\u8f93\u5165\u5361\u53f7\u5bc6\u7801\u4e4b\u7c7b\u7684\u3002<\/p>\n<p><del datetime=\"2019-07-01T14:45:58+00:00\">allowguest=yes<br \/>\ndtmfmode=rfc2833<br \/>\nvideosupport=yes<br \/>\ndisallow=all<br \/>\nallow=ulaw<br \/>\nallow=alaw<br \/>\nallow=g729<br \/>\nallow=h263<br \/>\nallow=h263p<br \/>\nallow=h264<br \/>\nallow=gsm<br \/>\nqualify=yes<\/del><\/p>\n<p>\u5728\u6587\u4ef6\u672b\u5c3e\u589e\u52a0\u4ee5\u4e0b\u5185\u5bb9<br \/>\n[goip] ;goip\u8bbe\u5907\u8d26\u6237\u53c2\u6570\uff0c\u8bf7\u81ea\u884c\u8bbe\u5b9apassword<br \/>\ncanreinvite=no<br \/>\ncontext=incoming<br \/>\ndtmfmode=rfc2833<br \/>\nfromuser=goip<br \/>\nhost=dynamic<br \/>\ndisallow=all<br \/>\nallow=ulaw<br \/>\nallow=alaw<br \/>\nallow=g729<br \/>\ninsecure=port,invite<br \/>\nsecret=password<br \/>\ndefaultname=goip<br \/>\nnat=yes  ;\u8bbe\u5907\u5982\u679c\u5728\u9632\u706b\u5899\u6216\u8005\u5176\u4ed6\u8bbe\u5907\u540e\u9762\u9700\u8981\u589e\u52a0nat=yes\u3002<br \/>\nqualify=yes<br \/>\ntype=friend<br \/>\n[username];\u7528\u6237\u8d26\u6237\u53c2\u6570\uff0c\u8bf7\u81ea\u884c\u8bbe\u5b9auser\u548cpassword<br \/>\ntype=friend<br \/>\ncontext=outcoming<br \/>\ncallerid = user<br \/>\nsecret = password<br \/>\nhost = dynamic<br \/>\ncanreinvite = no<br \/>\ndtmfmode = rfc2833<br \/>\nmailbox = user<br \/>\ndisallow = all<br \/>\nallow = ulaw<br \/>\ntransport = udp<br \/>\nqualify=yes<br \/>\nnat=yes<\/p>\n<p>\/etc\/asterisk\/extensions.conf<br \/>\n\u5728general\u90e8\u5206\u540e\u589e\u52a0\u4ee5\u4e0b\u5185\u5bb9\uff1a<\/p>\n<p>[incoming] ;\u6211\u8fd9\u4e2a\u6848\u4f8b\u3002\u3002\u3002\u662f\u95f2\u7684\u86cb\u75bc\u505a\u4e86\u4e2a\u8bed\u97f3\u83dc\u5355\uff0c\u54c8\u54c8\u54c8\uff5e<br \/>\nexten => 6666,1,Answer() ;6666\u662fGoIP&gt;\u914d\u7f6e&gt;\u547c\u5165\u7ba1\u7406&gt;\u8f6c\u79fb\u53f7\u7801\u4e2d\u586b\u5199\u7684\u6570\u5b57\uff0cVOIP\u670d\u52a1\u5668\u76d1\u542c6666\u8fd9\u4e2a\u53f7\u7801\u8fdb\u884c\u5e94\u7b54\u3002<br \/>\nexten => 6666,2,Wait(3)<br \/>\nexten => 6666,3,Playback(\/var\/lib\/asterisk\/sounds\/1) ;\u5f55\u97f3\u6587\u4ef6\u5fc5\u987b\u662fgsm\u683c\u5f0f\uff0c\u8981\u63d0\u524d\u653e\u5728\/var\/lib\/asterisk\/sounds\/\uff0c\u628a\u6587\u4ef6chown\u6539\u6210asterisk:asterisk<br \/>\nexten => 6666,4,Playback(\/var\/lib\/asterisk\/sounds\/2)<br \/>\nexten => 6666,5,Dial(SIP\/USER,30,r)  ;USER\u586b\u5199\u4f60\u4e0a\u9762sip.conf\u8bbe\u5b9a\u7684\u7528\u6237\u540d,\u547c\u53eb30\u79d2\u82e5\u65e0\u5e94\u7b54\u653e\u5f03\u63a5\u901a\uff0cr\u4f5c\u4e3a\u7b2c3\u4e2a\u53c2\u91cf,\u5728\u901a\u77e5\u88ab\u53eb\u901a\u9053\u6709\u6765\u7535\u7684\u8fd9\u6bb5\u65f6\u95f4\u5185,\u4e3b\u53eb\u65b9\u4f1a\u542c\u5230\u632f\u94c3\u58f0\u97f3\u3002<br \/>\nexten => 6666,6,Hangup()<\/p>\n<p>[outcoming]<br \/>\nexten =&gt; _0.,1,Dial(SIP\/${EXTEN:1}@goip,30,r);\u62e8\u51fa\u53f7\u7801\u524d\u52a00\u53ef\u4ee5\u901a\u8fc7goip\u547c\u51fa\uff0c\u4f8b\u5982010010\uff0c\u5c31\u662f\u547c\u53eb10010\uff0c\u4f8b\u59820+85212345678\uff0c\u5c31\u662f\u547c\u53eb\u56fd\u9645\u533a\u53f7\u4e3a+852\u53f7\u7801\u4e3a12345678\u3002<br \/>\nexten =&gt; goip,1,Dial(SIP\/goip,30,r)<br \/>\nexten =&gt; nby,1,Dial(SIP\/USER,30,r)<\/p>\n<p>[default]<br \/>\nexten =&gt; goip,1,Answer()<br \/>\nexten =&gt; goip,n,Dial(SIP\/goip,30,r)<br \/>\nexten =&gt; goip,n,Hangup<br \/>\nexten =&gt; USER,1,Answer()<br \/>\nexten =&gt; USER,n,Dial(SIP\/USER,30,r)<br \/>\nexten =&gt; USER,n,Hangup<\/p>\n<p>\u9664\u6b64\u4e4b\u5916\uff0c\u8bb0\u5f97fail2ban\u4e5f\u8981\u589e\u52a0Asterisk\u7684\u9632\u62a4\u89c4\u5219\uff1a<br \/>\nhttp:\/\/www.fail2ban.org\/wiki\/index.php\/Asterisk<br \/>\nhttps:\/\/cyphercodes.github.io\/2018\/04\/08\/Secure-Asterisk-13-with-Fail2ban-on-Ubuntu-16-04\/<\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"_links":{"self":[{"href":"https:\/\/nby.me\/index.php?rest_route=\/wp\/v2\/posts\/28822"}],"collection":[{"href":"https:\/\/nby.me\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nby.me\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nby.me\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nby.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=28822"}],"version-history":[{"count":10,"href":"https:\/\/nby.me\/index.php?rest_route=\/wp\/v2\/posts\/28822\/revisions"}],"predecessor-version":[{"id":29134,"href":"https:\/\/nby.me\/index.php?rest_route=\/wp\/v2\/posts\/28822\/revisions\/29134"}],"wp:attachment":[{"href":"https:\/\/nby.me\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=28822"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nby.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=28822"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nby.me\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=28822"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}