Setting up CLIP switching

From sailpbx
Jump to: navigation, search


SARK can switch on a given CLI or on a CLI class (for example all calls from a particular area code).

There are two steps to setting up the switching rule. First of all you have to turn on CLI checking in the inbound trunk or DDI/DiD. Next you create a special trunk object with a type of PTT_CLID or PTT_CLID_Class and a key that matches the CLI you intend to switch. What happens is that the SARKHPE routing code checks each CLI on an enabled trunk to see if it matches any PTT_CLID or PTT_CLID_Class entries in the database. If it does it replaces the original DNID with the CLID and recursively calls itself. This allows it to process the CLID through the same routing mechanism it uses to process regular calls. Here is an example.

Our inbound trunk has a DDI of 01924918076. We want to catch calls from 01443219078 and do something with them. In the example we will simply issue a hangup, effectively barring calls from this number but using this same technique we could switch them to any end-point in the SARK system just as we do with regular inbound calls. To begin we will edit the trunk and turn on CLI processing by setting "Switch-on-CLIP" to YES.


Next we will set up a new trunk object with a type of PTT_CLID and a key matching the CLI we want to switch.


Now we can edit it in the normal way to route the call. In this example we will just set the inbound routing to Hangup:Hangup


Now this has been created, calls from 01443219078 will be detected, routed through the CLID trunk object and hung up. All other calls will simply be switched through the original trunk in the normal way. Of course, once you have turned on CLI processing for a particular trunk you can create as many PTT_CLID and PTT_CLID_Class trunks as you like. Also, because you turn on CLI detection at the trunk/DDI level you can have some trunks which respond to a CLI switch and others which don't.