$str.equals problem

Discuss any topic about Brekeke SIP Server.

Moderator: Brekeke Support Team

Post Reply
redmiru
Posts: 19
Joined: Sun Feb 12, 2012 4:34 pm

$str.equals problem

Post by redmiru »

1. Brekeke Product Name and version:
Brekeke SIP server, 2.4.8.6

2. Java version:
1.6

3. OS type and the version:
Windows Server 2008

4. UA (phone), gateway or other hardware/software involved:

5. Select your network pattern from http://www.brekeke-sip.com/bbs/network/ ... terns.html :

6. Your problem:

(1) I want to drop the call if From username(last 4 digits) is same with To username(last 4 digits)
(2) From filed: <sip:1234567@....> To field: <sip:9874567@...>
----> MUST drop
(3) I was planned like this

Matching Patterns
$request=^INVITE
$str.equals($str.substring($geturi(From), 7,11), $str.substring($geturi(To),7,11))=true

Deploy patterns
$action=403

But it doesn't work

(4) how to plannig Dialplan? please help. ;(
hope
Posts: 862
Joined: Tue Jan 15, 2008 4:08 pm

Post by hope »

matching
$request = ^INVITE
From = sip:.+([0-9]{4})@
To = sip:.+%1@

deploy:
$action = 403
redmiru
Posts: 19
Joined: Sun Feb 12, 2012 4:34 pm

Thank you! It works perfectly!

Post by redmiru »

Thank you Hope! It works!
hope wrote:matching
$request = ^INVITE
From = sip:.+([0-9]{4})@
To = sip:.+%1@

deploy:
$action = 403
Post Reply