Dismiss Notice
We would like to remind you that we’re updating our login process for all 3CX forums whereby you will be able to login with the same credentials you use for the Partner or Customer Portal. Click here to read more.

Catch-all outbound rule not working

Discussion in '3CX Phone System - General' started by mcbsys, Sep 7, 2010.

Thread Status:
Not open for further replies.
  1. mcbsys

    mcbsys New Member

    Joined:
    Oct 8, 2008
    Messages:
    191
    Likes Received:
    17
    Hi,

    I'm running 3CX v9.0.13545.594 SP.1.

    I have basically two "lines," a business and a personal. Extensions 10, 11, and 50 should dial out on the business line; everything else should dial out on the personal. The personal line uses an analog ATA for the PSTN line. I'm in the U.S.

    U.S. numbers outside my area code must be dialed as 1+ area code + number. For this I set up a rule to catch 10-digit numbers and prepend a 1.

    Numbers in my area code must be dialed as 7 digits. For this I set up a rule to trap 7 digit numbers and pass them through.

    All other numbers (e.g. 11-digit numbers that already include the leading 1+, or international numbers) should just pass through. For this I set up an "empty" or "catch-all" rule last.

    Here's the full list of rules:


    The problem is, when I dial an 11-digit number from personal extension 20, it says "no known route to target":

    Code:
    16:29:24.895  [CM503020]: Normal call termination. Reason: Not found
    16:29:24.895  [CM503016]: Call(85): Attempt to reach <sip:18007267864@192.168.1.140;user=phone> failed. Reason: Not Found
    16:29:24.895  [CM503014]: Call(85): No known route to target: <sip:18007267864@192.168.1.140;user=phone>
    16:29:24.879  [CM503010]: Making route(s) to <sip:18007267864@192.168.1.140;user=phone>
    16:29:24.879  [CM505001]: Ext.20: Device info: Device Identified: [Man: Polycom;Mod: SoundPoint IP Series;Rev: General] Capabilities:[reinvite, replaces, unable-no-sdp, no-recvonly] UserAgent: [PolycomSoundPointIP-SPIP_430-UA/3.2.2.0477] PBX contact: [sip:20@192.168.1.140:5060]
    16:29:24.863  [CM503001]: Call(85): Incoming call from Ext.20 to <sip:18007267864@192.168.1.140;user=phone>
    
    What am I missing here? Why doesn't it route the 11-digit number through the last rule?

    Thanks,

    Mark
     

    Attached Files:

    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. leejor

    leejor Well-Known Member

    Joined:
    Jan 22, 2008
    Messages:
    11,119
    Likes Received:
    330
    Catch-all solutions can have problems. You are best specify which rules apply to which extensions in ALL cases, not just for the business extensions. Don't just hope for the best when you haven't specifically told 3CX what to do with a call that doesn't fit the other rules. You could set up a rule for your local area code(s) as 7 digit numbers. Rule 213(an example of an area code), 7 digits, applies to 10,11.50, goes out on one route. A second rule would be the same but include the personal extensions and go out on the personal route.

    You should include a route for 1+ numbers (11 digits) or 011 (international numbers) with a variable number of digits. I'm surprised that you have people dialling long distance without having to actually dial the 1 first, as most people are used to (conditioned to) dialling this way from home. This is especially true when you aren't using a PBX that requires users to dial a 9 first.
     
  3. mcbsys

    mcbsys New Member

    Joined:
    Oct 8, 2008
    Messages:
    191
    Likes Received:
    17
    Thanks, leejor.

    You're right, adding the personal extension to the last three rules allowed it to pick up the outbound 11-digit number.

    With that tip, I think I understand outbound rules better. As a programmer, I always think in terms of IF - THEN - ELSE, and you always make sure the ELSE is covered. It seems that 3CX outbound rules operate as IF - THEN only. A call must explicitly match either Call from Extension, Number Prefix, or Number Length, or it isn't routed. Setting all three to blank effectively disables the rule. So to set up a catch-all, you actually have to specify all Extensions or all Number Lengths. To test this, I just added Number Length 1-20 to my last rule. That works too:


    When I started with VoIP almost two years ago, I set up my Asterisk rules to allow 10- or 11-digit long-distance dialing. I find that I usually just dial 10 digits, but my CRM still prepends a 1 so I need to handle that too.
     

    Attached Files:

    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. leejor

    leejor Well-Known Member

    Joined:
    Jan 22, 2008
    Messages:
    11,119
    Likes Received:
    330
    It hit me, hours after posting, and not near a computer , that you didn't add the area code to local numbers, sorry about that part.
    Glad that you got it working. And yes, perfect analogy, you need to have the ELSE covered.
     
  5. mcbsys

    mcbsys New Member

    Joined:
    Oct 8, 2008
    Messages:
    191
    Likes Received:
    17
    The secondary route for the personal line goes to a VoIP provider. So for the 7-digit rule, the secondary route prepends the local area code.

    The way I see it, there is no ELSE, which is what confused me. I had mistakenly assumed that adding a rule to the end of the list with all conditions empty would work as an "ELSE if none of the above applies, do this." In fact leaving all conditions empty means the rule is never used.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. leejor

    leejor Well-Known Member

    Joined:
    Jan 22, 2008
    Messages:
    11,119
    Likes Received:
    330
    Oh, oh, this is bringing back nightmares of writing DOS Basic programmes...

    Ah, but what will you do when they overlay another areacode in your city? Then you have to get used to dialling 10 digit numbers.
     
  7. mcbsys

    mcbsys New Member

    Joined:
    Oct 8, 2008
    Messages:
    191
    Likes Received:
    17
    As a kid we would visit Buena Vista, Colorado. They used 4-digit dialing and party lines. I'd like to see an ATA set up to handle the emergency cut-in from Mabel down at the next ranch!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Thread Status:
Not open for further replies.