Diversion header

Voipy

New Member
Feb 5, 2026
16
0
1
56
When I set a call forward on an extension, and I enable the diversion header in the dialplan for call_forward_all, it correctly adds the diversion header which is a legal requirement for us.

When setting a call forward in a ring group it doesn't - but this is because the ring group doesn't actually forward the call. It transfers it I think. I am unsure how to deal with this. One way is to ask people to set a call forward with a prefix before the number, say 999, and then create an outbound route that adds a diversion header when a number starts with 999, and then strip the prefix again before sending it out. This works - the only downside is that customers invariably forget this so it's not ideal

Any ideas around this?
 
What I do is I set a tag on all inbound calls. When placing an outbound call, if the tag condition is met, I automatically add diversion header, as this assumes that the call is being forwarded.
Any call without a tag means that the outbound CID was set from the system and can safely be passed with Attestation A
 
Hi

Am not familiar with tags or attestation A which I believe is related to stir/shaken. Can you elaborate a little more of how a tag would work ?
 
giving the tag some more thought - I don't think that will work. If I set a tag on an inbound call, and the call goes to a ring group with a call forward, AND the user decides to use their caller ID rather than the one of the original caller, it will set a diversion header but will then have both the diversion and the pai as the same number. That will raise fraud flags I think. A diversion header must have the number that was diverted from, as well as the original caller's caller ID
 
I have figured out the tagging - sort of and added an outbound route that matches the tag - and set a diversion header there. Indeed that works. Not sure if it is the best solution but it's the best one so far I reckon, despite the odd scenario where it may be an issue.. Thanks for the head's up on that one!
 
I have figured out the tagging - sort of and added an outbound route that matches the tag - and set a diversion header there. Indeed that works. Not sure if it is the best solution but it's the best one so far I reckon, despite the odd scenario where it may be an issue.. Thanks for the head's up on that one!
That’s exactly what I did. May not be the most perfect solution but it does the job.

The alternative that comes to mind is to create a lua script for each outbound call. The lua script runs a Postgres query against your configured DIDs. If there’s a match, then no diversion header is set (and attest A for stir shaken). If no match, then set a diversion header (and attest C for stir shaken)

I was going to take the above route until I realized I can just set a tag. We really don’t have any cases where the ring group is ringing an external number but forcing the company caller ID. Anyone who has the ring group forward to an outside number wants the original CID to be forwarded as well