Never Override CallerID

Hello All!,

I was having problems with the option Never Override CallerID, and some extensions where I’ve set the Outbound CID option. I’ve one SIP Trunk, with the Nerver Override CallerID option set with a defined Outbound Caller ID, but when I try to call out through one of the extensions with an Outbound CID set, this CID is set over the trunk one, and the call is rejected. I have done a change in the “macro-outbound-callerid” to make this work:
exten => s,1,GotoIf($["${REALCALLERIDNUM:1:2}" != “”]?start)
exten => s,n,Set(REALCALLERIDNUM=${CALLERID(number)})
exten => s,n(start),Noop(REALCALLERIDNUM is ${REALCALLERIDNUM})
exten => s,n,GotoIf($[“x${OUTKEEPCID_${ARG1}}” = “xon”]?lineacid)
exten => s,n,GotoIf($["${KEEPCID}" != “TRUE”]?normcid)
exten => s,n,GotoIf($[“foo${REALCALLERIDNUM}” = “foo”]?normcid)
exten => s,n,GotoIf($[“foo${DB(AMPUSER/${REALCALLERIDNUM}/device)}” = “foo”]?bypass:normcid)
exten => s,n(normcid),Set(USEROUTCID=${DB(AMPUSER/${REALCALLERIDNUM}/outboundcid)})
exten => s,n(bypass),Set(EMERGENCYCID=${DB(DEVICE/${REALCALLERIDNUM}/emergency_cid)})
exten => s,n(lineacid),Set(TRUNKOUTCID=${OUTCID_${ARG1}})
exten => s,n,GotoIf($["${EMERGENCYROUTE:1:2}" = “”]?trunkcid)
exten => s,n,GotoIf($["${EMERGENCYCID:1:2}" = “”]?trunkcid)
exten => s,n,Set(CALLERID(all)=${EMERGENCYCID})
exten => s,n,Goto(report)
exten => s,n(trunkcid),GotoIf($["${TRUNKOUTCID:1:2}" = “”]?usercid)
exten => s,n,Set(CALLERID(all)=${TRUNKOUTCID})
exten => s,n(usercid),GotoIf($["${USEROUTCID:1:2}" = “”]?report)
exten => s,n,Set(CALLERID(all)=${USEROUTCID})
exten => s,n,GotoIf($[“x${CALLERID(name)}”!=“xhidden”]?report:hidecid)
exten => s,n(hidecid),SetCallerPres(prohib_passed_screen)
exten => s,n(report),Noop(CallerID set to ${CALLERID(all)})

(lines 4 and 11)

And now it’s working. Is this a bug, or is something I’m doing wrong?


read the tooltip of Never Override CallerID, it means it will not override the CID if the CID comes from a foreign source, if it is specified on your box (e.g. outboundcid of an extension) it will honor that.

Ok, thanks Philippe. So, I should deactivate it to make my SIP line works?

Philippe, I can’t make it work as I like even unchecking the option.
If I want to make this change permanent (even Apply Configuration Changes is clicked), where can I modify it?


Is it possible to force the trunk to only use the specified caller ID? Some VoIP providers insist on a particular caller ID, whereas other allow you to override it. I have extensions that give out my normal land line number as the callerID for VoIP providers where I don’t have an inbound number, but when a call goes out over the restricted trunk it fails as the caller ID does not match that the provider is expecting.

Could the Never Override CallerID be changed from a tickbox to a drop down giving several options:
Allow Any CallerID
Only allow Local CallerID (specified on trunk or extension etc.)
Only use Trunk CallerID

Should I log this as a feature request?




It is considered impolite to hijack a thread, specially in the middle with a different question (yes it is about the same general subject). More important your question is different and because of that it might get missed instead of it being posted as a new question where they will see your subject line instead of the first posts subject line.

It is a good idea to start a new thread, but to cut to the chase, that is a feature request and should be put in the tracker as such or it will get lost. It is a reasonable request.

Apologies everyone. I didn’t know it would put the message in the middle of the thread. I clicked on reply to the most relevant message assuming it would be quoted and appear at the end.

I thought it was relevant as it was a suggestion on how to fix the problem the initial poster (and I) have.

I will add it as a feature request.