And what if during an incoming call instead of a callless number you see on your phone something like “OOO Stroypostavka” or “Ivanov Semyon Petrovich”, received from the base of your clients and counterparties.
It will be very convenient, is not it?
And it is implemented very easily.
Traditionally, I will consider two options - for FreePBX, and for the "pure" Asterisk.
General preparations')
First you need to create a table in the database:
CREATE TABLE `companies` ( `name` CHAR(150) NOT NULL, `number` BIGINT UNSIGNED NOT NULL, PRIMARY KEY (`number`) );
and fill it with a list of customers, employees, and so on. This list can be easily imported via intermediate CSV from 1C, Active Directory, various CRM and address books using a variety of available utilities, from HeidiSQL to PHPMyAdmin, and this part should not create problems.
FreepbxIn the Caller ID Lookup Sources menu, you need to add the source type: MySQL, set the server address, login, password, and specify in the query field:
SELECT name FROM companies WHERE number LIKE CONCAT('%',SUBSTRING('[NUMBER]',-7));
and in the inbound routes menu, select the newly created lookup source from the drop-down list.
Asterisk communications framework - that is, “pure” AsteriskThe following lines should be added to the dialplan:
exten => foo,n,MYSQL(Connect connid localhost cdr cdrpass asterisk) ; , , , . exten => foo,n,GotoIf($["${connid}" = ""]?nodb) ; exten => foo,n,MYSQL(Query resultid ${connid} SELECT name FROM companies WHERE number="${CALLERID(num)}" LIMIT 1) exten => foo,n,MYSQL(Fetch fetchid ${resultid} name) exten => foo,n,MYSQL(Clear ${resultid}) exten => foo,n,Set(CALLERID(name)=${name}) exten => foo,n,MYSQL(Disconnect ${connid}) exten => foo,n(nodb),NoOp(DoneDB)
Well that's all.