Intelligent call routing and CRM integration

a_lemin
Posts: 231
Member Since:
2007-01-21

Hey all,
I just wanted to create a new thread for this subject. I did bring it up in another thread the other week but it was a bit out of scope for that thread really and I really would like to get some opionions from people on this one as I am desperately trying to sway kerry into the idea and benefits of adding 'SendURL' support to the soon to be released HUD3.

PS. Thanks to all those who responded in the other thread, I had some really useful responses.

For those that don't know what SendURL is or CRM, just read on. Sorry if this is a bit long but it is worth it I promise ;o)

Imagine this;
When a caller comes into the IVR (Option menu), and the caller presses 1 for the support team, pressing 1 sends the call to a custom section in extensions_custom.conf.
Here our PABX prompts to the caller to enter a case number/ticket number (As logged on the CRM system), Asterisk then listens for the DTMF tones and stores them (Done with a single command (‘Read’) in the dial plan).

Asside; A CRM (Customer Relation Manager) is usually a web based job management system that allows 'calls' or support cases to be logged (Often called tickets) detailing issues a customer might have for what ever reason. Staff can then add comments to the ticket and so on until the call be closed when the problem is resolved.
See SugarCRM for an example. http://www.sugarcrm.com

Now that the user has entered their ticket number we have the information that will allow us to do some very powerful and clever things.

We could stop right here, as the CRM page for the ticket is nearly always something like http://urltocrmserver/somefile.php?ticketnumber, where the first part of the URL never changes. Thus with only one line of code we already have everything we need!

For example, we could now run the asterisk function;
"SendURL(‘http://urltocrmserver/somefile.php?ticketnumber’)".

This set’s the URL SIP header, we then simply ring the support ring group/queue and the agent who answers the call will have the CRM web page popup with all the support ticket info open in front of him or her as soon as they pick up the phone...... How cool would that be!

What we have done is to take this a bit further (As HUD currently doesn't support SendURL anyway :( ).
For example how about if we could work out who the support ticket was currently assigned to, and route the call to only that person...!

Well that was actually surprisingly easy. I wrote a simple .agi script (Perl script you place in /var/lib/asterisk/agi-bin/) which you call from the dial plan passing it the ticket number you collected with the Read() command.

In the AGI script you simply load the Asterisk-perl modules (Asterisk::AGI) and database modules (Perl::DBI) thus providing you access to any database you want.
In my script I then make a database connection to the CRM database, and simply call something called a ‘stored procedure’ passing it the ticket number.

The stored procedure resides on the database. It forms part of the database schema but is in essence program code that resides on the database. It sounds complex but it honestly isn’t.
Anyway, you can write one (less that 10 lines of code even) which you simply add to the existing CRM database. My stored proc simply uses the ticket number to select the data from the database relating to the support ticket, in particular returning the name of the agent the ticket is assigned too......

Here I did have to use a tiny user map to map agent names in the CRM to extensions......

The stored proc now simply returns the agents extension number to the AGI script, which in turn passes it straight back to the dial plan.

Now we simply run the SendURL() command just as we did before, we could also set the ALERT_INFO variable too if we wanted to make the phone ring with a different sound. And finally actually ring only the extension that the ticket is assigned too.

Obviously during all of this we can add some simple validation code to make sure valid key presses are detected, etc etc.
In our case we don’t actually use SugarCRM, we use a proprietary CRM system that was written for us, but by using the above simple method you could hook into any CRM you like.

So why go to all this hassle you may ask?
Using the above process cut down on call time by a HUGE amount, (As much as 25% in some cases) as the caller was no longer having to ask "Is bob there?" (If you are lucky enough that the caller even knew the ticket was with bob!), then the agent havng to transfer the call to bob (Wasting the time of two agents!), then when bob finally gets the call he has to ask what the ticket number is (Probably again!), open his browser and type it in and searcj for it.
This all adds up to a surprising large amount of wasted agent time

Instead the call goes straight to the right person, and the only missing piece of the puzzle is having the web page open up in front of him/her without having to do anything allowing the agent to respond to the issue instantly.

Pheww, I knew that was a bit long. thanks for reading this far.

I would really appreciate anyone reading this thread who can think of other great uses for the SendURL() function to post your ideas here to help persuade Kerry to add support for it in HUD3 as I so want to place the final missing piece of the puzzle.

How about if i made all my code available for the above functionality? Would people be interested?

It's not that complex or well written for that matter, but it works, and I guess what I have put together may be enough to help others in similar positions get started.

Or even better, is trixbox ever planning on rolling out SugarCRM? Could this be a good bit of integration others might like?

Anything that will encourage HUD3 to support SendURL :o)
Thanks for your time.



jahyde
Posts: 2002
Member Since:
2006-06-02
not a bad idea, but i think

