Call routing logic in Ring Groups

Discussion in '3CX Phone System - General' started by zafeirop, Jul 4, 2012.

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

    Joined:
    Jul 4, 2012
    Messages:
    10
    Likes Received:
    0
    Hi,

    I'm running 3CX Phone System v10.

    I've setup a Ring Group containing a Ringall policy which contains virtual extensions (forwards to mobile numbers).
    Our mobile calls are routed through a Portech MV372 whic works fine.

    In general, if a call fails to be routed through the Portech, a Route2 & Route3 entry is triggered in the Outbound rules in order to route the call properly via alternate gateways.

    However, this is not the case for the Ring Group routing logic.
    When the Ring group is called and the Portech has no ports available to place the outgoing call, the call will fail and NO fallbackup route will be used from the Outbound rules (route2, route3) or the next available matching rule from the Outbound Rules!

    Any hints ?
     
  2. leejor

    leejor Well-Known Member

    Joined:
    Jan 22, 2008
    Messages:
    10,586
    Likes Received:
    252
    My understanding (and I hope I'm corrected if I'm wrong), is that...if a trunk group has idle trunks and accepts a call from 3CX, which then fails, for some reason, the call won't be handed back to 3CX and attempted on another trunk group.

    That said, there may be some gateways capable of sending a SIP message back to 3CX that will accomplish this. I'm not sure.

    I believe that for calls to a second or third trunk group to make use of these, the first group has to have all trunks busy, not be registered, be not available because the PSTN lines are in use, or a PRI is down, but that must be communicated to 3CX so that it knows not to even attempt a call on one of those trunks.
     
  3. zafeirop

    Joined:
    Jul 4, 2012
    Messages:
    10
    Likes Received:
    0
    Hi leejor,
    Thanks for replying.

    Yes, indeed.
    In order for backup trunks (routes) to work, the main trunk has to be unavailable, busy, 503 error etc.

    Our Portech is usually out of lines (503 error or Busy error, it is configurable by the user, how to react in such a case) so the next available route should be used, as defined in route2, and route3 entries in the particular outbound rule.

    But this does not work.
    For every call that we receive in our Ring Groups, only the main (route1) setting is used to route outgoing calls.
    If route1 fails, routing logic stops.

    This is definitely unacceptable!
     
  4. paul.hadley

    paul.hadley New Member

    Joined:
    Aug 24, 2010
    Messages:
    122
    Likes Received:
    0
    I don't have a Portech MV372 Gateway to check but I would be pretty sure it works the same way a SPA3102

    When a call is placed to it it actual answers the sip call and then places the call onto the GSM Network. In that case 3CX does not know what the actual status of the call is, it could be ringing, engaged or answered on the GSM Network side but in the Sip side is connected and answered.

    The caller is connected to to gateway immediately and hears what ever the phone line sends, this through can not be used to control the PBX, only give feed back to the caller through tones etc.

    To make this work the way you want it to you would need a direct sip trunk to a VoiP provider. Then 3CX would be able to see the call had not been answered until it actually was, and if not take the appropriate action to forward the call on.

    Another method might be the following if the Portech supports it. Get the Portech to reject the call and return it to 3CX in the way that Sipbroker Enum does.

    You would do this by having an access code for the first call (say 99). Prefix the mobile numbers you want to call with 99 to use the first rule. In that rule strip out the 99 so the correct number is sent to the Portech. Then when it is returned with the 99 striped a second rule for a standard number call can be used.
     
  5. zafeirop

    Joined:
    Jul 4, 2012
    Messages:
    10
    Likes Received:
    0
    Thank you Paul.
    Nice approach.

    However, the channel of the SIP session is not answered unless the GSM GW has successfully placed a call to the GSM network.
    So, in my case, I always receive the 503 error if something goes wrong, without having to answer the channel first.
    That means that the gateway behaves exactly like your VoIP provider.

    The 503 error code should signal 3CX to do fallback routing (place call via route2, route3)!
    But it does not happen with Ring Group when forwarding calls to external numbers.

    This is my problem.
     
  6. paul.hadley

    paul.hadley New Member

    Joined:
    Aug 24, 2010
    Messages:
    122
    Likes Received:
    0
    So when a call is in progress through the GSM gateway (ie ringing but not answered) does 3cx show the call as ringing or connected, do you see the call flow correctly or does it just go to connected.
     
  7. craigreilly

    craigreilly Well-Known Member

    Joined:
    Feb 1, 2012
    Messages:
    3,129
    Likes Received:
    207
    I found similar with my Patton GW. If extension is set to ring desk and mobile simultaneously, then the Patton takes the call and desk phone doesn't ring.
    if that user is part of a ring grip and has ring mobile simultaneously checked, then the only phone that rings is the users mobile and none of the other phones in ring group.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. zafeirop

    Joined:
    Jul 4, 2012
    Messages:
    10
    Likes Received:
    0
    Guys,
    I'll try to be more explanatory.

    In normal operation, when you place an outgoing call, 3cx applies route logic based on Outbound rules processing each of the routes (route1, route2, route3) in the order of preference.
    This is useful because, if one of the trunks fails, the other next will take over.

    In Ring groups, if an extension is Away and wants to receive calls forwarded to mobile phone, this routing logic is not applied!
    It only accepts as outgoing route, the first matched entry in the first rule of the Outbound rules table.

    Is this normal ?
    I think it is a bug!
     
  9. zafeirop

    Joined:
    Jul 4, 2012
    Messages:
    10
    Likes Received:
    0
    Hi, some detailed logs from the Phine System:

    A normal call (not a Ring Group call) through our GSM gateway, with backup routes would like like this:

    11:34:08.713 [CM503008]: Call(563): Call is terminated
    11:34:03.492 [CM505002]: Gateway:[Portech MV372 GSM GW] Device info: Device Not Identified: User Agent not matched;
    Capabilities:[reinvite, replaces, able-no-sdp, recvonly] UserAgent: [Mv-37x (1008030)] PBX contact:
    [sip:10005@XXX.XXX.XXX.XXX:5060]
    11:34:02.676 [CM503025]: Call(563): Calling PSTNline:6946XXXXXX@(Ln.10005@Portech MV372 GSM GW)@
    [Dev:sip:10005@XXX.XXX.XXX.XXX:5060]
    11:34:02.637 [CM503004]: Call(563): Route 3: VoIPline:6946XXXXXX@(Ln.10004@Provider3)@
    [Dev:sip:XXXXXXXXX@sip.skype.com:5060]
    11:34:02.637 [CM503004]: Call(563): Route 2: VoIPline:6946XXXXXX@(Ln.10003@Provider2)@
    [Dev:sip:302118002255@voip.viva.gr:5060]
    11:34:02.636 [CM503004]: Call(563): Route 1: PSTNline:6946XXXXXX@(Ln.10005@Portech MV372 GSM GW)@
    [Dev:sip:10005@XXX.XXX.XXX.XXX:5060]
    11:34:02.625 [CM503001]: Call(563): Incoming call from Ext.203 to <sip:6946XXXXXX@sip.lancom.gr>

    It is clear defined that there are 3 routes for this number:
    1. Ln.10005@Portech MV372 GSM GW
    2. Ln.10003@Provider2
    3. Ln.10004@Provider3

    If a normal outgoing call fails to reach route1, goes to route2 and then to route3.
    That is fine!


    When a call arrives to Ring Group 809, and tries to reach the same numbers, our logs like this:

    11:41:55.013 [CM503020]: Normal call termination. Reason: Disabled by Forwarding Rule
    11:41:55.013 [CM503016]: Call(565): Attempt to reach <sip:809@sip.xxxxx.xx> failed. Reason: Busy
    11:41:45.934 [CM505002]: Gateway:[Portech MV372 GSM GW] Device info: Device Not Identified: User Agent not matched;
    Capabilities:[reinvite, replaces, able-no-sdp, recvonly] UserAgent: [Mv-37x (1008030)] PBX contact:
    [sip:10005@XXX.XXX.XXX.XXX:5060]
    11:41:45.338 [CM503003]: Call(565): Call to sip:6946xxxxxx@xxx.xxx.xxx.xxx:5060 has failed; Cause: 503 Service
    Unavailable
    ; from IP:xxx.xxx.xxx.xxx:5060
    11:41:45.005 [CM503025]: Call(565): Calling RingAll809[6980XXXXXX@(Ln.10005@Portech MV372 GSM GW),6946xxxxxx@
    (Ln.10005@Portech MV372 GSM GW)]@[Dev:sip:10005@xxx.xxx.xxx.xxx:5060]
    11:41:44.997 [CM503025]: Call(565): Calling RingAll809[6980XXXXXX@(Ln.10005@Portech MV372 GSM GW),6946xxxxxx@
    (Ln.10005@Portech MV372 GSM GW)]@[Dev:sip:10005@xxx.xxx.xxx.xxx:5060]
    11:41:44.959 [CM503004]: Call(565): Route 1: RingAll809[6980XXXXXX@(Ln.10005@Portech MV372 GSM GW),6946xxxxxx@
    (Ln.10005@Portech MV372 GSM GW)]@[Dev:sip:10005@xxx.xxx.xxx.xxx:5060,Dev:sip:10005@xxx.xxx.xxx.xxx:5060]
    11:41:44.944 [CM503001]: Call(565): Incoming call from Ext.203 to <sip:809@sip.xxxxxx.xx>

    Which means that ONLY route1 is been used for call termination.
    Where are the rest of our backup routes ?

    You can see clearly that at line CM503003, call fails due to 503 error (GSM GW has run out of channels at this time).
    The system did not try to reach backup routes as it did in a normal call to the same number

    I think that the routing logic is not accurate at this point.

    Hope that a software engineer from 3CX will response to this ticket. :(
    Thank you.
     
  10. lneblett

    lneblett Well-Known Member

    Joined:
    Sep 7, 2010
    Messages:
    2,064
    Likes Received:
    58
    I think you posted about the GW and timing and this is a follow-on post to that which explains the forwarding problem you described earlier.

    What the log shows is that a call came in and was routed to the 809 ring group. The log is a little confusing as it shows the ring group, but in less than a second shows the call attempt being made to the Portech. I assume the ring group was already busy. Being busy, the call was sent to the Portech which then shows no available trunks so the system sent it back to the ring group whereupon the ring group being busy, the call was disconnected. I assume that one of the rules pertains as to the disconnect.

    You apparently have created a number of rules and have presumably ordered/structured them in the sequence or priority by which you want them processed. It may help if more detail regarding the rules can be had. Like you, I am a little confused, given your explanation, as to why the calls do not progress as you have stated, but without more detail of how the rules are structured and then what the attributes are for each rule, I can't be certain that the system is not reacting as it should. On the surface and assuming that all is correct with the rule formulation, you do seem to have a valid issue.
     
  11. zafeirop

    Joined:
    Jul 4, 2012
    Messages:
    10
    Likes Received:
    0
    Hi lneblett,

    That topic is different than the other that we met :)
    However, there are some common problems regarding Ring Group routing policy.

    What I have created is a Ring Group which is populated only with virtual extensions for After Office Hours calls:
    These extensions have their status always set to "Away"
    These extensions are never registered to 3CX, they just have been assigned with a dummy 3 digit number in order to be valid.
    In the General Tab of Extension settings, the mobile numbers are set, in order for calls to be forwarded.
    In Settings/General/Global Options I've ticked the setting "Allow forwarding to external numbers in Ring Groups and Queues"
    This is why you find in the log that the call is forwarded right away to the gateway.

    When a customer calls our company after Office Hours, this Ring Group is triggered and our Cellular Phones ring, in parallel.
    First person who picks up the call gets the channel.

    But if there are no channels available, the call to the particular cellular will fail and unfortunately, fallback routing is not triggered.
    Why does this happen since I've activated all possible route entries for my destinations, even in different Outbound rules ?

    There should definetily be an asnwer from the programming team of 3CX.
     
  12. leejor

    leejor Well-Known Member

    Joined:
    Jan 22, 2008
    Messages:
    10,586
    Likes Received:
    252
    When you say "channels", you obviously don't mean trunks (as in a 3CX trunk group), because that should trigger an attempt on a second trunk group, if another one is in the outbound rules.

    While VoIP provider are generally capable of sending the status of a call back to 3CX, it is not always the case with a gateway. Some might, if set-up correctly, and have features such as current reversal, on a PSTN line, indicate answer supervision, but would still not indicate, other than audible, a busy line.

    The only way to truly confirm what is happening, would be to use something like Wireshark. That would tell you exactly what is being passed back to 3CX after the dialled digits have been sent to a gateway.
     
  13. zafeirop

    Joined:
    Jul 4, 2012
    Messages:
    10
    Likes Received:
    0
    Yes, I aggree.

    But this GW is a SIP GW which means that every response is compliant with the SIP protocol and that if all lines are busy, or a general problem occurs, the corresponding error code will be sent.

    In my case I receive:
    Cause: 503 Service Unavailable which, in my case, is translated in simple words:
    "I do not have any more lines to serve your request, please do something else, give up, or try later"

    3CX should do something else and try the next route but instead, gives up and never dials the particular number!
    This is not accepted!
     
Thread Status:
Not open for further replies.