SUGGESTIONS New FreePBX SmartRoutes Module

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
What appears to be a very sophisticated Smartroutes module for FreePBX has just been released. It lets you use MySQL databases to route incoming calls and was developed specifically for call centers but should have broader application as well. You can read all about it in this ticket.

The module is available in the PIAF Source Repo as well as from the FreePBX site.

Context-sensitive help is built into the module, and additional documentation should be available in a couple weeks.

Special thanks to Jay Reeder for the heads up.


SmartRoutes is a module that allows you to control inbound call routing based on external database values.

Using SmartRoutes you can route incoming calls to the appropriate queue (skills based routing), you can automatically route calls from one trunk to another (sip->tdm gateway), you can set variables in the dial plan (like cdr, caller id name, etc), strip unnecessary caller-id and did prefixes from inbound calls, and much more based on the caller id, did called or other asterisk call values.

We're using this on multiple Asterisk installs for various functions. In one case we're using it to create a simple type of SBC or SIP->TDM gateway that receives SIP calls from various vendors and looks up the DID in our CRM database to figure out if the call should be routed out one of the TDM trunks to one of the Enhanced Services Platforms or down the MPLS (SIP) to our live call center (another Asterisk server). If the MPLS fails then the call is routed out over TDM to arrive at the call center via PSTN trunks.

In each of the call centers using this module, it will lookup the customer account based on DID and determine the "Priority" of that customer and route to the appropriate queue. At the same time it pulls the account number and assigns to the CDR(userfield) and sets the account name as the caller id prefix.


The module supports both MySQL and ODBC database access. MySQL is pre-installed with AsteriskNOW and is easy to use but unfortunately it is unreliable and causes asterisk restarts in our 1.4 and 1.6 versions. ODBC support is preferable and the module will auto-manage the func_odbc.conf entries.

Additionally there is support for a feature to reset the FROM_DID and the callerid(num) to strip unnecessary prefixes. Some SIP providers pad those numbers with prefixes that might be incompatible if the call is switched back out through another SIP provider (or to an Enhanced Services Platform).

Full support for standard inbound route features (including fax) is included.

This module has been tested with FreePBX 2.7 and 2.8 / Asterisk 1.4.26 and 1.6.2.7


We're working on comprehensive documentation in web pages. It may be a week or so from being done. For now, the module has a few paragraphs on the main page and then each field has context sensitive help in the label hover.

Next we're going to add 2 yes/no questions where:


1) it will allow you to execute smartroutes before the static inbound routes so that you can dynamically divert to dynamic or alternate static routes (using EXTEN translation) based on call volume or some other variable. If there's not a smartroute match that would redirect the call then it would go on to process the static routes. An example in our call center would be that instead of sending to straight to queue, hit a high volume announcement first and then forward to queue.


2) it will track the "current calls" as described below in a table that could be used to handle dynamic routing changes such as 'High volume diversion'


Sample applications would be:


- for example to have your static routes handle the incoming calls and (in the call center) where you forward static routes to a queue, it could pass through a smart-route that simply sends the call to a queue but first checks for that 'high volume' metric and divert to a lower priority queue if a single account is flooding you (after xx calls get through).


- we could do the easy one of per-did simultaneous call limits if we wanted so that after the initial IVR, if there are too many calls for a specific customer, they get the high volume message before going into a lower priority queue.


- in the answering service industry, some customers will call forward their lines to us around 5pm and agents have to stop taking regular calls so that they can answer these calls where lines are being forwarded. Sometimes there are many lines per customer. We could automate/eliminate that with the smartroutes module. We could identify the window (time of day) using SQL HOUR(CURTIME()) and recognize the caller-id and divert to an IVR so that our staff isn't bombarded answering those calls. The IVR would give them the ability to hit a key and speak to a rep (if necessary) but it would auto-answer when they call forward and then they could just hang up.
 

blanchae

Guru
Joined
Mar 12, 2008
Messages
1,910
Reaction score
9
MySQL is pre-installed with AsteriskNOW and is easy to use but unfortunately it is unreliable and causes asterisk restarts in our 1.4 and 1.6 versions.


Strange comment? I've never heard of any issues with MySQL before, I wonder if it is due to this module?
 
Joined
Feb 17, 2011
Messages
2
Reaction score
0
I was pointed in this direction and thought I'd help shed some light on the MySQL issue. I know it sounds strange, but if you're doing high volume with many transactions through app_mysql on Asterisk, you will have issues with Asterisk restarting (and hanging up on active callers). Some people don't even know it happened and others aren't sure what's causing it. All of our experiences were long before the Smartroutes module was written.

