Open lgaetz opened 10 years ago
This needs to be a post-processing module, not another global option
I think we are on the same page but want to make sure. You are saying the code to add CID/CNAM to APB goes in the post processing function of source-Asterisk_Phonebook.module
correct?
Yes. We are on the same page :+1:
As part of coding this change, I have discovered in ver. 2.11.5 that the variable $winning_source is not being passed properly to the post_processing function; it always seems to be blank. I see that $winning_source is supposed to be set on line 62 of /processors/superfecta_single.php
with the line:
$winning_source = $data;
edit 1: Line 103 same file calls post_processing function with NULL always passed as $winning_source param. Will code assuming that $winning source is not available.
edit 2: $this->astman class is not available in the post_processing function. This feature request is turning into a mess. I think this will be another whole issue.
edit 2: should be resolved now.
The rest I leave up to you. Though I can look into it at some point
Since 2.11 no longer uses the FreePBX module Caller ID Lookup Sources, it is no longer possible to automatically cache results to the Asterisk Phonebook.
I suggest modifying the 2.11 module to include a user checkbox to enable caching. Then in post processing push the CID/CNAM to the APB provided the winning source is not already the APB. Need to be mindful of any user supplied or SPAM prefixes so they don't get cached (if possible).