We have built a great web tool that gives us a view into the multiple queues that we have and the different callers showing CID of incoming and outgoing calls per person.
One feature I would like to add to this is the ability to pull a CID Name when someone is calling out either using Superfecta or PhoneBook module. This way I, as a user, can see who they are calling in real time. I am currently connected up to the mysql server/databases and the CLI. That means I can pretty much pull anything I need, but I cannot figure out how to pull from the Superfecta or the PhoneBook. Anyone have any ideas?
My thought would be to take the outgoing CID and query either the Superfecta or the PhoneBook to pull back a CID Name if available.
Thank you so much for the information. Below is how we ended up executing on this. We decided to use the ‘get’ command instead of the ‘show’ command within the CLI.
exec("asterisk -rx 'database get cidname " . ltrim($phone_number, "1") . "'", $arr_phonebook_data, $return_var_3);
// Not in the phonebook, set as not available
if($arr_phonebook_data[0] == "Database entry not found."){
$caller_id_name = "Not Available";
// found in phonebook, pull in CNAM
}else{
$arr_phonebook = explode(": ", $arr_phonebook_data[0]);
$caller_id_name = $arr_phonebook[1];
}
Hopefully others find this valuable. So easy to make, no point it using a third party module.
We also setup our system to cache all CID/CNAM results in our phonebook. This allows our database to keep growing so that we do not see “Not Available” as often.