not a bad idea, but i think if it were to ever be accomplished it will probably need to be done by the community, someone like Dickson could probably wip that out in an hour ;)

--

--my PBX is run on 2 V8's



a_lemin
Posts: 231
Member Since:
2007-01-21
Agreed :) I have no doubt

Agreed :)
I have no doubt there are others out there who could put together a simple and elegant solution for SugarCRM (Which i think is the most popular open CRM).

The thing that amazed me was just how much time was being wasted and just how much more efficient it made everyone. Not to mention how much the agents liked not having to answer calls for other people :)



rpotthoff
Posts: 146
Member Since:
2006-12-19
This would also be great for

This would also be great for a sales team, and marketing team, I work for a major manufacure and would love to have this as I know neither Nortel, Avaya or Cisco have this in there systems right now and it would be great to see tb the first to do it.



a_lemin
Posts: 231
Member Since:
2007-01-21
Hey rpotthoff, thanks for

Hey rpotthoff, thanks for the support.
How would you utilise this type of call routing to service your sales and marketing people?



Fiskfan
Posts: 10
Member Since:
2007-05-22
Sales

If you have a company with a sales dept. with more than 1 salesrep, this is very useful.

In my CRM, I should have Customer information such as Companyname, phonenumber, ciontactperson etc...

If I call and want to talk with my customer as a salesperson and they are not availble but will call me back, then this is a good solution.

The customer calls me, Asterisk identifies the caller via its phonenumber, looks the customer up in the CRM and connects the call to me since I'm the salesrep. responsible for this customer.

And of course the other, already mentioned, bling bling with popup the page with customer-based information...

Cheers
Erik



a_lemin
Posts: 231
Member Since:
2007-01-21
Hey Fiskfan, of course! You

Hey Fiskfan, of course!
You could have the call routed to the account manager for the customer by looking at the caller ID, and of course pop-up the customers CRM page as soon as the Agent/account manager picks up the phone.

I didn't think of it that way. That would be very easy to implement actually, because you could program the system to pass the ticket number if one was entered and retrieve the extension of the agent to which the ticket belongs, in the absence of a ticket number, the system could instead pass the caller ID and return the extension number of the agent who is the account manager for the customer matching the caller ID.

Kerry do you have any comments at all? In particular is there any chance of getting SendURL support in HUD3?



stechnique
Posts: 733
Member Since:
2008-02-21
BTW I haven't responded yet

BTW I haven't responded yet because I have no functionality to add, but this is the single most important feature to me. This is something our current 1500$ / month small call center solution cannot effectively do. I am pulling the plug on it, replacing it with trixbox CE. I am installing sugarCRM anyways, and so linking callers with their CRM profile is the only manual lookup and repetitive task my agents will still have to do. This would effectively void this task for maybe 80% calls in my situation. Agents happy, callers happy, company happy!



a_lemin
Posts: 231
Member Since:
2007-01-21
Hi stechnique, I did write

Hi stechnique, I did write the code for our our propriety CRM, however the only CRM specific code is in the stored procedure, thus you could have it integrate with as many different CRM systems as you like in theory, and the only code that would need changing would be the stored proc. And the agi script come to think of it because you have to load the right Database module!

Anyway, thats of the point; I would be quite happy to review and rewrite my code (Unless anyone else in the community would like to have a go) and make it work with sugarCRM. I don't have much time at the mo as I am in the middle of moving house so it may take me a while though.

However in exchange can we have SendURL support in HUD??? Kerry??? Please???

If people would like this feature help me persuade kerry :)

Thanks everyone.



stechnique
Posts: 733
Member Since:
2008-02-21
I can probably fix your AGI

I can probably fix your AGI to work with sugarCRM myself, but I haven't installed sugar yet, that's probably still a month away in the roadmap.
I'll hit you up then unless someone else has stepped in and done it by then :)



a_lemin
Posts: 231
Member Since:
2007-01-21
Sure no worries, if you want

Sure no worries, if you want what I have before I get a chance to rewrite it to make it 'friendlier' it just PM me :)



a_lemin
Posts: 231
Member Since:
2007-01-21
Kerry, SendURL support in HUD

Hi Kerry, I know you don't want to promise anything so as to not get hopes up if things work out to not be possible, but are you inclined to maybe provide SendURL support in the new version of HUD?
Please say you are. Do you need more examples? What can I do to encourage adding this simple yet great feature?



SkykingOH
Posts: 9678
Member Since:
2007-12-17
The latest version of

The latest version of Astassistant has a SendURL and a launch application function.

It is worth looking at.

Scott

--

Scott

aka "Skyking"



apple01
Posts: 180
Member Since:
2007-05-17
DB Lookup

I think it worth mentioning that not only CRM system but almost any proprietary contact or order management database can be used for customer number lookup for the purpose of call routing. All you need is to write your own query script or stored procedure.



