• Welcome to SAIL Community Supported PBX . Please login or sign up.
 

Outbound Transformation masks

Started by apmuthu, April 22, 2016, 12:32:30 PM

Previous topic - Next topic

apmuthu

April 22, 2016, 12:32:30 PM Last Edit: April 22, 2016, 05:59:17 PM by apmuthu
There are 2 service providers who expect us to send them calls differently:

Provider 1:
Local Calls - [36-9]XXXXXXX
International Calls - 0ZXXXXXXXXX.
Current Mask: :0 065:

Provider 2:
Local Calls - 65[36-9]XXXXXXX
International Calls - ZXXXXXXXXX.
Current Mask: None

We need to give internal users the ability to call:
Local Calls - [36-9]XXXXXXX (Like Provider 1) - Currently 65[36-9]XXXXXXX is used
International Calls - ZXXXXXXXXX. (Like Provider 2)

What recommended masks are needed in the

  • Trunk's Transformation Mask
  • Outbound Routing DialPlan


sysadmin

    There are a few of tools at your disposal for handling these issues.   You'll need to decide which is best for your situation.   You can use either

    *Transformation masks
    *Custom routes
    *Tenant dialplan/area code

    Transformation masks you already are familiar with.   Masks are great at pattern match/replace but they have no concept of number length so if that is an issue then you will need to resort to custom route(s), except for one general use case (see below). 

    The way SARK/SAIL manages routes is to generate them as a list in the relevant context.   Here is an example


[qrxvtmny]
        include => internal-presets
        include => extensions
        include => utilities
        exten => _XXXXX.,1,agi(sarkhpe,OutRoute,DEFAULT,,)
        exten => _00XXX.,1,agi(sarkhpe,OutRoute,Internat,,)



By creating a custom App we can add our own route dialplans which may be more interesting.  Custom Apps with a span of internal are included into the outbound context so they can operate as routes if you wish.   Let's imagine we want to catch 6 digit numbers beginning with a 3,  prepend a 4 digit prefix of 01484 to them and then recursively hand the new number back to the router for onward dispatch, then we might create an app like this


exten => _3XXXXX,1,GoTo(01484${EXTEN},1)


You can be as imaginative as you like with this because you have the whole Asterisk language at your disposal.

Which brings me to the final transformation option; the areacode and dialplan in the Tenant record.   When you add this any dialled number which matches the dialplan will have the area code prepended automagically by the router.   This is very useful to allow users to dial local short numbers but have them auto-prepended for carriage over SIP.

Hope this helps


 

     


apmuthu

Thanks. It certainly helps.

We currently have either CLID or DiD based inward routing.
Inclusion of a new CLID+DiD based inward routing would be welcome.