Sunday, 12 August 2007

Low Cost Calling Rules Engine

Within the low cost calling extension the rules engine carries out the work of translating from the outgoing number (the number selected by the user to dial) to the dialling number (the number actually dialled by the 'phone). It does this in two stages:


  1. Select which of a number of potential dial chains to use

  2. Iterate over a given dial chain to generate the dialling number


At the first stage the rules engine looks at the prefix of each dial chain in order and compares it to the outgoing number (it will use the first matching dial chain that it finds in the list, so ordering of the dial chains will be important). Once it has a suitable dial chain then it will process each entry in the dial chain to ensure that. Also, there is an implicit last dial chain at the end of each list that has no prefix and just returns the outgoing number. This ensures that all numbers will be dialed even if there is no rule to allow low-cost dialing.


A dial chain consists of a number of dial pieces, each of which contains a simple rule to generate a piece of the final number to be dialed (hence the name). A dial piece may provide one of the following:


  • A user-entered number

  • The outgoing number

  • A pause

  • The hash/pound key

  • Hang up/li>

All of this is pretty straightforward, with a couple of exceptions. First is that the outgoing number may require some translation as it may use an incorrect prefix for international dialling (although this only matters when in a different country from your 'home' country). Second is that there appears to be no standard way of indicating that the line is to be hung up.

Between this and the process flow there should be a rough framework for building the extension. Next step: build it!

0 comments: