CF Bug or by design?

If I forward a extension to cellphoneA and make a call from cellphoneB to the extension, I expect the system to setup a new call from the extensions CID with remotepartyID cellphoneB to cellphoneA.
But it setup a call from cellphoneB with remotepartyID cellphoneB to cellphoneA.
I use u siptrunk, not accounts.
I can block foreign CID’s in the trunk and set a CID, that stops setting up calls with numbers we dont own (makes our sipprovider happy), but that makes the CDR’s we get from our sipprovider useless.
I also tried to change $AGI->set_variable(’__KEEPCID’,‘TRUE’);
in dialparties.agi to $AGI->set_variable(’__KEEPCID’,‘FALSE’);
But cant see any change.
Is this a bug?
Is this behavior by design for a reason?
Or is there another way to setup a new call from the extensions CID with remotepartyID cellphoneB to cellphoneA?

that’s normal and the options in the trunk are normal. If you need to do something like setup DIVERSION headers then at the moment you will have to do that manually in something like macro-dialout-predial-hook (I think that is what it is called).

You are welcome to open up a feature request if there is not one already that would add a DIVERSION header to calls that are forwarded (or follow-me or equivalents). However, there may be some limitations when using device side CF that may not end up getting the header unless there are some options inside of Asterisk that can do that (there may be some other ways it could be done as well, would have to dig further).

What could get more complicated is if there are multiple chained CFs and getting the proper DIVERSION Headers setup.

I like that the system setup a new call instead of sip diversion.
Even if you divert a call, the cdr’s will be a problem.
With a new call I have nice cdr’s.
So I hope there is a way to setup the new call with the right number.
I tried in Asterisk Dial command options f and o, but cant see any change in behavior.
Our system is Asterisk 1.4.35 with FreePBX 2.8 all modules installed and up to date.

A DIVERSION header is not a DIVERSION.

You can setup a new call and add a Diversion header to it which would indicate who the original call was intended for but still put the original CID of the first caller.

It really comes down to what you and/or your provider are actually looking for. The Diversion header is useful/required by some providers and not used at all by many others.

I’m not really clear what you are looking for otherwise. There are more options with Follow-Me and Ring Groups to control CID information that might be of interest, there are not other options at the moment with CF though.