The longer answer is to open a bug report now and reference this thread. But the correct problem is that the outbound route CID is not applied to FM/FM calls to external numbers. Because the title of this thread is not correct.
For a call to an extension with FM/FM enabled and has an external number in the follow me list the:
- outbound CID defined in the extension is applied if present.
- outbound CID defined in the outbound route is NOT applied if present.
- outbound CID defined in the trunk is applied if present.
Edit: The above decision is made in /etc/asterisk/extensions_additional.conf
in the auto generated route contexts. Specific to my system i checked this on it is [outrt-1] ; Normal_Out
exten => _NXXNXXXXXX,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => _NXXNXXXXXX,n,Gosub(sub-record-check,s,1(out,${EXTEN},dontcare))
exten => _NXXNXXXXXX,n,Noop([TRACE](1) Calling Out Route: ${SET(OUTBOUND_ROUTE_NAME=Normal_Out)})
exten => _NXXNXXXXXX,n,ExecIf($[ "${CALLEE_ACCOUNCODE}" != "" ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE}))
exten => _NXXNXXXXXX,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => _NXXNXXXXXX,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${DB(AMPUSER/${AMPUSER}/outboundcid)})}=0 & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE="Bundy Associates" <16364413926>))
exten => _NXXNXXXXXX,n,Set(_NODEST=)
exten => _NXXNXXXXXX,n,Macro(dialout-trunk,2,1${EXTEN},,on)
exten => _NXXNXXXXXX,n,Macro(dialout-trunk,9,1${EXTEN},,on)
exten => _NXXNXXXXXX,n,Macro(dialout-trunk,3,1${EXTEN},,on)
exten => _NXXNXXXXXX,n,Noop([TRACE](3) All trunks failed calling ${EXTEN}, playing default congestion)
exten => _NXXNXXXXXX,n,Macro(outisbusy,)
Specifically, this line.
exten => _NXXNXXXXXX,n,ExecIf($["${KEEPCID}"!="TRUE" & ${LEN(${DB(AMPUSER/${AMPUSER}/outboundcid)})}=0 & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE="Bundy Associates" <16364413926>))