When a call comes into FreePBX, the CallerPresence? information is cached and is reset with SetCallerPresence? if that same call results in being forwarded/followme-ed back out to the PSTN.
There are reports that some carriers, PACTel being one, are rejecting any calls that are set this way, even though Trunk CID information is being transmitted (and the carrier could just say I won't honor that but am sending the call anyhow). This issue has been reported to be seen on carriers who also don't allow foreign caller-id's.
On 2.5 and earlier systems, the best way to consider dealing with this is to always assure the CallerPresence? is set to allowed on trunks checked with Never Override CallerID. Or, just address this on 2.6 and require an upgrade.
The solution on 2.6, now that Trunks has their own table making it easier to address features like this, is to have a setting on the trunk that says it is restricted to 'allowed' standard signaling and not allow it to send blocked/anonymous signaling. This would also address the issue on a trunk that does allow CID to be set at will but happens to have this problem as well.
The following is a patch against 2.5 that can be used to test if it will overcome this issue. We still need to decide if we want to go this route on earlier versions. (The down side is "breaking" systems that don't allow foreign CIDs but does honor the signaling. This means a forwarded call that was originally blocked, when it finally reaches you on your cell phone (for example) will say 'blocked call' triggering you to ignore the call since you don't want to mess with callers who are doing that...
Index: functions.inc.php
===================================================================
--- functions.inc.php (revision 7857)
+++ functions.inc.php (working copy)
@@ -1717,11 +1717,22 @@
// their status if forwarded back out. Not doing this can result in the trunk CID being displayed vs. 'blocked call'
//
if (version_compare($version, "1.6", "lt")) {
- $ext->add($context, $exten, '', new ext_execif('$["${CALLINGPRES_SV}" != ""]', 'SetCallerPres', '${CALLINGPRES_SV}'));
+ $ext->add($context, $exten, '', new ext_execif('$["${CALLINGPRES_SV}" != "" && ${OUTKEEPCID_${ARG1}}" != "on"]', 'SetCallerPres', '${CALLINGPRES_SV}'));
} else {
- $ext->add($context, $exten, '', new ext_execif('$["${CALLINGPRES_SV}" != ""]', 'Set', 'CALLERPRES()=${CALLINGPRES_SV}'));
+ $ext->add($context, $exten, '', new ext_execif('$["${CALLINGPRES_SV}" != "" && ${OUTKEEPCID_${ARG1}}" != "on"]', 'Set', 'CALLERPRES()=${CALLINGPRES_SV}'));
}
+ // if this trunk does not allow foreign callerid, then force it to 'allowed' in case a previous trunk changed it
+ // this was put in because there are some really annoying carriers, who will reject the calls if you send them out
+ // as anonymous/blocked/etc. This really should be a per trunk setting that says never send these states, in any situation
+ // from this trunk.
+ //
+ if (version_compare($version, "1.6", "lt")) {
+ $ext->add($context, $exten, '', new ext_execif('$["${OUTKEEPCID_${ARG1}}" != "on"]', 'SetCallerPres', 'allowed'));
+ } else {
+ $ext->add($context, $exten, '', new ext_execif('$["${OUTKEEPCID_${ARG1}}" != "on"]', 'Set', 'CALLERPRES()=allowed'));
+ }
+
// Keep the original CallerID number, for failover to the next trunk.
$ext->add($context, $exten, '', new ext_execif('$["${REALCALLERIDNUM:1:2}" = ""]', 'Set', 'REALCALLERIDNUM=${CALLERID(number)}'));