API to initiate calls and to capture incoming call number for popup with our custom CRM

Status
Not open for further replies.

tajhaslani

Free User
Joined
Apr 16, 2020
Messages
8
Reaction score
0
How can we create an API to initiate the call from our custom chrome extension and how can we capture incoming caller's number to develop incoming call popup integrated with our custom CRM?
Tried looking for API docs but couldn't find much.
Are there any developers/companies who can do this for us?
 
There are no APIs to achieve this. The only options you have are the following:
1) To make outbound calls, you can use the Web Client URL, and this way you make the call with the Web Client. For example:
https://my-pbx.example.com:5001/webclient/#/call?phone=1234567890

2) To receive contact popups on inbound calls, you need to create a CRM template following this guide:
https://www.3cx.com/docs/crm-integration/

In this case the Web Client will be poping up the Contact URL returned by the template.
 
Thanks. https://my-pbx.example.com:5001/webclient/#/call?phone=1234567890 is bringing up 3CX dialer screen. How can we actually dial/initiate the call and not show the dialer screen?
That's correct, that's what it does. You need to click Dial to actually make the call. There is no way to achieve this with the Web Client.

If you use the 3CX Windows client, then you can use the CallTriggerCmd application included with it. By launching that program you can start a call from the user's extension. But I'm not sure if this is an option for you, because you would need to be launching an app in the client's PC.
 
Thanks again for the prompt response. This is so disappointing coming from FreePBX world and have more power than this paid version.
 
How can we create an API to initiate the call from our custom chrome extension and how can we capture incoming caller's number to develop incoming call popup integrated with our custom CRM?
The only way to do it right, at least for now, is to buy VoipTools package. However, I found this solution is way too expensive, especially knowing that I need only one tool from the package (other features offered by VoipTools are totally useless in my case). Even though my office would probably pay for the license if it was one-time payment, but there is only a subscription option.

The current workaround that we have in the office is we intercept the new tab created by 3CX extension. In details:
  • you need to find an "integration" settings in 3CX extension and set some valid url in it (you can pass incoming number here),
  • grant the permission to deal with Tabs to your own extension,
  • create a chrome.tabs.onCreated listener in your background.js and catch all tabs that trying to open your predefined url,
  • if there is a tab trying to open your url then this is "incoming call" event created by 3CX, you can apply extra logic to it
JavaScript:
chrome.tabs.onCreated.addListener((tab) => {
  const { pendingUrl, id } = tab;

  // intercept the tab created by 3CX
  if (pendingUrl.match(/ some RegEx here /)) {
    // delete the tab
    chrome.tabs.remove(id);

    //
    // execute some extra logic here
    //
  }
});

The only problem with this solution is "flickering". 3CX extension intentionally makes the new tab active, as a result of this, the user will see a new tab for a moment.
 
Last edited:
The only way to do it right, at least for now, is to buy VoipTools package. However, I found this solution is way too expensive, especially knowing that I need only one tool from the package (other features offered by VoipTools are totally useless in my case). Even though my office would probably pay for the license if it was one-time payment, but there is only a subscription option.

The current workaround that we have in the office is we intercept the new tab created by 3CX extension. In details:
  • you need to find an "integration" settings in 3CX extension and set some valid url in it (you can pass incoming number here),
  • grant the permission to deal with Tabs to your own extension,
  • create a chrome.tabs.onCreated listener in your background.js and catch all tabs that trying to open your predefined url,
  • if there is a tab trying to open your url then this is "incoming call" event created by 3CX, you can apply extra logic to it
JavaScript:
chrome.tabs.onCreated.addListener((tab) => {
  const { pendingUrl, id } = tab;

  // intercept the tab created by 3CX
  if (pendingUrl.match(/ some RegEx here /)) {
    // delete the tab
    chrome.tabs.remove(id);

    //
    // execute some extra logic here
    //
  }
});

The only problem with this solution is "flickering". 3CX extension intentionally makes the new tab active, as a result of this, the user will see a new tab for a moment.

Thanks for such detailed response. I am hugely disappointed that a simple API to make a call is not available from 3CX. I do not want to by VOIPTOOLS for one API. How did VOIPTOOLS create this API? There has to be some way to do this for an independent programmer? I am surprised no one has done this yet. I am thinking of NOT using 3CX and move on with something which is more open. We have been using FreePBX for years with no issues. Since Covid19, we needed to use Softphones adn FreePBX is crashing when mpre than 50 active users are using Softphones. We tried all sotphones liek Xlite, Zoiper and even purchased ZULU. We also paid for Sangoma support and they told us that this is a known issue and they do not have any solution for us. Here is the issue with FreePBX and any softphone. Has any one faced this issue and solved the issue?
"
All of sudden lots of HTTPD process count increase and along with MySQL load.
MySQL load start raising and keep increasing along with http process count.
Thus, this cauase Zulu client to get kicked off or disconnected from the server.
Currently, as a fix, we are stop and start apache service which resolves the issue."

Thanks
 
Thanks for such detailed response. I am hugely disappointed that a simple API to make a call is not available from 3CX. I do not want to by VOIPTOOLS for one API. How did VOIPTOOLS create this API? There has to be some way to do this for an independent programmer? I am surprised no one has done this yet. I am thinking of NOT using 3CX and move on with something which is more open. We have been using FreePBX for years with no issues. Since Covid19, we needed to use Softphones adn FreePBX is crashing when mpre than 50 active users are using Softphones. We tried all sotphones liek Xlite, Zoiper and even purchased ZULU. We also paid for Sangoma support and they told us that this is a known issue and they do not have any solution for us. Here is the issue with FreePBX and any softphone. Has any one faced this issue and solved the issue?
"
All of sudden lots of HTTPD process count increase and along with MySQL load.
MySQL load start raising and keep increasing along with http process count.
Thus, this cauase Zulu client to get kicked off or disconnected from the server.
Currently, as a fix, we are stop and start apache service which resolves the issue."

Thanks
The VoIPTools software uses the CallControlAPI which is no longer documented nor supported. They had it a long time ago and they still use it but us cannot. That's why they are selling that much!
 
Can anyone share CallControlAPI code/api, we will build a rapper and share it here for anyone to use it for not cost.
 
Can anyone share CallControlAPI code/api, we will build a rapper and share it here for anyone to use it for not cost.
Wrapper* ;)

And nobody has them, those who do won't share it to make money on us buddy.
 
Btw, I forgot to mention, but it looks like there is one more "crutch" solution existing.
If you use Windows machine you can install 3CX MultiTAPI on each client and make outbound calls via TAPI. But this whole setup is just a mess, I think it works this way TAPI <--> 3CX Windows App <--> 3CX. To use TAPI you will have to have 3CX App installed and running.
 
Last edited:
Btw, I forgot to mention, but it looks like there is one more "crutch" solution existing.
If you use Windows machine you can install 3CX MultiTAPI on each client and make outbound calls via TAPI. But this whole setup is just a mess, I think it works this way TAPI <--> 3CX Windows App <--> 3CX. To use TAPI you have 3CX App installed and runing.
TAPI requires Pro or Enterprise license. Standard is not supported.
 
Status
Not open for further replies.

Forum statistics

Threads
112,325
Messages
591,898
Members
165,479
Latest member
Senergia