Note that Digium has been recommending for some time that people avoid app_mysql. Most recently:

lmadsen (administrator) 2010-09-15 15:09:
"Additionally, I would suggest you not use the MYSQL() dialplan application. Much more work has gone into res_odbc and func_odbc modules, and is the recommended method for MySQL interaction from the database. Not only is it more stable and better supported, your dialplan will become a lot simpler. In most cases 5-7 lines of dialplan for MYSQL() can be dropped into a single line since transaction support and all that jazz does not need to be done explicitly from the dialplan (it is handled by the module)."
https://issues.asterisk.org/view.php?id=17964

Re: Preferred method for mysql database interaction.
by malcolmd » Mon Dec 13, 2010 8:42 am
"The ODBC connector is the preferred method for connecting to DBs." "The ODBC connector is the one that's preferred because it's the easiest one for us to support - they're doing all of the abstraction to other DBs for us, so we don't have to worry about the intricacies."
http://forums.digium.com/viewtopic.php?f=13&t=76449

In this new book on Asterisk by developers from Digium, they mention that app_mysql has been deprecated for odbc:

http://ofps.oreilly.com/titles/9780596517342/ch02.html#asterisk-CHP-5-SECT-1 (and search the page for app_mysql).


BTW - We've just released the new version of smartroutes that does call tracking to allow "call traffic shaping" so that you can query on the number of active calls to a given DID and if over a certain amount you can route them to a "high call volume" announcement or to a lower priority queue.

-- Jay
 

drmurdoch

Member
Joined
May 26, 2008
Messages
576
Reaction score
11
Thanks.

smartroutes-1.1.tgz 20-Feb-2011 11:40 36K
smartroutes-1.2.tgz 25-Feb-2011 08:20 41K
smartroutes-1.3.tgz 05-Mar-2011 14:00 41K
 

tallship

Member
Joined
Mar 16, 2011
Messages
37
Reaction score
3
It appears that development on this module is proceeding at a rapid pace.

I'm looking for something with this capability, but I'm wondering if it has stabilized yet considering the amount of point releases in such a short amount of time.

I don't want dropped calls where it can be avoided, am anxious to implement the features of this module, although would like to know if it is still plagued with the problems cited above and in the tickets that are linked to above.

Thanks,

Bradley

--
Registered Linux User #190795

- "Ask Bill why the string in [MS-DOS] function 9 is terminated by a dollar sign. Ask him, because he can't answer. Only I know that." - Dr. Gary Kildall.
 
Joined
Feb 17, 2011
Messages
2
Reaction score
0
Tallship,

Now that Freepbx 2.9 has stabilized and we've tested a bit against it, the smartroutes module should be pretty stable at this point. We put out a final release today that addresses issues regarding the new bootloader for 2.9 but otherwise we've seen stable operation with no reported issues over a couple months.

We're also about to publish an ODBC install/management module for FreePBX that will handle odbc install, driver install (mysql, mssql, postgresql), dsn config (including asterisk res_odbc) all within FreePBX with nice user-friendly forms.

-- Jay
 

pbxtest

Member
Joined
Nov 29, 2013
Messages
49
Reaction score
6
Sorry to resurrect an old thread ....

I am running PIAF green. I downloaded and (tried) to install odbcadmin-0.9.9.tgz from here http://mirror.freepbx.org/modules/release/contributed_modules/ but it's throwing an error;

The following error(s) occurred processing the uploaded file:

* File extracting to invalid location: ./._odbcadmin

Any compatible versions of the ODBC admin around? Or any other modules for configuring ODBC/TDS connections? (supports SQL Server)
 

pbxtest

Member
Joined
Nov 29, 2013
Messages
49
Reaction score
6
give you an indication of how much support is available to you if you run into problems.

Yeah, good point. Maybe I'll set up a test environ in a VM and try it there, so if I have problems ... no big loss.

Do you know of any other modules for managing database connections, specifically sql server? I was trying to point the CDR database to an external sql server, but couldn't quite get it working. I saw you can change the settings in FreePBX > Settings > Advanced Settings, but there's no option for sql server, only: mysql and postgres.


 

Members online

No members online now.

Forum statistics

Threads
25,779
Messages
167,505
Members
19,199
Latest member
leocipriano
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top