Remote Call Forwarding & Caller ID

UCtech

Member
Jan 9, 2019
40
7
8
Having some trouble with FusionPBX 5.3 and CallerID with remote call forwarding. Caller ID is set on each extension and works well locally and outbound to the SIP provider O.K.
However, when forwarding using the Call Forward app in Fusion, there is a problem when the forward is remote. So when someone calls from outside and then call forward is set to go back out, like someone calls from a cell phone from outside and the call forward then forwards to someone else's cellphone, Fusion takes the CallerID from the Originating call and passes it all the way through back out. The SIP provider then rejects the call as the CallerID is not authorized (in my case Twilio).

So in the older versions of FusionPBX I had resolved this by setting the default_caller_id in the dialplan to a fixed number for the organization that was authorized for the SIP provider. This only seemed to affect the CallerID of any extension where the CallerID setting was not filled in, and then for Call Forward it also would set this outbound when someone called remotely and then the call forwarded back out. Not perfect but at least calls would always work.
But recently I did a clean install of Fusion 5.3 and then set it up from scratch again as so many things had changed. I found the way the dialplan works in 5.3 is substantially different in especially these areas. Setting the default_caller_id does not appear to affect call forwarding as before. However, there are now settings in the dialplan under call-forward-all that were not there in the older versions that seem to be able to do what is needed. In the lower section of call_forward_all if I set outbound _caller_id_number to a specific number as I had done before for default_caller_id it works. Not sure if this is the intended way to do this or the best, but it works. Ideally I would think it better to set outbound_caller_id_number to the caller ID setting of the extension, but I don't know how to do that (any suggestions welcome!).
 

UCtech

Member
Jan 9, 2019
40
7
8
However, with this fix/workaround, remote call forwarding and the caller ID is not working when someone has call forwarding turned on in their individual phone (and not using the Call Forward App in Fusion). In this case it appears that basic routing is used and not the call_forward_all in the dialplan. The Fusion logs show [effective_caller_id_number]=[UNDEF] and then the call is rejected by the SIP provider due to invalid CallerID.

I can force all outbound caller ID to a number by setting outbound_caller_id_number=myDID just before the set effective_caller_id_number=$(Outbound_caller_id_number) in the outbound route, but then that sets the same caller ID for all outbound calls and not just call forwards. So if anyone knows how to work around or fix this I would be most appreciative!
 
Last edited:

whut

Active Member
Dec 23, 2022
276
30
28
You could create a dialplan for each domain that executes before your outbound routes where you have a condition for outbound caller ID name and outbound caller ID number are not set, then set them to xyz... and 123...
 

markjcrane

Active Member
Staff member
Jul 22, 2018
568
202
43
50
Adding to the last message there is a dialplan called that can be used to set the default caller ID when the caller ID is not set.

default_caller_id

Another option is to disable forwarding on the phone to prevent this from happening. There are additional options as well.
 

UCtech

Member
Jan 9, 2019
40
7
8
@whut I don't think that will work in my case as I have too many different unique outbound callerID's within the same domain, unless there is another way?
 

UCtech

Member
Jan 9, 2019
40
7
8
@markjcrane default_caller_id seems to only add the callerID if not set on an extension in newer versions of Fusion. That used to work in older versions for remote call forwarding but I have not been able to get it to work in 5.3, not sure why. In my testing, if the call forward is set in the Fusion App, then the remote callerID is used and passed all the way through even if default_caller_id is set (and then the call is rejected by the SIP provider). If the call forward is set on an individual phone and not in the Fusion App, then no callerID is passed through and the logs show the [effective_caller_id_number]=[UNDEF], and then the call is also rejected by the SIP provider. I can replicate this on both my test and production system, and I have a workaround for when the remote call forward is set using the APP, but not for when it is set using an individual phone. Any ideas on how to put something in the dialplan that would only apply to call forwards set on individual phones?