{"id":406,"date":"2013-05-23T10:59:04","date_gmt":"2013-05-23T04:59:04","guid":{"rendered":"http:\/\/alexeyka.zantsev.com\/?p=406"},"modified":"2013-05-23T18:08:28","modified_gmt":"2013-05-23T12:08:28","slug":"asterisk-contactpermit-and-contactdeny","status":"publish","type":"post","link":"https:\/\/alexeyka.zantsev.com\/?p=406","title":{"rendered":"Asterisk: contactpermit and contactdeny"},"content":{"rendered":"<p>We can control in the <code>[general]<\/code> section of the sip.conf from which IP-addresses the device can register against our Asterisk server. This could be achieved with the &#8216;<code>contactpermit<\/code>&#8216; and &#8216;<code>contactdeny<\/code>&#8216; parameters:<br \/>\n<code><br \/>\ncontactdeny=0.0.0.0\/0.0.0.0<br \/>\ncontactpermit=10.145.13.0\/255.255.255.0<br \/>\ncontactpermit=10.145.14.0\/255.255.255.0<br \/>\n<\/code><br \/>\nThe example above denies to register from any IP address and allows registration for devices which have 10.145.13.x or 10.145.14.x address.<\/p>\n<p>Note, that these are separate options, besides &#8216;deny=x.x.x.x\/x.x.x.x&#8217; and &#8216;permit=x.x.x.x\/x.x.x.x&#8217;, which are set in your SIP peers sections.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We can control in the [general] section of the sip.conf from which IP-addresses the device can register against our Asterisk server. This could be achieved with the &#8216;contactpermit&#8216; and &#8216;contactdeny&#8216; parameters: contactdeny=0.0.0.0\/0.0.0.0 contactpermit=10.145.13.0\/255.255.255.0 contactpermit=10.145.14.0\/255.255.255.0 The example above denies to register from any IP address and allows registration for devices which have 10.145.13.x or 10.145.14.x address. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[43,118,116,115,117],"class_list":["post-406","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-asterisk","tag-asterisk-security","tag-contactdeny","tag-contactpermit","tag-sip-conf"],"_links":{"self":[{"href":"https:\/\/alexeyka.zantsev.com\/index.php?rest_route=\/wp\/v2\/posts\/406","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alexeyka.zantsev.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/alexeyka.zantsev.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/alexeyka.zantsev.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/alexeyka.zantsev.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=406"}],"version-history":[{"count":7,"href":"https:\/\/alexeyka.zantsev.com\/index.php?rest_route=\/wp\/v2\/posts\/406\/revisions"}],"predecessor-version":[{"id":413,"href":"https:\/\/alexeyka.zantsev.com\/index.php?rest_route=\/wp\/v2\/posts\/406\/revisions\/413"}],"wp:attachment":[{"href":"https:\/\/alexeyka.zantsev.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=406"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alexeyka.zantsev.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=406"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alexeyka.zantsev.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=406"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}