Ringgroup CID name prefix problem

Hi,

CID name prefixes on ringgroups works, just not quite how I would have liked it to work.
I’m using 2.1.3 and would like to use a prefix on ringgroups to identify how calls are coming in.
For calls originating from PSTN numbers no “name” is sent with the caller id, just the number.
Without a CID name prefix set the originating number is displayed on the phone, but with a CID name prefix set only the prefix is displayed.

Would it be possible to combine the caller id number and CID prefix if the name is blank?

Thanks

OK, so this is my first time editing a real asterisk config…

Adding

[code:1]
exten => 1,n,GotoIf($["${CALLERID(name)}" = “”]?COPYNUM)
exten => 1,n(COPYNUM),Set(CALLERID(name)=${CALLERIDNUM})
[/code:1]
right before

[code:1]
exten => 1,n,GotoIf($["${CALLERID(name):0:${LEN(${RGPREFIX})}}" != “${RGPREFIX}”]?NEWPREFIX)
[/code:1]
in extensions_additional.conf [ext-group] results in setting CallerID to “prefix CALLERID” when CALLERID(name) is empty, it also probably sets CALLERID(name) to CALLERIDNUM even if CALLERID(name) is set, however I barely understand the syntax.