Monthly Archive for February, 2015

AcmePacket: Reject calls from subscribers with hidden cell number

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 ‘uri-user’ parameter in SIP-header ‘From’ contains not cell number but ‘anonymous’. I had a task to reject such calls.

There already were 2 header-rules – one doing storing of ‘To’ headers’ values with VoIP provider’s DIDs inside , and the second – manipulating the ‘From’ headers, according to the stored values.

If I added the 3rd header-rule (last in the list) trying to reject anonymous calls, it haven’t worked, so it was necessary to keep it on the top of header-rules. (the ‘move’ command doesn’t work for me, though I’ve read in one Oracle/AcmePacket HMR guide that it’s possible, maybe my firmware does not support it)

Here’s the rule itself:

header-rule
		name                           rejectAnonymous
		header-name                    From
		action                         manipulate
		comparison-type                case-insensitive
		msg-type                       request
		methods                        INVITE
		match-value                    
		new-value                      
		element-rule
			name                           rejAnonymous
			parameter-name                 From
			type                           uri-user
			action                         reject
			match-val-type                 any
			comparison-type                case-insensitive
			match-value                    Anonymous
			new-value                      

Have a look at these nice screenshots demonstrating the initial INVITE from anonymous:

invite_anonymous

… and rejecting this call by AcmePacket 4250 with ‘400 Bad Request’ response:

400_bad_request

AcmePacket: reject redirected calls

What to do if somebody set up call redirect from his number to yours one, but you do not want to accept such calls?

According to RFC5806 – Diversion Indication in SIP,

The Diversion header SHOULD be added when a SIP proxy server, SIP
redirect server, or SIP user agent changes the ultimate endpoint that
will receive the call.

So, you have to reject INVITEs with Diversion header. This is how it looks like on the AcmePacket. One more header-rule (if you already have any) in sip-manipulation rule:

header-rule
	name                           reject_diversion
	header-name                    Diversion
	action                         manipulate
	comparison-type                case-sensitive
	msg-type                       request
	methods                        INVITE
	match-value                    
	new-value                      
	element-rule
		name                           rej_diversion
		parameter-name                 
		type                           header-value
		action                         reject
		match-val-type                 any
		comparison-type                pattern-rule
		match-value                    ^.*$
		new-value                      

You may also add something like “603:Decline” to “new-value” parameter.

Or even like this, without any responce codes and element-rules:

header-rule
                name                                    rejectDiversion
                header-name                             Diversion
                action                                  reject
                comparison-type                         boolean
                msg-type                                request
                methods                                 INVITE
                match-value                             
                new-value                               

tmux

tmux – start tmux
Ctrl-b and then c – create new virtual screen
Ctrl-b and then w – list created virtual screens (windows), select with arrow keys
Ctrl-b and then [ – start scrolling mode. Scroll with PageUp and PageDown, ‘q’ to leave scrolling mode.
exit or Ctrl-d – close virtual screen

A nice article from my hotly favourite OpenBSD project.