a_lemin
Posts: 231
Member Since:
2007-01-21
Hi skykingoh, I have seen

Hi skykingoh, I have seen Astassistant before actually. The only problem though is I really don't want operators to have to have it installed.
It is a good app if you are a call centre manager I guess, but we only really want something that is simple, small (Takes up only a small amount of screen space), is tightly integrated and supported by trixbox.

There are many ways to get the URL popup functionality, one of the ways I managed to get it to work was to use asterisk desktop manager http://adm.hamnett.org/ which does not take up any screen space like Astassistant does. However again like Astassistant it is yet another application that needs to be installed alongside HUD, and one which is not tightly coupled with trixbox development etc.

I guess what I am trying to promote is a neat and tidy implementation and HUD is the perfect candidate for this :)

hey apple01, very true :) By having the CRM specific part in the stored proc, all the other code is pretty much suitable for anything, and then you simply add the appropriate SP for your CRM :)

I don't have anywhere where I can upload code examples.
Is there anywhere in the trixbox site where we can upload code snippets like this? Kerry?

Thanks guys :)



SkykingOH
Posts: 9678
Member Since:
2007-12-17
I have had some Java version

I have had some Java version issues with ADM, I think there are a few others. You can "lighten" up Astassistant and I Scott (the developer) is looking at ways for users to edit the workspace views in the application.

The point I wanted to address is that all of these tool are tightly coupled to the Asterisk AGI and Asterisk releases not any specific distribution.

Scott

--

Scott

aka "Skyking"



opendental
Posts: 28
Member Since:
2007-09-28
WOULD LOVE to see the code snippets

I am trying to get started with similar work for my internal CRM (home grown open source dental practice management) and would love some examples of how to use AGI and load information through the dialplan into my CRM. This would be greatly appreciated. I have read the online books and WIKIs but would love code snippets on your work and would respond in kind when I am done with mine if they would be helpful to others. If you don't post them could you email them to me (pm)

nate



a_lemin
Posts: 231
Member Since:
2007-01-21
Well I am about half way

Well I am about half way through rewriting my code to include the 'retrieve extension of account manager if no ticket number is entered' functionality, and making it more generic for everyone.

Should have it done in a couple of days.
Where can i upload code for other people to see? Kerry?

There must be a place on trixbox.com or trixbox.org for this to allow the community to easily view and share code?



a_lemin
Posts: 231
Member Since:
2007-01-21
opendental and stechnique; I

opendental and stechnique;
I will also PM you guys, but would be nice if there was somewhere we could upload for everyone to see :)

Cheers all.



jtknapp
Posts: 108
Member Since:
2006-06-07
ASTassistant

Actually you can minimize ASTassistant so it takes up no space.

-Scott

--


stechnique
Posts: 733
Member Since:
2008-02-21
I can host files, but I

I can host files, but I agree something on trixbox.org would be better...



a_lemin
Posts: 231
Member Since:
2007-01-21
Cool, ok. Let me finish

Cool, ok. Let me finish scribbling together something a little more generic for people to use as a code example. Obviously the stored procs though reference our proprietary CRM database on Informix, but at least it will show the structure and the stored procs can easily be rewritten for the sugarCRM database tables and columns for example.

Then if i PM you the code stechnique would be so kind as to host the code and place a Link in this thread for everyone?

At a risk of sounding unresponsive or unappreciative to peoples suggestions, we are only really interested in HUD supporting SendURL('') as HUD is the software which everyone has come to use and like here and I don't want to have to retrain people to use another product, also I would have trouble getting past my bosses anyway as HUD is the agreed product and ASTassistant is not part of the trixbox package. I am only really allowed to put together kit which is certified, developed and maintained together.
Yes I know it all hooks into the same manager interface! etc etc.. ;o)



stechnique
Posts: 733
Member Since:
2008-02-21
Quote: Then if i PM you the
Quote:
Then if i PM you the code stechnique would be so kind as to host the code and place a Link in this thread for everyone?

Sure would.



a_lemin
Posts: 231
Member Since:
2007-01-21
Firstly before we start,

Firstly before we start, this is a rough scept guide and i am very sorry for any errors you may spot.
It is not the best code in the world, and only forms a proof of concept for those interested in database driven call routing and CRM web popping.

Asside; the existing 'Web Launcher' component of HUD pro works by inspecting the channel variables for the existence of the standard caller_number and caller_name variables. These are pre-existing special variables which are setup by Asterisk every time a call comes in.

HUD-pro uses these variables by allowing you to create a URL inserting these variables where needed. All though very simple to get going,
this setup is extremely limited, as the flexibility is fixed in HUD and the only information you have available to you is two rather simple bits of information.

