Why my 3CX outgoing call port does not match gateway port?

Discussion in '3CX Phone System - General' started by hetote, Mar 3, 2011.

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

    Joined:
    Mar 3, 2011
    Messages:
    3
    Likes Received:
    0
    Why my 3CX outgoing call port does not match gateway port?

    I'm using latest 3CX version and Grandstream GXW4108 FXO with the same firmware described in tutorials.

    When making calls with 3CX, the ports/trunks status shows:
    Status: Connected
    Virtual Ext. # 10002

    While in gateway status page, I see:
    Line 4: busy, PSTN Outgoing (dialed#): 1111111111

    Shouldn't be virtual ext 10002 -> Line/channel 2 instead of line 4 ???

    In GrandStream channel settings:
    Channel 2: SIP User ID: 10002, Authenticate ID 10002
    ...
    Channel 4: SIP User ID: 10004, Authenticate ID 10004

    All trunks are idle, so there is no reason to round-robin in GrandStream, right?

    Incoming calls connects the trunk with it's repective virtual extension.

    Thanks for any help!
     
  2. leejor

    leejor Well-Known Member

    Joined:
    Jan 22, 2008
    Messages:
    10,582
    Likes Received:
    249
    Re: Why my 3CX outgoing call port does not match gateway por

    Can you post a 3CX log showing an example of the issue?
     
  3. abc123

    abc123 Active Member

    Joined:
    Nov 9, 2009
    Messages:
    712
    Likes Received:
    1
    Re: Why my 3CX outgoing call port does not match gateway por

    I thought that on outgoing calls the Grandstream chose the outbound trunk unless you put a dial code in there.

    eg. if you say the 2 prefix will go out through line 2 then you dial 2 and the number on your phone, 3cx routes (including the prefix) the number to the grandstream and then the grandstream sees the 2, matches it with an outbound route/line and strips the prefix and makes the call.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. hetote

    Joined:
    Mar 3, 2011
    Messages:
    3
    Likes Received:
    0
    Re: Why my 3CX outgoing call port does not match gateway por

    Hi leejor,

    I will search for that logfile because I never needed to read it.

    Hi Abc123,

    I didn't know about that, but this sounds strange since 3CX trunk status does not signal the correct port in use by GrandStream, as it does when receiving a call. Another problem of this behavior is that the "use this trunk for outgoing calls" flag in 3CX trunk configuration is made completly useless...

    Well, this does not make sense to me.

    Thanks!
     
  5. SY

    SY Well-Known Member
    3CX Support

    Joined:
    Jan 26, 2007
    Messages:
    1,825
    Likes Received:
    2
    Re: Why my 3CX outgoing call port does not match gateway por

    Management console has "Server Activity Log" page...
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. abc123

    abc123 Active Member

    Joined:
    Nov 9, 2009
    Messages:
    712
    Likes Received:
    1
    Re: Why my 3CX outgoing call port does not match gateway por

    It only doesnt make sense because you dont fully understand how it works (not that you are expected to unless you need something as you are trying to do now). Out of the box it works (makes calls in and out).

    The Grandstream has only 1 lan connection and only one ip on it. So it registers with 3cx and basically says "all our ports are on ip xxx.xxx.xxx.xxx but my line1 is on port1 (e.g 34566) my line2 is on port2 (e.g. 34567) etc. So when 3cx receives something from xxx.xxx.xxx.xxx:34567 it knows it came from line 2 and can route it based on that.

    But your outgoing rules say... send to Grandstream and any port on xxx.xxx.xxx.xxx that is unless i am wrong and you have it set to grandstream line1, grandstream line2 etc. (I dont have one handy to know)

    You tell 3cx to "use this trunk for outgoing calls" means it is in the list it can choose from, but you still have no control.

    The way to control it is to set up an inbound rule in the grandstream with a prefix. You can say if did starts with 091 then use line1, if the prefix is 092 then use channel 2.

    Then you set up an outbound rule in 3cx that says if from this extension (or if dialing to this number, or whatever rule you want) then go out through grandstream and prefix the number with 091 (then have a backup rule in case this is busy).

    Do one for each line in the grandstream and you are in control as you want.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. hetote

    Joined:
    Mar 3, 2011
    Messages:
    3
    Likes Received:
    0
    Re: Why my 3CX outgoing call port does not match gateway por

    Mark,
    thanks for your help. I'm really newbie to all of this and trying to figure it out. Here is the log for a call that 3CX tried to send to GrandStream id 10002 in specific port 5062 (bold red lines), but it ended in line 4 (GrandStream status below).

    Line 4: busy, PSTN Outgoing (dialed#): 80223338

    3CX Log:

    Code:
    16:18:03.633  [CM503007]: Call(3): Device joined: sip:10002@10.20.19.99:5062;transport=udp
    
    16:18:03.633  [CM503007]: Call(3): Device joined: sip:109@10.20.19.31:51455;rinstance=17b736fd322698d1
    
    16:18:03.633  [CM505002]: Gateway:[TroncosEmbratel] Device info: Device Not Identified: User Agent not matched; Capabilities:[reinvite, replaces, able-no-sdp, recvonly] UserAgent: [Grandstream GXW4108 (HW 1.1, Ch:9) 1.3.1.6] PBX contact: [sip:10002@10.20.19.98:5060]
    
    [color=#BF0000][b]16:18:03.633  [CM503002]: Call(3): Alerting sip:10002@10.20.19.99:5062;transport=udp
    
    16:18:01.055  [CM503025]: Call(3): Calling PSTNline:80223338@(Ln.10002@TroncosEmbratel)@[Dev:sip:10002@10.20.19.99:5062;transport=udp][/b][/color]
    
    16:18:00.992  [CM503004]: Call(3): Route 1: PSTNline:80223338@(Ln.10002@TroncosEmbratel)@[Dev:sip:10002@10.20.19.99:5062;transport=udp,Dev:sip:10003@10.20.19.99:5064;transport=udp,Dev:sip:10001@10.20.19.99:5060;transport=udp,Dev:sip:10004@10.20.19.99:5066;transport=udp]
    
    16:18:00.992  [CM503010]: Making route(s) to <sip:80223338@10.20.19.98:5060>
    
    16:18:00.992  [CM505001]: Ext.109: Device info: Device Not Identified: User Agent not matched; Capabilities:[reinvite, replaces, able-no-sdp, recvonly] UserAgent: [3CXPhone 5.0.14900.0] PBX contact: [sip:109@10.20.19.98:5060]
    
    16:18:00.977  [CM503001]: Call(3): Incoming call from Ext.109 to <sip:80223338@10.20.19.98:5060>
     
  8. abc123

    abc123 Active Member

    Joined:
    Nov 9, 2009
    Messages:
    712
    Likes Received:
    1
    Re: Why my 3CX outgoing call port does not match gateway por

    I appreciate you are new (which is why you and I are here - you to ask and me to try to help :))

    I need to explain the grandstream and outbound rules in 3cx.

    grandstream has two modes - round robin or specific port. Default is round robin. This usually means that if you send out via the grandstream it will pick a free port to use (round robin).

    You also told it via 3cx how many active ports you had to make outgoing calls on.

    You will also see on the Channels page on the Grandstream right at the bottom the Prefix to specify a port (default is 99). So if you wanted to keep the default and you want to go out through port 2 you would prefix the number you send to the grandstream by 992 (993 for port3 etc.).

    You do this in the 3cx outbound rules.

    Somewhere in 3cx you set a rule which said either from your extn 109 or to go to 80223338 (or a default rule for all) to go out via the grandstream (and possibly 1002). So you need to edit that rule and say prepend 992 (make sure strip digits is zero).

    whatever rule you have now just do the prepend of 992 and you will see my point.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. jbowlby

    Joined:
    Apr 6, 2012
    Messages:
    5
    Likes Received:
    0
    Re: Why my 3CX outgoing call port does not match gateway por

    This post was really helpful to me. Question though,

    I have an 8 line gateway device (Grandstream PSTN adapter). I have:
    (4) lines for company A
    (2) lines for company B
    (2) lines for company C

    I setup routing to prepend 991, 992, 993 codes (Route 1, Route 2, Route 3) for Company A's lines (attached to lines 1-4 on the gateway device) Does that mean that I can't get calls to go out on that fourth line because there's only 3 backup routes?

    If so is there a work around? Besides buying another PSTN gateway?
     
  10. craigreilly

    craigreilly Well-Known Member

    Joined:
    Feb 1, 2012
    Messages:
    3,116
    Likes Received:
    204
    Re: Why my 3CX outgoing call port does not match gateway por

    4 lines are all 1 gateway, correct. Or does each line get registred separately as an individual gateway?
    We have an T1 circuit here, so not too familiar how the setup works for that device.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  11. leejor

    leejor Well-Known Member

    Joined:
    Jan 22, 2008
    Messages:
    10,582
    Likes Received:
    249
    Re: Why my 3CX outgoing call port does not match gateway por

    You appear to be using the gateway for something it really wasn't designed for (that and the limitation of additional routes in 3CX). Unless someone, more familiar with the Grandsteam has some suggestions, you may want to consider adding an additional 4 port gateway. That one could be set-up in round-robin mode.

    Depending on your outside calling patterns... you might split outside calls for the customer with four lines. For example, if you lived in an area with more than one area code, and calls were pretty evenly split between the two (or more), you could set up one outbound rule for one area code as trunks 1,2,3, the other area code could go to trunks 4,3,2.

    You could base the split on local or long distance, or even local prefixes.
     
  12. lneblett

    lneblett Well-Known Member

    Joined:
    Sep 7, 2010
    Messages:
    2,064
    Likes Received:
    58
    Re: Why my 3CX outgoing call port does not match gateway por

    Actually, you can split the gateway, but it is not pretty. You start by creating one gateway with 4 ports., then another with 2 ports and the final with 2 ports. They all use the same IP, but different names. This allows for the ports associated to each compny to be directed on the inbound side to the DR or extension need for same. You then should have the extensions segregated for ease of identification and outbound routing. Company 1 might have extensions 100-200, company 2 from 300-500 and company 3 form 500-700. You can direct the outbound by extension and further can prepend the dialed string for company 2 with 995 the secondary route with 996. Company 3 is set to the 3rd gateway and again dialed strings are prepended with 997 with a second route with 998.

    The 99 is an indication to the gxw that a specific physical port is to be used and the number 5,6,7 or 8 indicates which specific port. I am doing this with 2 companies and I see no reason 3 cannot be accommodated. There are some settings that still need to be done within the gxw, but these should be fairly easy to implement as long as you keep the logic in mind.
     
Thread Status:
Not open for further replies.