Koozali.org: home of the SME Server

SAIL - route priority

WillKemp

SAIL - route priority
« on: June 22, 2006, 11:45:54 AM »
I want to define two different routes for numbers with the same prefix - one specifying a subset of all possible numbers and the other doing the rest. However, there doesn't appear to be any way to do this with SAIL. The route that does "the rest" does the subset too.

This is something that's reasonably easy to do by editing extensions.conf - requiring the use of contexts and include statements.

Is there a way to do it with SAIL - other than with custom apps?

Offline SARK devs

  • ****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
SAIL - route priority
« Reply #1 on: June 22, 2006, 09:43:37 PM »
Hello Will,

Can you explain in a little more detail what you are trying to do and why.  I'm really not sure I understood the question.  Once I get my little brain around it I'll see if we can't help.

Best

jeff@selintra

WillKemp

SAIL - route priority
« Reply #2 on: June 22, 2006, 11:06:10 PM »
What i want to do is to be able to route calls to the UK and Ireland via Sipgate, calls to the European mainland via Voipgate, and calls to any other international destinations via an Australian ITSP.

The code for international calls in Australia is 0011, so what i need to do is:

_001144. _0011353. to go via Sipgate
_0011352. _001134. _001133. (etc) to go via Voipgate
_0011. to go via Astratel

I.e., check for _0011. after dropping through the other two. Not hard to do in extensions.conf, but it doesn't appear to be possible using routes in SAIL. All calls go via Astratel.

Offline SARK devs

  • ****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
SAIL - route priority
« Reply #3 on: June 24, 2006, 08:51:43 PM »
Hi Will,

You're quite right, there isn't any pretty way to accomplish this with SAIL.  
The only way you can do it at the moment is to prepend those international calls which you want to give to a particular carrier with some digit(s).  Say 8 for  Sipgate.  Create a route which looks for _801144. and  _8011353. series numbers and then remove the 8 in the trunk using the transformation mask.  Not particularly elegant but it may get you some way towards your goal.  I'll have a think about a better way for 2.1.12.

As an aside, when you assert that "drop thru" number evaluation isn't hard to achieve in extensions.conf, can you give an example?  It's not a challenge it's just that I've found it quite hard to accomplish in practice.

Kind Regards

jeff@selintra.com

WillKemp

SAIL - route priority
« Reply #4 on: June 25, 2006, 02:00:31 AM »
Quote from: "selintra"
As an aside, when you assert that "drop thru" number evaluation isn't hard to achieve in extensions.conf, can you give an example?  It's not a challenge it's just that I've found it quite hard to

The way to do it is to put each one in a separate context and then include the contexts in the correct order at the point in extensions.conf where you want to do the evaluation. Asterisk steps through the include statements in the order you place them in extensions.conf - whereas it doesn't necessarily (i.e., probably won't) step through extensions in the same order you put them in in extensions.conf.

E.g., i've got:

Code: [Select]
include => international        ; designated 0011 numbers via overseas ITSPs
include => international-aus    ; other 0011 numbers - via aus ITSP
include => mobile               ; australian mobile numbers
include => national             ; all numbers starting with a '0' that
                                ;  don't match the above

Offline SARK devs

  • ****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
SAIL - route priority
« Reply #5 on: June 25, 2006, 11:33:25 AM »
Thanks for this Will.

I assumed you would have to do it this way.  I didn't particulary want to clutter up our nice clean spartan extensions.conf but I can see no alternative if we are to implement a sorted set of routes, each in an included context.  Not hard to do in the generator but not pretty on the eye.   :roll:


Thanks again Will.

jeff@selintra.com