Transfer calls based on CID

Hello everyone. We have a CRM that keeps tracks of the salesmen and each one of them has a specific client list. So, I want the CRM to write in a database of freepbx the CID’s, the extension of the user (salesman) and the client’s name and freepbx to transfer the inbound calls (based on CID) to the specific extensions from the database plus show the name of the client on the extension. We can handle the CRM part, but unfortunately I don’t know how to code in the freepbx (only UI stuff). Does anyone have any idea how to do this?

That sounds like a Feature Request for the Commercial CRM module.

Failing that, I can think of a couple of ways to do it, but they are all custom code. @comtech might have some good ideas (he’s really good at this kind of stuff), but he won’t come cheap.

1 Like

If anyone wants to do this (paid service of course), please send me a message.

The third party module, Dynamic Routes would probably do everything you need for the GUI end, it then just falls to a dev to create an AGI in order to pull the info from the API or database or whatever. We can assist at Sangoma Support (support link above).

By AGI I don’t think you mean Artificial General Intelligence :slight_smile: . What is AGI?

You wrote about the support link, can you please point me at the right direction, because I cannot find the link?

Also, how do I install the module? EDIT-found it, anyone interested:

This doesn’t seem like a two-way street, communication-wise. If you’re willing to do a little work, you might be able to build something in the GUI that would achieve your ask. This would give you an idea of if what you ultimately need lines up with your original ask. That way if you pay, you don’t have to pay twice.

  1. Transfer the customer Caller ID Numbers and Names to the Asterisk Phonebook (Admin>Asterisk Phonebook). This could be done via GUI entry, excel import, or if you know SQL you could write to the table directly.

  2. On the inbound route, turn on superfecta, then use the caller’s number, making the destination the sales person’s extension.

The caller would call in, their name would get applied from the Asterisk Phonebook, then route to the salesman extension with the name presented. Is that what you are looking to do?

The neat thing with this approach is it could be done and maintained via the GUI, or with spreadsheets, or direct writes to the tables (whatever your skill level necessitates). It is worth mentioning that the phonebook is deprecating, but I wouldn’t expect that to cause you a problem in the foreseeable future.

comtech, pretty smart but (my fault-didn’t mentioned it), I need the salesmen to change also from time to time (clients move from salesman to salesman). Your solution, though elegant doesn’t allow me to change the extension dynamically (from db table).

Maybe use your solution and bulk handler to create custom DID’s? Also can you please tell me where to find the db tables for superfecta and bulk handler? (superfecta - cool name by the way, they should make a movie out of this)

As mentioned before, you could manage and update this entirely from the GUI, even in bulk with the import export functions.

If you are looking to do something more on the DB backend, then review these posts. They will give you everything you are looking for (asterisk phonebook, inbound route table and how to enable superfecta in bulk).

If you are adding things directly to the tables, be careful with the inputs (the risk of breaking something increases without the safeguards of the GUI), and don’t forget to reload FreePBX for the updates to take effect (adding data to the tables without reloading will not work).

Good luck, and please share your approach and results. It will no doubt help others looking to do this in the future.

Here are the wikis, incase you wanted to stick to using the GUI.

I have found a solution which works with dynamic routes module. Connected to the db, everything works ok. The only problem is that I need a message to play after the successful hit on the db (for example the message plays “Your selection is correct, I’m connecting you”. Unfortunately dynamic routes doesn’t have a way to play this message. Tried the “Saved input variable name” and point the successful return from the db to another dynamic route, play the recording and then search the db again using as variable the one saved in the previous dynamic route (from “Saved input variable name”). Unfortunately doesn’t work. Any ideas?

Does anyone know how “Saved input variable name” and " Saved result variable name " from dynamic routes work?

What would you do with the “no match”?

Could you have just one DB check? For the inbound routes, route to an announcement instead of the extension, make the announcement connect to the extension after it is done playing. The announcement would play the “Your selection is correct, I’m connecting you” message.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.