Add prefix to Caller ID

I’d like to add a Caller ID prefix to all call passed to a selected trunk.

This trunk receive an intra company route.

I want to use the same trunk prefix used inside the route for the trunk CID prefix.

Where is the best place to put the code to modify the caller id passed on the trunk ?

The goal of this is to avoid authentication problems because the two asterisk boxes linked by this trunk do have the same extension set.

When the sending trunk pass the intra company CID, the receiving box check this caller id and find it inside the local database.

Then asterisk try to authenticate according to the local passwords, and answer with a 403 forbidden.

This seems to me a strange behavior.

Normaly SIP calls should be authenticated from the authentication name, not from the from field caller ID…

Perhaps someone can answer with a better solution than changing the source caller id with a prefix ?