Dial Pattern

Discussion in 'General' started by qbik, Feb 17, 2011.

  1. qbik

    Joined:
    Aug 31, 2010
    Messages:
    34
    Likes Received:
    0
    I am having a bit of trouble setting a dial pattern with my current SIP provider. The provider accepts the call as 011+country code+area code+number

    The call center where the server is (in Mexico) people need to dial 01+area code+number
    and the server needs to remove 01 and add 01152+area code+number
    In my trunk I have the following:
    (01152)+01|01NXXNXXXXXX

    and on the outbound route I have:
    (01152)+01|[01NXXNXXXXXX]

    However I am getting error "Number cannot be dialed"

    How should I format the dial pattern?

    Thanks
     
  2. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
    Just needed on the trunk, from the hover-over help

    Dial Rules

    A Dial Rule controls how calls will be dialed on this trunk. It can be used to add or remove prefixes. Numbers that don't match any patterns defined here will be dialed as-is. Note that a pattern without a + or | (to add or remove a prefix) will not make any changes but will create a match. Only the first matched rule will be executed and the remaining rules will not be acted on.

    Rules:
    X matches any digit from 0-9
    Z matches any digit from 1-9
    N matches any digit from 2-9
    [1237-9] matches any digit or letter in the brackets (in this example, 1,2,3,7,8,9)
    . wildcard, matches one or more characters (not allowed before a | or +)
    | removes a dialing prefix from the number (for example, 613|NXXXXXX would match when some dialed "6135551234" but would only pass "5551234" to the trunk) + adds a dialing prefix from the number (for example, 1613+NXXXXXX would match when some dialed "5551234" and would pass "16135551234" to the trunk)

    You can also use both + and |, for example: 01+0|1ZXXXXXXXXX would match "016065551234" and dial it as "0116065551234" Note that the order does not matter, eg. 0|01+1ZXXXXXXXXX does the same thing.


    so in your case.

    01152+01|NXXNXXXXXX

    don't use ( or ) only use [ and ] if you know why.

    use the ouytbound rioute for just that, usually to limit the numbers that can be dialed
     
  3. qbik

    Joined:
    Aug 31, 2010
    Messages:
    34
    Likes Received:
    0
    Thank you for your response, just two questions:
    -Does 011. needs to be on the outbound route?
    -What do you mean not to use ()?

    so far this is what I have and still not working (011. is still on outbound route)
    [​IMG]


    Thanks again for your help
     
  4. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
    you said your people dial 01+area code+number, THAT is what needs matching in the outbound route.

    how your area codes and number as constructed in your country will allow you to use 01 and then a string of XNZ and perhaps numbers to suit your locale.

    you stated very explicitly that you used:

    .
    .
    (01152)+01|01NXXNXXXXXX

    and on the outbound route I have:
    (01152)+01|[01NXXNXXXXXX]
    .
    .

    these are basically "regular expressions" [01NXXNXXXXXX] is the same as X (just one), you can't use + in an outbound route in FreePBX as offered by Elastix, and (01152) is just not correct.

    for a fuller treatment

    http://www.voip-info.org/wiki/view/Aste ... n+Patterns

    [edit]

    I noticed you updated your FreePBX to 2.8, be aware that this is NOT supported in Elastix, who gave you permission to do that ? :) . Elastix only support their rather aged and forked up version. So disregard the comments about ( and ) they are just window dressing in Freepbx 2.8 and above and not part of the 're-write' you also do have the + available for outbound routes also, but they really belong in the trunk (either one but not both ;) if you get other trunking options they will likely behave differently.

    As a "fix-it", I suggest you remove all Elastix overides in /etc/asterisk/extensions* , NEVER again use the embedded FreePBX in Elastix or risk running code from incompatible libraries and don't rely on the recordings interface in Elastix if you did before (it was pretty broken then, now you really broke it :), if you don't follow this advise, then I suspect "something horrible" might happen to you soon.

    You can no longer rely on a yum update to work anymore unless you ensure that your unsupported FreePBX is not touched.
     

Share This Page