Solved

Asterisk PHP CRM lookup caller on inbound calls.

Posted on 2010-11-12
15
2,154 Views
Last Modified: 2013-11-12
Hi,
We have been using asterisk for a couple of years now.
Integrated into our custom PHP CRM package.
We currently have click to dial feature which does an AMI dial via asterisk.

And now we want to have the CRM application lookup the caller ID number of inbound calls.

I have know idea on how we would implement this?
 
0
Comment
Question by:Matthew_Way
  • 5
  • 5
  • 3
  • +2
15 Comments
 
LVL 6

Expert Comment

by:SkykingOH
ID: 34128326
You should be able to launch the CRM from a URL.

Packages suck as iSymphony from i9technologies will screen pop on an inbound agent call.

Astassistant would also do this and is free however that package has not been updated in a while.

0
 
LVL 32

Expert Comment

by:DrDamnit
ID: 34163477
I would use PHP AGI (http://phpagi.sourceforge.net/).

As calls come in, run them to an AGI script (PHP of course). When the script starts, it will have certain environment variables built into it: one of which is the inbound CID.

Run the number, and interact with CRM as needed. Use the AGI to work with the CID, and then return control back to dial plan code.
0
 
LVL 32

Expert Comment

by:DrDamnit
ID: 34163483
If you're looking for screen pop capability, that's a whole new issue because it is a cross platform problem and depends on which extension actually receives the call.
0
 

Author Comment

by:Matthew_Way
ID: 34163775
@DRDamnit
Yes that's what I'm after, screen pop.
We have a combination of Linux and Windows clients using FireFox and Xlite.

Is it possible to some how trigger firefox to do a lookup based on the CID

0
 
LVL 32

Expert Comment

by:DrDamnit
ID: 34165220
Firefox does not "listen" to anything as a client by default.

In order for a screen pop, you would have to rig up the following:

1. Inbound call hits asterisk
2. Asterisk hits CRM to do a lookup for later usage, sets CID, does CDR, etc...
3. Call is answered.
4. Asterisk fires AGI, that fires PHP (or something else), which notifies a daemon on the asterisk box of who answered the call, and other relevant information.
5. The daemon notifies a client application running on the appropriate Windows box to execute the URL / URI.
6. The client runs a shellex, or some other spawn command to cause firefox to open a specific URL.

There are other ways of skinning this cat, and I am sure my colleagues here will have some opinions on what to do with it. But in theory, this is a very clean way of doing it.

You would need to write a very simple system service for your windows machines that log into the daemon on the asterisk box.

You could write a very simple daemon on the asterisk box to listen and maintain connections.
0
 
LVL 6

Expert Comment

by:SkykingOH
ID: 34165256
Astassistant has all of the libraries mentioned.  It will pop the URL of your choice with the caller ID at a user selectable point in the URL.

0
 
LVL 32

Expert Comment

by:DrDamnit
ID: 34165697
Astassistant looks like it would do the trick because it connects to the AMI. If you can configure it to execute the URL at the correct point in time (in between the CRM queries) it might do the trick You would have to try it to find out.

But it looks like something to definitely try.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:Matthew_Way
ID: 34173476
I wonder if I could use a hidden iFrame with a long lived HTTP connection AKA comet.

I found this.
http://www.zeitoun.net/articles/comet_and_php/start

Looks like bit I'm missing would be a webserver that could efficiently hold open 50 HTTP sessions.

That would allow the running web session could handle the inbound call.
0
 
LVL 6

Expert Comment

by:SkykingOH
ID: 34173530
Sure you could write your own application.  It would have to connect to the Asterisk manager to get the events.

Much larger project than using an application that is already written to do screen pops.

0
 

Author Comment

by:Matthew_Way
ID: 34179476
Yeah I know, but the problem keeps coming back to the client PC.

How do I trigger an event on an already running web session within FireFox ?

And if we don't have to install additional software on the client PC that's going to make the job easier.
0
 

Author Comment

by:Matthew_Way
ID: 34179580
Been Googling around and found this on GitHub:

https://github.com/mscdex/node-asterisk

Could use it as a proxy between the Asterisk server and the web browsers to pass events back up the line as it were.
0
 
LVL 32

Expert Comment

by:DrDamnit
ID: 34180630
>>How do I trigger an event on an already running web session within FireFox ?

THis is the main problem. Firefox doesn't inherently listen for information from other sources. You either have to have a system service listen, and then shellex the URL to firefox, your have to write an xpi plugin.
0
 
LVL 2

Expert Comment

by:asternic
ID: 34202412
FOP http://www.asternic.org
or
FOP2 http://www.fop2.com

both can be used to fire popups on inbound calls. An example solution integrating FOP with Sugar CRM:

http://www.enesoluciones.com/wordpress/2010/04/integracion-de-asterisk-con-sugarcrm-550/

FOP uses flash xmlsockets (fop2 also uses html5 web sockets when available) for the long lived synchronous connection. And you do not need to expose the Asterisk Manager to the public.



0
 

Author Comment

by:Matthew_Way
ID: 34254527
The particular project we have been asked to do is no longer happening.
But I'm sure this is something we are going to need to do in the future with our application.

We can't just simply move to Sugar CRM and through out our existing application.

What I'm thinking of is using nodejs listening to Asterisk for events.
Then have the web browser hold open a connection to the nodejs server.
Probably through web sockets.
Which I understand is now built into the Chrome browser.

The simple answer is that right now there is no simple answer.
0
 
LVL 7

Accepted Solution

by:
nttranbao earned 500 total points
ID: 34374630
If you are using FreePBX, then CalleriD lookup is integrated.

If not, then the below custom dialplan should be in use:

exten => s,n,Set(CallerID(name)=CURL(http://yourcdrm/cidlookup.php?phoneno=090345679))

This is just for your information, since the syntax is not verified. (recalled from memory)

0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

The point of this post is to give you a copy/paste installation solution to setting up Asterisk 1.6 on Ubuntu 9.04 (or similar) server. # Setup the system apt-get install subversion apt-get install make apt-get install linux-source kernel-p…
I recently purchased a Bluetooth headset called the Music Jogger (model BSH10). The control buttons on it look like this: One of my goals is to use it as the microphone and speakers for Skype calls. In that respect, it works well. However, I …
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now