For example in HUD-pro you would program the following;
http://crm.yourdomain.com/index.php?action=UnifiedSearch&module=H...
or
http://crm.yourdomain.com/index.php?action=UnifiedSearch&module=H...
As you can see you have only two pieces of information to work with.

To bring out the true power of this Web Launching feature for CRM integration requires the URL to be defined server side and not client side,
that is to say instead of only only having the caller_id or the caller_name from the active audio channel and making up what you can from that limited info,
to instead have HUD open a browser by reading a single special reserved SIP channel variable called 'URL' which is populated server side.
This URL can be set by the special asterisk function SendURL('') executed server side during the dial plan.

Because this can be done server side, it also makes provisioning the HUD clients a little easier as you would only need to simply enable 'URL' Web Launching (Look for 'URL' variable and open web browser with contents).
Also being server side provides complete flexibility as you can now have access to all the information you can dream of to form complex URL's for web popping and intelligent call routing.

Tie all this in with Database driven call routing and you have individual calls being routed through your system to agents and groups, with each call containing its own URL taking the answering agent straight to the information they need.
This kind of functionality would cost you tens of thousands in any other system! :)



a_lemin
Posts: 231
Member Since:
2007-01-21
PM sent to stechnique about

PM sent to stechnique about hosting code for people :)



stechnique
Posts: 733
Member Since:
2008-02-21
Here is a how-to with

Here is a how-to with example put together by a_lemin.

http://proxitelecom.com/Asterisk_CRM_integration.TXT
All credits to him for this code.



a_lemin
Posts: 231
Member Since:
2007-01-21
Kerry, considering the 'Web

Kerry, considering the 'Web Launcher' component of HUD simply retrieves two special pre-populated channel variables and inserts them into the text string as set by the user in HUD, it would be really easy to have a simple tick box that meant that HUD also looks for a channel variable called URL, if it exists open a browser using the contents of the URL variable for the URL. 95% of the coding work has already been done. Please?

Would it please be possible to add this functionally to HUDlite3??? Please.



kerryg
Posts: 6793
Member Since:
2006-05-31
HUD3 has the ability to

HUD3 has the ability to receive URL commands, I am not 100% sure how it actually works. What features are going to make it into HUDlite3 we don't know yet.

--

Kerry Garrison
http://www.VoipStore.com - http://3cxbook.com
(888) VOIPSTORE - (888) 864-7786



a_lemin
Posts: 231
Member Since:
2007-01-21
Hey Kerry. Thanks for your

Hey Kerry.
Thanks for your comment, I do hope the URL integration has been done with a mind for easier integration with trixbox CE instead of sending URL commands via the proprietry trixbox pro manager interface when you already have the channel variable sat there ready for this purpose.

Anyhow, its all good news, so i'll be hoping they add it to HUDlite3.

I also tidied up the guide a bit (It may still have bugs though) and created a WIKI :)
http://trixbox.org/wiki/database-integrated-dial-plans

When i get a chance i will edit it and tidy it up a little more.



jahyde
Posts: 2002
Member Since:
2006-06-02
thats some very nice work.

thats some very nice work.

--

--my PBX is run on 2 V8's



a_lemin
Posts: 231
Member Since:
2007-01-21
Thank you :)

Thank you :)



a_lemin
Posts: 231
Member Since:
2007-01-21
Hello all. Are there any

Hello all.

Are there any updates yet as to whether HUDlite3 will support server side generated URL's for web popping?

HUD3 has been said to support it, but will the lite edition??? If it doesn't then we can't use HUD as we need to have the ability to pop-up URL's generated server side using more information than just the callerid! :(

Also does anyone know if you can configure whether or not to pop-up the URL in your web browser before or after you actually answer the call?

kerryg wrote:
HUD3 has the ability to receive URL commands, I am not 100% sure how it actually works. What features are going to make it into HUDlite3 we don't know yet.

Thanks again everyone :)



Alisdead1
Posts: 1
Member Since:
2010-01-30
I am trying to get started

I am trying to get started with similar work for my internal CRM (home grown open source dental practice management) and would love some examples of how to use AGI and load information through the dialplan into my CRM. This would be greatly appreciated. I have read the online books and WIKIs but would love code snippets on your work and would respond in kind when I am done with mine if they would be helpful to others. If you don't post them could you email them to me (pm)

--

директору нравится следить за продажами через crm программу!
Производим и реализуем сотовый полипропилен рекламы на стадионах - светодиодные экраны.



apple01
Posts: 180
Member Since:
2007-05-17
spam

If you would like to receive help you have to respect other people here in the forum and remove spam advertisement from you message!



a_lemin
Posts: 231
Member Since:
2007-01-21
Alisdead1, try looking at

Alisdead1, try looking at this guide
http://trixbox.org/wiki/database-integrated-dial-plans



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.