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.

Solved 3CX v15.5 Linux - new Outbound rule with 'Calls to numbers starting with prefix' not working

Discussion in '3CX Phone System - General' started by ANJOTI, Apr 12, 2018.

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

    Joined:
    Mar 16, 2018
    Messages:
    58
    Likes Received:
    0
    Hi,

    we have 02 SIP Trunk set up, we create an specific rule to number starting with prefix '+5541.....' route is to SIPTrunk-B - even put it on top, all outbound calls keep going to SIPTrunk-A...
    Both rules are using the option 'Extension Group' from 'GroupCompany'. Maybe the combination of parameters like 'Extension Group' + 'Calls to numbers starting with prefix' cannot be handled correct.

    Our understand was that the order to check outbound rules was 'top>down' but is not working, so we already tried to move the new one down but no sucess...

    >>> Did I forget something????

    *** Another idea, 3CX team should be create a view of current calls from 'SIP Trunk' page for monitor purposes. Looking information at ActivityLOG is unproductive.


    upload_2018-4-12_12-44-27.png
     
  2. leejor

    leejor Well-Known Member

    Joined:
    Jan 22, 2008
    Messages:
    11,129
    Likes Received:
    330
    #2 leejor, Apr 12, 2018
    Last edited: Apr 13, 2018
  3. craigreilly

    craigreilly Well-Known Member

    Joined:
    Feb 1, 2012
    Messages:
    3,575
    Likes Received:
    305
    definitely put it at the top.
    remove the group for testing. even make it from the extension you are testing from.
    check the logs for response on why it doesn't match rule 1.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. ANJOTI

    Joined:
    Mar 16, 2018
    Messages:
    58
    Likes Received:
    0
    - The new rule named 'Rule1' is on the top, and its details is:
    - works for 'from extension' 91001 (instead from group);
    - route to SIPTrunk-B;
    - strip 3 digits (remove +55);
    - prepend '0' before dial.​


    But it keeps going to SIPTrunk-A as the Activity log:
    #############
    04/12/2018 2:32:53 PM - Call(C:15): Call from Extn:91001 to +5541xxxxxxxx matches outbound rule 'Rule0'
    04/12/2018 2:32:53 PM - [Flow] Call(C:15): has built target endpoint: Out#:>>Rule{Rule0}>>41xxxxxxxx for call from L:15.1[Extn:91001]
    04/12/2018 2:32:53 PM - [Flow] Target endpoint for +5541xxxxxxxx is Out#:>>Rule{Rule0}>>41xxxxxxxx
    04/12/2018 2:32:53 PM - Looking for outbound rule: dialed = [+5541xxxxxxxx], processed: [4130251000]; from-ext:
    04/12/2018 2:32:53 PM - [Flow] Building target endpoint to +5541xxxxxxxx from "Renato Pereira" <sip:91001@x.y.com:5060>
     
  5. craigreilly

    craigreilly Well-Known Member

    Joined:
    Feb 1, 2012
    Messages:
    3,575
    Likes Received:
    305
    So is it the Prepend 0? The trunk it works on does not seem to need a Prepend of 0.

    I do not have any experience with your providers, just trying to find any hints.

    As an alternative, add the other trunk as the secondary route to the failing rule to see if it works or not.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. ANJOTI

    Joined:
    Mar 16, 2018
    Messages:
    58
    Likes Received:
    0
    Just to clarify:
    - the SIPTrunk-A uses e164 format (+[country id]+[local id]+[number itself]);
    - the SIPTrunk-B uses just '0'+[local id]+[number itself];
     
  7. craigreilly

    craigreilly Well-Known Member

    Joined:
    Feb 1, 2012
    Messages:
    3,575
    Likes Received:
    305
    Can you try to do a sample rule, any thing starting with 0 from your extension...
    There has to be something in what the provider is expecting that they are not getting...

    But maybe its caller id issue?

    Do a wireshark/packet capture and see if it tries to make a call and it gets rejected?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. YiannisH_3CX

    YiannisH_3CX Support Team
    Staff Member 3CX Support

    Joined:
    May 10, 2016
    Messages:
    7,452
    Likes Received:
    541
    I believe that E164 is changing the number before it reaches your outbound rules. Send us a screenshot from your outbound rules settings so we can be sure and at the same time add an outbound rule with "Calls starting with prefix" 0055 strip 4 and add 0 and see if that works
     
  9. ANJOTI

    Joined:
    Mar 16, 2018
    Messages:
    58
    Likes Received:
    0
    It´s anoying, keeps going throught wrong SipTrunk

    ----
    Code:
    05/10/2018 6:41:04 PM - L:21.2[Line:10000>>+554130xxxx00] got Terminated Send Req BYE from 0.0.0.0:0 tid=a5af7e121f1cc852 Call-ID=HJN4lPxZp6J8i8WbmvlRaA..:
    BYE sip:+554130xxxx00@xxxxxxxxxxxxx:5060 SIP/2.0
    Via: SIP/2.0/ ;branch=z9hG4bK-524287-1---a5af7e121f1cc852;rport
    Max-Forwards: 70
    Contact: <sip:user@xxxxxxxx:5060>
    To: <sip:+554130xxxx00@xxxxxxxxxxx:5060>;tag=1812115959
    From: "+55 51 4063-xxxx"<sip:user@xxxxxxxxx:5060>;tag=5d186c2a
    Call-ID: HJN4lPxZp6J8i8WbmvlRaA..
    CSeq: 3 BYE
    User-Agent: 3CXPhoneSystem 15.5.10244.4 (10244)
    Content-Length: 0
    ---

    upload_2018-5-10_18-48-7.png
     
  10. ANJOTI

    Joined:
    Mar 16, 2018
    Messages:
    58
    Likes Received:
    0
    Another info from logs showing that it´s going through wrong outbound rule

    Code:
    05/10/2018 6:51:12 PM - Call(C:22): Call from Extn:91001 to +554130xxxxx00 matches outbound rule 'Rule0'
    05/10/2018 6:51:12 PM - [Flow] Call(C:22): has built target endpoint: Out#:>>Rule{Rule0}>>4130xxxxx00 for call from L:22.1[Extn:91001]
    05/10/2018 6:51:12 PM - [Flow] Target endpoint for +554130xxxxx00 is Out#:>>Rule{Rule0}>>4130xxxxx00
    05/10/2018 6:51:12 PM - Looking for outbound rule: dialed = [+554130xxxxx00], processed: [4130xxxxx00]; from-ext: 
    ---
     
  11. ANJOTI

    Joined:
    Mar 16, 2018
    Messages:
    58
    Likes Received:
    0
  12. ANJOTI

    Joined:
    Mar 16, 2018
    Messages:
    58
    Likes Received:
    0
    Even after set the 'Extension Group' parameter, it keeps going through wrong outbound rule ('0' instead '1')...
     
  13. ANJOTI

    Joined:
    Mar 16, 2018
    Messages:
    58
    Likes Received:
    0
    Fixed!!

    After purge logs and dial again to see what happens, search for 'Looking for outbound rule' in the logs and pay attention to 'processed' field/number, for example:

    >>> The outbound rule to be used will be based on the 'processed' field/number.

    Code:
    'Looking for outbound rule: dialed = [+554130xxxx00], processed: [4130xxxx00]
     
  14. YiannisH_3CX

    YiannisH_3CX Support Team
    Staff Member 3CX Support

    Joined:
    May 10, 2016
    Messages:
    7,452
    Likes Received:
    541
    Glad to see has been resolved and thank you for updating the thread with your solution. As mentioned the E164 was processing the number before reaching the outbound parameters.
     
Thread Status:
Not open for further replies.