{"id":810,"date":"2015-02-26T21:05:53","date_gmt":"2015-02-26T15:05:53","guid":{"rendered":"http:\/\/alexeyka.zantsev.com\/?p=810"},"modified":"2021-02-28T01:44:38","modified_gmt":"2021-02-27T20:44:38","slug":"acmepacket-reject-calls-from-subscribers-with-hidden-cell-number","status":"publish","type":"post","link":"https:\/\/alexeyka.zantsev.com\/?p=810","title":{"rendered":"AcmePacket: Reject calls from subscribers with hidden cell number"},"content":{"rendered":"<p>Depending on GSM operator the values in SIP headers may vary. In my case if a subscriber activated the ability to hide cell number, the &#8216;uri-user&#8217; parameter in SIP-header &#8216;From&#8217; contains not cell number but &#8216;anonymous&#8217;. I had a task to reject such calls.<\/p>\n<p>There already were 2 header-rules &#8211; one doing storing of &#8216;To&#8217; headers&#8217; values with VoIP provider&#8217;s DIDs inside , and the second &#8211; manipulating the &#8216;From&#8217; headers, according to the stored values.<\/p>\n<p>If I added the 3rd header-rule (last in the list) trying to reject anonymous calls, it haven&#8217;t worked, so it was necessary to keep it on the top of header-rules. (the &#8216;move&#8217; command doesn&#8217;t work for me, though I&#8217;ve read in one Oracle\/AcmePacket HMR guide that it&#8217;s possible, maybe my firmware does not support it)<\/p>\n<p>Here&#8217;s the rule itself:<\/p>\n<pre>header-rule\n\t\tname                           rejectAnonymous\n\t\theader-name                    From\n\t\taction                         manipulate\n\t\tcomparison-type                case-insensitive\n\t\tmsg-type                       request\n\t\tmethods                        INVITE\n\t\tmatch-value                    \n\t\tnew-value                      \n\t\telement-rule\n\t\t\tname                           rejAnonymous\n\t\t\tparameter-name                 From\n\t\t\ttype                           uri-user\n\t\t\taction                         reject\n\t\t\tmatch-val-type                 any\n\t\t\tcomparison-type                case-insensitive\n\t\t\tmatch-value                    Anonymous\n\t\t\tnew-value                      \n<\/pre>\n<p>Have a look at these nice screenshots demonstrating the initial INVITE from anonymous:<\/p>\n<p><a href=\"https:\/\/alexeyka.zantsev.com\/wp-content\/uploads\/2015\/02\/invite_anonymous.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-813\" src=\"http:\/\/alexeyka.zantsev.com\/wp-content\/uploads\/2015\/02\/invite_anonymous.png\" alt=\"invite_anonymous\" width=\"400\" height=\"250\" \/><\/a><\/p>\n<p>&#8230; and rejecting this call by AcmePacket 4250 with &#8216;400 Bad Request&#8217; response:<\/p>\n<p><a href=\"https:\/\/alexeyka.zantsev.com\/wp-content\/uploads\/2015\/02\/400_bad_request.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-812\" src=\"http:\/\/alexeyka.zantsev.com\/wp-content\/uploads\/2015\/02\/400_bad_request.png\" alt=\"400_bad_request\" width=\"400\" height=\"250\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Depending on GSM operator the values in SIP headers may vary. In my case if a subscriber activated the ability to hide cell number, the &#8216;uri-user&#8217; parameter in SIP-header &#8216;From&#8217; contains not cell number but &#8216;anonymous&#8217;. I had a task to reject such calls. There already were 2 header-rules &#8211; one doing storing of &#8216;To&#8217; [&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":[204,196,195,206,203,205,201],"class_list":["post-810","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-acme","tag-acme-packet","tag-acmepacket","tag-anonymous","tag-hmr","tag-oracle","tag-sbc"],"_links":{"self":[{"href":"https:\/\/alexeyka.zantsev.com\/index.php?rest_route=\/wp\/v2\/posts\/810","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=810"}],"version-history":[{"count":10,"href":"https:\/\/alexeyka.zantsev.com\/index.php?rest_route=\/wp\/v2\/posts\/810\/revisions"}],"predecessor-version":[{"id":3662,"href":"https:\/\/alexeyka.zantsev.com\/index.php?rest_route=\/wp\/v2\/posts\/810\/revisions\/3662"}],"wp:attachment":[{"href":"https:\/\/alexeyka.zantsev.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=810"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alexeyka.zantsev.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=810"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alexeyka.zantsev.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=810"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}