Show a popup with Account details during ringing of new phone Call

Hi all!

I am still pretty new to the suitecrm framework…
I am trying to work out a little bit of a problem that I have infront of me.

I am currently using Twilio for my incoming phonecalls / sms messages and through this interface I can implement all kinds of logic based on telephony apis and do all kind of processes during a phone calls life cycle… I have the same phone # ringing at the same time in different offices. So the ability to handle a phone call is in my hands…All cool. fun stuff really.

What I am working on is the ability so when a live call comes in a few things take place…

A: I do a API call on suitecrm to determine if the phone number has been used in the system
B: if # exists then check and pull of latest “Quotes / invoices” and create a verbose view of these details
C: if user is logged into suitecrm then automatically pull up the account that is in the system / quote / invoice and “popup” a window for the user that is logged in .

and of course if no user is logged in, then just do silent backend functions.

D: SMS details of caller via: Twilio from returned data from B

Lots of tricky stuff here… But the biggest challenge I think I have infront of me is if suitecrm has a feature that allows the API to pop up windows for users?

Is this something that someone has done in the past… realtime automated popups showing account data… hmm :thinking:

thinking that I will need to write a little bit of ui logic on the suitecrm side of things to listen for remote calls to pull up a window… :thinking:

little bit of flow…

Interesting requirement…

The API is back-end - you won’t be able to trigger UI actions from there.

But you can use the API to get infomation (ID’s of associated accounts, quotes, etc.) and then launch a URL in the browser with the required parameters.

Either something like this:

or create your own custom entry point and do something more custom.

yeah I figured the API would not allow any calling of remote ui features…

Genius really… yup. once the API call is made to determine the account record data, I should be able to string up a URL. I guess I will have to establish a flag that is flipped so I can check when a user is actively logged in… . hmm. :thinking:

If you use a proper entry-point SuiteCRM will check the authenticated status for you

yeah. I have been dreaming of this working… Sitting at my desk and a call comes in and instead of scrambling at my keyboard doing manual searching of records an “auto search / popup” would be like so magical.

… by the 2nd ring I could have a complete overview in my mind before I even say “Hello”

I will need to get a little listener waiting for remote requests… :thinking:

been thinking…

  • remotely activated (twilio) but locally processed (suitecrm) report / window…
  • I think I need to create a local side process that will wait for fresh calls…
  • listener will grab the passed phone number ( E.164) and then pull up the data window (entry point)
  • Multiple phone Calls = Multiple Windows (locally pulled urls / browser windows)

Geeze tick tock… lets see if I can get this working…

almost wish I could add my own custom application hook

update (hours later) :

I have the http listener working and waiting for requests from the phone network. whoo hoo.
Now working on the suitecrm part… from the listener I will pass in the phone number that is now passed into my local machine for local processing… I should have things popping up during a phone call ring before i know it.

Seen this new feature only available in 7.11+ custom search framework looks interesting…

I found that a simple numeric entry on the “Default” search bar of a partial phone number will return contacts with the number.

ie: search for 555

it will return contacts that have 555-111-2222 (I will further test)

back to work… tick tock.

… time passes (24h) …

Whoo hoo! Done! I have it working!!

As the phone rings I have a suite window popping up with fresh search results completed all based on the callers number!

It works pretty fast and is super sweet once I got it working.

Funny stuff really… as I was coding / testing … I seen this YouTube ad come on for this pay service that does a similar thing… as the phone rings you get some caller details in front of you from some web based minimal crm all for big $$$…

If anyone wants to know more about how I did it let me know…

Done! :thinking:

1 Like

As requested… Here is a little skeleton breakdown of how I accomplished a suitecrm lookup while a incoming phone call is ringing.

Few steps here… :thinking:

My resources:

  • Windows machine: NIC setting…
  • Server : hosted, DNS access… cpanel
  • Telephony Service: PBX, Asterisk,ringcentral,signal or what I use Twilio
  • Local Router Access (port mapping)
  • Compiler: C# windows (visual studio)

Step 1. I had to get a phone system where I have control of the call. I used twilio and established a GET http request that would send data to my local listener that I had to write.

Step 2: Write Listener… I went with a system .net http listener…

I had to make the listener be active on a presetup port of my choosing… (61337)… and would be waiting for traffic from the twilio network. The listener is the part where I would like it to be more integrated into the suitecrm… ohh well… in time…

Step 3: I had to make sure that the router would shovel the packets properly to the listener… In doing so, I made my network card on my local machine be forced to a non DHCP IP address… I didn’t want my local machine changing IP addresses and messing things up in the worst time possible. So with windows forcing of a address I was able to go into the router and tell the router a couple things…Of course this is my use case… (images will show .88 ignore)

  • Open Port 61337 and keep it remained open to my IP address with port mapping TCP traffic
  • Forced my local machines nic card (mac address) to have a reserved IP address of This would assure mapping and code would not break over time…

Step 4: I went to my domain (cpanel) and setup a dns A record to handle my local telephone traffic…
data will now be able to punch through my router and hit my listener that is waiting for requests to process…

key part, as I could then use a domain name vs a IP address in the twilio platform which would just limit the breaking of code over time…

Step 5: Fire things up. Launch Listener… Call in…

of course… I missed a critical step… establishing the call data to suirecrm…which really was in the step2 c# code. Once the GET request is done there is a bit of code that extracts the pushed phone number from the twilio network that was nicely formated as: freshcall=%2B15554443333 as it is pushed across the network… In the c# code it gets turned into

key: freshcall
value: +15554443333    // E.164 format

I had to then parse that i.164 format into a suitecrm search string…
Almost FULL stop here… as this is where I want to design a sweet push into suitecrm that is not just a “unified search” but a module or something that is more “complete” of a dashboard of actions that one could access “during the ringing”
of the incoming call… very very crude switchboard type action here… by no means “polished”

but here we … phone number parsing… I transformed the phone number into a areacode-prefix-suffix string tearing out the +1
I am being lazy here and not dealing with international callers right now…

once the phone number is stringed up… I injected it into a url structured for the unified searching which is then sent to the operating system’s default browser.

This is where I am working on making an assured login and then a search…

twilio 2 suitecrm - listener startup

Listener waiting for calls

Call Came in!!

Search being completed on a auto opened browser… Whoo hooo!

Right now I have to of previously opened a browser that is currently logged into suitecrm… As once the url is pushed to the browser it will rely on a pre exisiting session…and this is where the new browser will open up magically with no issues and have a search performed…waiting for human input…

I am looking at a couple articles that I think will solve this autologin issue… but besides this small detail… things are working like clockwork.

Custom Login

Login from external website

Auto Login

geeze I think that is most of it in a nutshell I am just a couple coding sessions into this now…


1 Like

requires some hacking but it can be done!