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.

Outbound Rules with '+' (solved)

Discussion in '3CX Phone System - General' started by Bob Denny, Aug 17, 2010.

Thread Status:
Not open for further replies.
  1. Bob Denny

    Bob Denny New Member

    Joined:
    Feb 21, 2009
    Messages:
    131
    Likes Received:
    2
    [edit: Skip all of this nonsense and go to the last post in this thread :oops:]

    I have two outbound rules for our softphones to do standard dialing:

    for +1 nnn nnn nnnn
    Start with: +1
    Length 12
    Strip: 1
    Add: (nothing)

    For international +xn nnn nnnn..... where 'x' is not 1"
    Start with: +
    Length: (nothing)
    Strip: 1
    Add: 011

    and the rules are in that order (+1 rule first). The second rule works fine. The first never triggers. I've tried several other less obvious combinations for the first rule (strip 2 and add '1'). The VoIP provider (Callcentric) wants 1nnnnnnnnnn for domestic (US etc.) numbers. The +1 rule seems to never be found by 3CX (xxxxxxx is a real number):
    Code:
    16:13:18.828  [CM503020]: Normal call termination. Reason: Not found
    16:13:18.828  [CM503016]: Call(54): Attempt to reach <sip:+12083xxxxxxx@sip.dc3.com> failed. Reason: Not Found
    16:13:18.828  [CM503014]: Call(54): No known route to target: <sip:+12083548278@sip.dc3.com>
    16:13:18.671  [CM503010]: Making route(s) to <sip:+1208xxxxxxx@sip.dc3.com>
    16:13:18.640  [CM505001]: Ext.107: Device info: Device Not Identified: User Agent not matched; Capabilities:[reinvite, replaces, able-no-sdp, recvonly] UserAgent: [CSipSimple] PBX contact: [sip:107@70.167.219.233:5060;transport=TCP]
    16:13:18.609  [CM503001]: Call(54): Incoming call from Ext.107 to <sip:+1208xxxxxxx@sip.dc3.com>
    
    Can anyone think of a reason for this? Again the second rule works fine for international calls, and as you can see from the log snippet above, it is not triggering for the +1 calls.
     
  2. leejor

    leejor Well-Known Member

    Joined:
    Jan 22, 2008
    Messages:
    11,095
    Likes Received:
    327
    Re: Outbound Rules with '+"

    Have you tried putting some numbers in the length for the international calls. If you put in something (13 and/or multiple numbers) then anything at 12 digits should be handled by the "national" rule, 13 digits and up (to whatever you select) should be handled by the "international" rule.
     
  3. Bob Denny

    Bob Denny New Member

    Joined:
    Feb 21, 2009
    Messages:
    131
    Likes Received:
    2
    Re: Outbound Rules with '+"

    Shouldn't the rules be tried in the order listed? Per your suggestion, I am concerned that a non-NANP (international) number with 12 digits will get treated as a NANP number. I'll try it though just as a data point. Meanwhile, I lifted this example of the failure from the 3CXPhoneSystem.trace.log:
    Code:
    18:17:03.625|.\LineMgr.cpp(325)|Trace5||LineMgr::buildTarget:Looking for outbound rule: dialed = [+1434xxxxxxx], processed: [114342862320]; from-ext: 
    18:17:03.625|.\LineMgr.cpp(335)|Trace5||LineMgr::buildTarget:Rule 1+ Domestic Dialing (no translation): mask=1; exts=; prior=1; type=0; from: 100
    18:17:03.625|.\LineMgr.cpp(424)|Trace5||LineMgr::checkRule:Selected prefix: 1
    18:17:03.625|.\LineMgr.cpp(335)|Trace5||LineMgr::buildTarget:Rule 011+ International Dialing (no translation): mask=011; exts=; prior=11; type=0; from: 100
    18:17:03.625|.\LineMgr.cpp(335)|Trace5||LineMgr::buildTarget:Rule Skype to PSTN  (012+cc+): mask=012; exts=; prior=16; type=0; from: 100
    18:17:03.625|.\LineMgr.cpp(335)|Trace5||LineMgr::buildTarget:Rule 998 Dial-Through: mask=998; exts=; prior=21; type=0; from: 100
    18:17:03.625|.\LineMgr.cpp(335)|Trace5||LineMgr::buildTarget:Rule 411 Dialing: mask=411; exts=; prior=26; type=0; from: 100
    18:17:03.625|.\LineMgr.cpp(335)|Trace5||LineMgr::buildTarget:Rule 911 Dialing: mask=911; exts=; prior=31; type=0; from: 100
    18:17:03.625|.\LineMgr.cpp(335)|Trace5||LineMgr::buildTarget:Rule Local 480 Numbers (7-digit dialing): mask=; exts=; prior=36; type=0; from: 100
    18:17:03.625|.\LineMgr.cpp(335)|Trace5||LineMgr::buildTarget:Rule Domestic 10-digit dialing (no 1+): mask=; exts=; prior=56; type=0; from: 100
    18:17:03.625|.\LineMgr.cpp(335)|Trace5||LineMgr::buildTarget:Rule Skype Users (sip:skype-): mask=skype; exts=; prior=61; type=0; from: 100
    18:17:03.625|.\LineMgr.cpp(335)|Trace5||LineMgr::buildTarget:Rule Plus Dialing Domestic: mask=+1; exts=; prior=65; type=0; from: 100
    18:17:03.625|.\LineMgr.cpp(335)|Trace5||LineMgr::buildTarget:Rule Plus Dialing International (must follow Plus Domestic!): mask=+; exts=; prior=70; type=0; from: 100
    18:17:03.625|.\CallCtrl.cpp(391)|Log2||CallCtrl::onSelectRouteReq:[CM503014]: Call(57): No known route to target: <sip:+14342862320@sip.dc3.com>
    
    As you can see, the rules are being invoked in the correct order. My question is "Why does the Plus Dialing Domestic rule not get triggered by a number (+1434xxxxxxx), which clearly has the 'mask' at the beginning?" And all of the other rules do work, even the last one.
     
  4. Bob Denny

    Bob Denny New Member

    Joined:
    Feb 21, 2009
    Messages:
    131
    Likes Received:
    2
    Re: Outbound Rules with '+"

    OK, I completely removed the last rule (+ for international) and it is still failing.
    Code:
    19:37:19.265|.\LineMgr.cpp(325)|Trace5||LineMgr::buildTarget:Looking for outbound rule: dialed = [+12083548278], processed: [112083548278]; from-ext: 
    19:37:19.265|.\LineMgr.cpp(335)|Trace5||LineMgr::buildTarget:Rule 1+ Domestic Dialing (no translation): mask=1; exts=; prior=1; type=0; from: 100
    19:37:19.265|.\LineMgr.cpp(424)|Trace5||LineMgr::checkRule:Selected prefix: 1
    19:37:19.265|.\LineMgr.cpp(335)|Trace5||LineMgr::buildTarget:Rule 011+ International Dialing (no translation): mask=011; exts=; prior=11; type=0; from: 100
    19:37:19.265|.\LineMgr.cpp(335)|Trace5||LineMgr::buildTarget:Rule Skype to PSTN  (012+cc+): mask=012; exts=; prior=16; type=0; from: 100
    19:37:19.265|.\LineMgr.cpp(335)|Trace5||LineMgr::buildTarget:Rule 998 Dial-Through: mask=998; exts=; prior=21; type=0; from: 100
    19:37:19.265|.\LineMgr.cpp(335)|Trace5||LineMgr::buildTarget:Rule 411 Dialing: mask=411; exts=; prior=26; type=0; from: 100
    19:37:19.265|.\LineMgr.cpp(335)|Trace5||LineMgr::buildTarget:Rule 911 Dialing: mask=911; exts=; prior=31; type=0; from: 100
    19:37:19.265|.\LineMgr.cpp(335)|Trace5||LineMgr::buildTarget:Rule Local 480 Numbers (7-digit dialing): mask=; exts=; prior=36; type=0; from: 100
    19:37:19.265|.\LineMgr.cpp(335)|Trace5||LineMgr::buildTarget:Rule Domestic 10-digit dialing (no 1+): mask=; exts=; prior=56; type=0; from: 100
    19:37:19.265|.\LineMgr.cpp(335)|Trace5||LineMgr::buildTarget:Rule Skype Users (sip:skype-): mask=skype; exts=; prior=61; type=0; from: 100
    19:37:19.265|.\LineMgr.cpp(335)|Trace5||LineMgr::buildTarget:Rule Plus Dialing Domestic: mask=+1; exts=; prior=65; type=0; from: 100
    19:37:19.265|.\CallCtrl.cpp(391)|Log2||CallCtrl::onSelectRouteReq:[CM503014]: Call(60): No known route to target: <sip:+12083548278@sip.dc3.com>
    
    You can see that the only rule which starts with + is now the +1 rule, now the last rule due to the one I removed. So for whatever reason, a number starting with +1 is not matching the rule starting with +1. Weird.
     
  5. leejor

    leejor Well-Known Member

    Joined:
    Jan 22, 2008
    Messages:
    11,095
    Likes Received:
    327
    Re: Outbound Rules with '+"

    Not sure what is going on. i have never tried using an non numerical characters in the outbound rules table. What is your reason for using the + instead of a numerical prefix? Is the board accessed from a number of different countries?
     
  6. Bob Denny

    Bob Denny New Member

    Joined:
    Feb 21, 2009
    Messages:
    131
    Likes Received:
    2
    Re: Outbound Rules with '+"

    Softphones who store their telephone numbers in international standard E.164 format, e.g., +44 341 4528 2103 (hypothetical U.K. number). Sending a number like that to the switch works with my "interntaional"+ rule. It's nice. No 011 or whatever needed.

    My Android cellphone has all of its numbers formatted E.164 whether domestic or international. I never use the mobile network for international ($$$), instead use CSipSimple or 3CX VoIP for Android. The mobile net happily dials +1 234 567 8901, and I want to be able to have that number usable through the VoIP phone too. 3CX can't find a route without munging the number to remove the '+'. That's the outbound rule I can't get to work.
     
  7. Bob Denny

    Bob Denny New Member

    Joined:
    Feb 21, 2009
    Messages:
    131
    Likes Received:
    2
    Re: Outbound Rules with '+"

    Can someone from 3CX weigh in here? I tried preceding the '+' with a '\' in case it was being used in a regular expression match. It didn't work. What's going on in the internal matching logic? I can't see enough from the trace log.
     
  8. Bob Denny

    Bob Denny New Member

    Joined:
    Feb 21, 2009
    Messages:
    131
    Likes Received:
    2
    Re: Outbound Rules with '+"

    Apparently solved: I noticed this
    Code:
    18:33:33.953|.\LineMgr.cpp(325)|Trace5||LineMgr::buildTarget:Looking for outbound rule: dialed = [+12083548278], processed: [11208xxxxxxx]; from-ext: 
    
    Seeing dialed = [+1208xxxxxxx] and processed: [11208xxxxxxx] it occurred to me that 3CX is converting "+1" to "11" before trying to match a rule. I changed the rule:

    for +1 nnn nnn nnnn
    Start with: 11
    Length 12
    Strip: 1
    Add: (nothing)

    and it matched and worked. Dialing +1 xxx xxx xxxx against this new form of the rule worked.

    Then I tried one of my international numbers:
    Code:
    19:04:47.609|.\LineMgr.cpp(325)|Trace5||LineMgr::buildTarget:Looking for outbound rule: dialed = [+44xxxxxxxxx], processed: [01144xxxxxxxxx]; from-ext: 
    19:04:47.609|.\LineMgr.cpp(335)|Trace5||LineMgr::buildTarget:Rule 1+ Domestic Dialing (no translation): mask=1; exts=; prior=1; type=0; from: 107
    19:04:47.609|.\LineMgr.cpp(335)|Trace5||LineMgr::buildTarget:Rule 011+ International Dialing (no translation): mask=011; exts=; prior=11; type=0; from: 107
    19:04:47.609|.\LineMgr.cpp(424)|Trace5||LineMgr::checkRule:Selected prefix: 011
    
    Amazing! In this case, before even looking at any rule, 3CX translated +44 to 01144 (see dialed = and processed: in the first line of the above log snippet). Then it matched my 011+ rule and dialed. So all along my '+' rule was never even being used. It's gone now.

    Edit: See my next post... geeze...
     
  9. Bob Denny

    Bob Denny New Member

    Joined:
    Feb 21, 2009
    Messages:
    131
    Likes Received:
    2
    Re: Outbound Rules with '+"

    OK, I'm embarassed. In 3CX settings, advanced, Advanced tab, see the E.164 Number Processing! That's what the difference between 'dialed' and 'processed' is. The rules in that e.164 area are what are applied to the dialed number to get the processed number.

    For the US, and a provider (Callcentric) that requires a full 1nnnnnnnnnn for domestic and 011ccnnnnnn for international, set up the E.164 number processing like this:


    With this setup, e.164 numbers dial perfectly with no rules needed!
     
  10. diditbetter

    Joined:
    Sep 3, 2015
    Messages:
    4
    Likes Received:
    0
    Grrr same issues and seems none of the images on this forum work. Thanks..
     
  11. MrKoen

    Joined:
    Jul 3, 2009
    Messages:
    61
    Likes Received:
    0
    I ran into the same issue with using the 3CX Phone app on my Android and found this blogpost. As the image is missing from the post above, it wasn't clear to me where to change what. Also the 3CX UI has changed by now. To update this thread with the correct steps to take:

    1. Go to the web interface of your 3CX PBX installation (so not on the 3CX Phone app on Android)
    2. Expand the Settings node
    3. Click on PBX
    4. Go to the E164 tab at the top

    What fixed it for me is to leave "Enable E164 Numer Processing" checked, select your country, enter the international dialing code (00 for most of Europe), and make sure the other fields are left empty and the other checkboxes unchecked. For me it was fixed by simply unchecking the box for "Remove if same Country".

    Hope this helps others to find this option as well.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  12. Oogaboo

    Joined:
    Jan 2, 2017
    Messages:
    5
    Likes Received:
    0
    I'm still struggling with this problem.
    Using 3CX v15 on Linux.

    - e164 processing enabled, country Australia set
    - international dialing code set to 0011
    - tried with 'remove if from same country' enabled and disabled

    Making calls from softphone on OSX and iOs.
    Numbers are in international format, tried directly from contact and manually entering the numbers.

    When calling an Australian number as +61390xxxxxx call works fine. 3CX strips the '+' and processes call normally.
    If calling an international number however, eg in Belgium as +322xxxxxx the call is not processed.

    When I check the log, the number appears in the log with the '+', while the Australian number has the '+' stripped.
    Everything else like a 9322xxxxxxx with an outbound rule to strip the 9 and prepend 0011 is working fine though.

    What am I missing?
    Why is 3CX not removing the + when it's another country code than the home country? Did I miss a setting somewhere?
     
Thread Status:
Not open for further replies.