SARK V4.0.0 RouteIn
The routing of inbound calls falls into one of two categories; you can route by the Dialled Number or DiD (DDI in UK) or you can route by Caller ID (CLID). In either case you can create a number class to handle a whole group of DiDs or CLIDs.
Adding a DiD Trunk
Digital (ISDN) and VoIP (SIP/IAX2) inbound calls are usually routed by testing the 'Dialed Number ID' (DNID). To confuse matters further; in digital systems these numbers are often allocated in blocks by the telephone company and known as DiD numbers (Direct Inward Dial) or DDI numbers (Direct Dial In). SARK has a special trunk construct to manage and route these numbers. It is called a DiD trunk and you can define a set of one or more contiguous numbers using this trunk type. Let’s add an example DiD group with the range 616600 to 616604. Click the "new" button on the inbound route panel and then choose “DiD” from the drop down.
In the example below we will create a range of DiDs in one transaction. The actual number range is given by the slash (/) after the base number. This tells SARK how many consecutive numbers to provision, in this case 5 (00 thru 04). Click Save to create the trunks. Of course, the set of numbers in your Group can quite legally consist of a single number, in which case you would not specify a slash. Once our DiD trunks have been created, we can route them to their destinations by clicking the blue open/closed drop downs for each one.
You may also have noticed that SARK has a flag called “smartlink” which you can set on when you create a DiD group. This is useful when you first create a set of extensions and then create your DiD trunks later. Smartlink will match the numbers of each extension to the right hand side numbers in the DiD group. For example, if you had an extension range of 400 to 420 and a DiD range of 668400 to 668420 then SARK will automagically route inbound calls on 668400 to extension 400; calls on 668401 to 401 and so on. This can save a lot of work when there are lots of extensions to be routed during system setup.
Adding a DiD Class
Sometimes, it is useful to handle a whole class of inbound DiDs. This is quite a common case if you are installing SARK as a gateway to a downstream legacy PBX. You may wish to simply hand off anything that arrives on the PRI circuit to the legacy hardware (perhaps recording the calls at the same time). To create a DiD class is trivial in SARK. Click the "new" button on the inbound route panel and then choose “DiD” from the drop down. Name your DiD and then define the class using a regular Asterisk dialplan. In the example below we want to route any inbound 6-digit DiD (6 digits is the default number of presentation digits from a PRI in the UK). However, this could be any valid Asterisk dialplan pattern. The key is to begin the pattern with an underscore (_).
Now save your new DID and then you can route calls by double-clicking on the open and closed route entries (which are shown in blue in the browser). In the example, we have chosen to route calls in this class to another SARK PBX called "cloud1". The actual trunk we are sending the calls out over is an InterSARK IAX trunk called "cloud1sark4".