Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2691
  • Last Modified:

Asterisk PHP CRM lookup caller on inbound calls.

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
Matthew_Way
Asked:
Matthew_Way
  • 5
  • 5
  • 3
  • +2
1 Solution
 
SkykingOHCommented:
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
 
DrDamnitCommented:
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
 
DrDamnitCommented:
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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Matthew_WayAuthor Commented:
@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
 
DrDamnitCommented:
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
 
SkykingOHCommented:
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
 
DrDamnitCommented:
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
 
Matthew_WayAuthor Commented:
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
 
SkykingOHCommented:
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
 
Matthew_WayAuthor Commented:
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
 
Matthew_WayAuthor Commented:
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
 
DrDamnitCommented:
>>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
 
asternicCommented:
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
 
Matthew_WayAuthor Commented:
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
 
nttranbaoCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 5
  • 5
  • 3
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now