[Spce-user] Peer rules

Greg Lipschitz Greg at thesummitgroup.com.au
Wed Sep 9 08:04:41 EDT 2015

Hi Alessandro,

I think you have a fundamental misunderstanding of the difference between Call Routing, Call Rating, Rewrite Rules and NCOS.

Phone Call > Mediation > Rating > CDR

1. Call Rating

You do not have to rate any calls - if you are not going to use Sipwise for billing, and you don't need to generate rated CDR's for billing (internally or externally) and you don't want to apply any cost basis to a billing group for toll fraud blocking etc, then, you do not need to rate calls.

So, if this is the case, then setup 1 Billing Profile and have nothing in it and apply it to both your Peer and your Customer / Reseller. Everything will be $0 rated in your CDR, everything will rate correctly, there will be no errors.

As soon as you define one rate in a Billing Profile, then you must complete your rules to rate all calls correctly otherwise, rate-o-mat will hit something for which it does not have a match and fail.

It's very much an all or nothing approach.

2. Rewrite Rules

Rewrite rules are used to manipulate numbers to a format so that you can parse everything to a single standard, or, prepend / append to a call. ie 0NSN to E164, E164 to 0NSN, 0011 to E164, +011 to E164 etc.

It's not going to do blocking - that is what NCOS is for.

3. Call Routing

This is done at the peer level. If you want to preference a country or local prefix to one peer over another, then you need to set that up in your peer under the Peering Rules. If you have just a default rule configured, then this is an "ANY/ANY" rule (Any Callee Prefix/Any Callee Pattern/Any Caller Pattern) and will route all calls regardless of prefix / caller / callee / patterns.

This can be used for routing a country code towards a peer over another peer.

By default, as you only have one peer, I would suspect you just have the 1 default route.


This is used for Whitelisting / Blacklisting. This is where you can define lists of who you want your subscribers to be able to call or not able to call and applied at a Subscriber / Realm.

So, from what I understand of your setup, you need;

1. to make sure your rewrite rules are valid and working, regardless of the source / destination - this is just a basic requirement to make sure you have good call flow.
2. to make sure you have a billing profile setup correctly and applied correctly - this will then rate to your desired rate and stop your errors. (tail your rate-o-mat.log and cdr.log to look for errors)
3. make sure you have an NCOS group setup, in your case, it sounds like a white list, then the allowed call types you wish to allow for your subscribers and apply at the level you wish to enforce to.

We use NCOS in two ways;

1. Blacklist with International prefixes to prevent some toll fraud.
2. Whitelist to only allow local prefixed in Australia

By default, we use option 1 at the domain level. This allows users to call everywhere except to prefixes on the blacklist.
Where customers do not want ANY international, then we apply option 2 at the subscriber level and this overrides the blacklist.

Hope this helps clear your confusion and gives you some further guidance :)



Greg Lipschitz | Director | The Summit Group

E: Greg at thesummitgroup.com.au<mailto:Greg at thesummitgroup.com.au> | W: www.thesummitgroup.com.au<http://www.thesummitgroup.com.au>

The Summit Group (Australia) Pty Ltd | P: 1300 049 749 | Level 1, 39 Railway Road, Blackburn  VIC  3130
The Summit Group (USA) LLC | P: 321 216 3844 | Suite 1003, 364E Main Street, Middletown  DE 19709
Postal:      P.O. Box 3225, Doncaster East  VIC  3109

Follow us on Facebook<http://www.facebook.com/thesummitgroup/> | LinkedIn<http://www.linkedin.com/company/1942329> | Twitter<http://twitter.com/summitgroupau/>

From: Spce-user [spce-user-bounces at lists.sipwise.com] on behalf of Alessandro Bolletta [alessandro at mediaspot.net]
Sent: Wednesday, 9 September 2015 9:26 PM
To: spce-user
Subject: [Spce-user] Peer rules

I’m encountering this problem: there are calls which pass through Sipwise but these shouldn’t pass at all.

It’s happening that these calls block continously rate-o-mat, since there’s no billing fees for them.

So now I have one Peer rule for every Peer group, which is empty and allows every type of call.

Since I want to allow only calls directed to international numbers (00 or + followed by country code), local calls (starting with 0 and followed by one number from 1 to 9), mobile calls (starting with 3), emergency calls and Special Services numbers, in order to avoid not permitted calls passing through, how could I generate a rule which denies calls which doesn’t match these patterns?

Alessandro Bolletta

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sipwise.com/pipermail/spce-user_lists.sipwise.com/attachments/20150909/0e013936/attachment-0001.html>

More information about the Spce-user mailing list