3CX Config API

Discussion in '3CX Phone System - General' started by VoidRunner, Aug 6, 2014.

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

    Joined:
    Aug 6, 2014
    Messages:
    7
    Likes Received:
    0
    Dear all,

    This is my first post, and I'll try to explain as best as possible. Please do not judge me very hard, since I am new to the Telephony world. So here is the deal...
    I've a 3CX installation. It is connected to various SIP Providers. Couple of trunks are delivered via a mobile telephony provider. They have an option to terminate to a SIP Trunk and to a SIM simultaneously. If an incoming call is on its way, the ACK package is delivered first to the SIP Trunk (it starts ringing the associated extension) and exactly two seconds later the mobile is also ringing.
    SIP Trunk is associated with an extension (for example 100), and when a call is coming, the extension rings. If the extension is busy or not registered, the call is transfered to another extension (ex. 101). If this second extension is also busy or not registered, the call is terminated. In most of the cases this is workable, but in some cases when 100 is unregistered and 101 is busy or unable to accept the call, the call is terminated immediately and it is even unable to ring the mobile.
    Few solutions comes in my mind:

    First: Create an extension (ex. 599), register it with a softphone on the server, and if 100 or 101 are unable to accept the call, it is redirected to 599, which will ring indefinitely, until the mobile is not picked up. The problem is that I've 10 trunks like this one, and if 599 is ringing, it is not able to accept additional ring request.

    Second: Neatest according to me is to create an application in PHP which will change the parameter responsible for "Allow incoming call on this line", and will disable the incoming calls. Once the user want to reroute its communication through the PBX, he will follow a link which will access the application, which on its side will change the parameter in the DB. The problem is that 3CX should be forced to reload its configuration from the DB. And the only known way to me is to restart it. Which is strongly unacceptable, because it'll disconnect all the conversations, and will take some time to reload all the components.

    Do you know some way except the WebGuiInterface.exe and the http interface by which we're able to change this parameter? I was thinking to extend the CRM IVR API, but this one includes a lot of debug, decompile and disassembly of C# 3CX internals. Once again unacceptable. Another option is to find out how the WebGuiInterface.exe is communicating with the actual service, I guess it is through an RCP channel or something? If I know the way, perhaps I'll be able to write an application which will be able to change this parameter... the problem is that there's no documentation.

    Third: Create a dummy extension which is able to accept indefinitely number of rings simultaneously, with out accepting the call. As far as I know 3CX does not support such thing.

    Fourth: Install FreeSWITCH somewhere, and define such extension as in the Third option. Then define FreeSWITCH as a SIP Trunk VoIP provider to 3CX and redirect the call to this Trunk. Unfortunately once the call is redirected to another SIP Trunk, 3CX is connecting the call to this Trunk, so the mobile once again will not ring, the calling party will see an established connection, but still will hear the Ringing tone in the earpiece.

    Perhaps additional options are also possible, but I am out of ideas.


    Any advice, or maybe someone have such experience?
     
  2. eagle2

    eagle2 Well-Known Member

    Joined:
    Apr 27, 2011
    Messages:
    1,085
    Likes Received:
    11
    There is a much simpler way of solving your configuration issues, using Call queues in 3CX PhoneSystem.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. SY

    SY Well-Known Member
    3CX Support

    Joined:
    Jan 26, 2007
    Messages:
    1,825
    Likes Received:
    2
    Hi VoidRunner,
    Sorry, but this description is not so clear. What is the concrete problem?
    1. Mobile phone stops ringing when PBX rejects the incoming call
    or
    2. Mobile phone does not ring if PBX rejects the call too fast
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. VoidRunner

    Joined:
    Aug 6, 2014
    Messages:
    7
    Likes Received:
    0
    Not exactly what I am looking for.

    If the call is redirected to call queue:
    - it still have timeout (which could be configured of course..)
    - still there should be registered extensions as members in this call queue (unacceptable).
    - even if I have a working call queue, with N members, what if some of them are busy, and others are switched off extensions? The call will be either terminated or redirected (unacceptable).
     
  5. VoidRunner

    Joined:
    Aug 6, 2014
    Messages:
    7
    Likes Received:
    0
    Dear Stepan,

    Thank you for your response.

    In both cases the mobile will cease ringing. In the first case, if the PBX rejects the call on the 4th second, the mobile will ring only 2 seconds. In the second case, if the PBX rejects the call very fast (<2 seconds) the mobile will not ring at all. Perhaps if there's a parameter which instructs PBX to neither reject, or accept the call if the extension is busy/switched off... but what will be this timeout enough for the person to accept the call on his mobile? In my opinion more than 10 seconds. The calling party won't wait even 5 seconds before it hears the ringing or busy tone. It'll just decide that there's a glitch, and terminate the call.

    I'll try to clarify the scenario. Sorry if I am annoying you guys, but the case is somehow unusual.
    There's a call, coming from a "VoIP Provider".
    This "VoIP Provider" is sat-up to accept the incoming calls and to redirect it to an extension.
    In this case both the extension and the mobile rings. This is a feature delivered from our provider, nothing to do with 3CX PBX installment. This is a perfectly workable case. When the person is in the office, on his desk, he is able to accept the call using his extension and this way transmitting the call through the PBX.

    The problem occurs in two scenarios:
    - if the extension is busy or unable to accept the incoming call from VoIP Provider.
    - If the extension is switched off and still unable to accept the incoming call.
    For 3CX both scenarios are equal, so in both cases it'll redirect the call to another extension. If this other extension is in the same state as the first one, it'll have to redirect to third (end call, or transfer to ring group).. etc.
    Unfortunately one of those persons is our general manager, who does not like calls on his mobile being redirected anywhere. This renders us a problem, because when his extension is busy, 3CX will immediately terminate the call. But doing so, his mobile will not ring at all (the difference between the SIP and SIM profile is 2 seconds in ringing).
    There's also other persons in the company, who do not like their mobile calls being redirected to someone else's extensions.

    Which gives me a solution itself. I need a dummy extension which:
    - will ring, the whole time,
    - is not terminated to a real device or a softphone,
    - is able to ring undefined number of calls in the same time, without accepting them, neither rejecting them.

    But I believe that it'll be easier and neater if person have an interface by which he's able to switch off the "Accept Incoming calls" for a current VoIP Provider. I've the PHP scripts, which will update the DB. But I am not able to force the 3CX to reread these settings, without restarting the whole PBX...

    Another solution which is also very neat, is to have FreeSWITCH somewhere, add FreeSWITCH as a VoIP Provider and create few dummy extensions, like the one I described. Having that solution, if the extension is busy (if the person is speaking) or in DND/Away mode (for example when the person leaves the office) all the incoming calls are redirected to the FreeSwitch. If the call is for his mobile, it'll ring his mobile. If it is for his extension number, it'll still ring indefinitely.
     
  6. SY

    SY Well-Known Member
    3CX Support

    Joined:
    Jan 26, 2007
    Messages:
    1,825
    Likes Received:
    2
    Hi VoidRunner,

    two small questions. Just to have complete picture.
    What is happening if mobile phone is disconnected from mobile network or turned off or busy?
    Does call continue to ring on PBX extensions?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. VoidRunner

    Joined:
    Aug 6, 2014
    Messages:
    7
    Likes Received:
    0
    Yes, no matter whether the SIM account is registered to the mobile network, the provider will deliver the call to the SIP Trunk.
    If the SIP Trunk is not registered, the call is still deliverable to the mobile.
    If the mobile and the SIP Trunk are registered, the call ring is delivered to both, simultaneously, and the first device which accept/reject the call, forces the second cease ringing.
     
  8. SY

    SY Well-Known Member
    3CX Support

    Joined:
    Jan 26, 2007
    Messages:
    1,825
    Likes Received:
    2
    Ok, last question:
    if call is rejected from mobile phone, does it continue to ring on PBX?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. VoidRunner

    Joined:
    Aug 6, 2014
    Messages:
    7
    Likes Received:
    0
    No, if the person rejects (or accept) the call on the mobile, the PBX stops ringing.
    If the person rejects (or accept) the call on the PBX, the mobile stops ringing
     
  10. eagle2

    eagle2 Well-Known Member

    Joined:
    Apr 27, 2011
    Messages:
    1,085
    Likes Received:
    11
    Still, why not using external agents (i.e. mobile phones) mechanism for queue calls ?

    You can do lots of things, including call control by mobile phone (call transfer, conference call, etc.), plus several mobiles ringing simultaneously, etc., having log-in/out status from queues, call recording and so on ...
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  11. VoidRunner

    Joined:
    Aug 6, 2014
    Messages:
    7
    Likes Received:
    0
    Guys,
    Thanks to all of you for your support and responses.
    I found a workaround for my problem. The solution is as follows.

    Compile and install FreeSWITCH for Windows. Change the default port to 5161 and create an user profile with a number and password.
    In 3CX add this FreeSWITCH account as a VoIP provider with the given parameters.
    In the routing rules create a loophole for the current extension, so that it'll ring forever.
    Create an outbound Rule for the new VoIP provider in 3CX. And voilà.. this is a dummy extension, created for endless ringing.

    If you wondering why is this .. just read the rest of the Thread.

    Dear Eagle2,

    I know 3CX very well, even reversed a couple of C# libraries, searching how HTTP API is implemented.
    However, 3CX does not have the overlooked by me features.

    And more... unfortunately 3CX isn't covering all the requirements for our organisation regarding the integration with the ERP/CRM software. We've stopped on an Embedded Device running Asterisk. Hopefully it'll be stable and effortless decision.

    However I am still continuing to scratch the 3CX PBX project, because it is interesting to me. So expect more questions from my side.

    Greetings
     
Thread Status:
Not open for further replies.