Quantcast
Channel: FreePBX Community Forums - Latest posts
Viewing all articles
Browse latest Browse all 226645

Override a core context

$
0
0

Hello,

I would like to override macro-outbound-callerid so i can check for assigned variable and set __KEEPCID=TRUE if condition is true.
As i read in documentation, i should add the override in /etc/asterisk/extensions_override_freepbx.conf
It works as expected when i add it - the main purpose is keep original CID if caller is comming from PSTN and the call flow is a forward to external number:

[macro-outbound-callerid]
include => macro-outbound-callerid-custom
exten => s,1,Noop(${REALCALLERIDNUM})
; Addring logic to keep cid if forwarding
exten => s,n,NoOp(From PSTN=${FROM_PSTN}}
exten => s,n,ExecIf($["${FROM_PSTN}" != “”]?Set(KEEPCID=TRUE))
; eob
exten => s,n,Noop(${KEEPCID})
exten => s,n,Noop(${OUTKEEPCID
${ARG1}})
exten => s,n,ExecIf($["${CALLINGNAMEPRES_SV}" != “”]?Set(CALLERPRES(name-pres)=${CALLINGNAMEPRES_SV}))
exten => s,n,ExecIf($["${CALLINGNUMPRES_SV}" != “”]?Set(CALLERPRES(num-pres)=${CALLINGNUMPRES_SV}))
exten => s,n,ExecIf($["${REALCALLERIDNUM:1:2}" =""]?Set(REALCALLERIDNUM=${CALLERID(number)}))
exten => s,n,ExecIf($[$["${CIDMASQUERADING}" = “TRUE”] & $[$["${AMPUSER}" = “”] | $["${AMPUSER}" = “${DB(AMPUSER/${FROMEXTEN}$
exten => s,n(start),GotoIf($[ $[”${REALCALLERIDNUM}" = “”] | $["${KEEPCID}" != “TRUE”] | $["${OUTKEEPCID
${ARG1}}" = “on”] ]?$
exten => s,n,Set(USEROUTCID=${CALLERID(name)} <${REALCALLERIDNUM}>)
exten => s,n,GotoIf($["${CIDMASQUERADING}" = “TRUE”]?normcid)
exten => s,n,GotoIf($["${DB(AMPUSER/${REALCALLERIDNUM}/device)}" = “” & “${DB(DEVICE/${REALCALLERIDNUM}/user)}” = “”]?bypass)
exten => s,n(normcid),Set(USEROUTCID=${DB(AMPUSER/${AMPUSER}/outboundcid)})
exten => s,n(bypass),Set(EMERGENCYCID=${DB(DEVICE/${REALCALLERIDNUM}/emergency_cid)})
exten => s,n,Set(TRUNKOUTCID=${OUTCID_${ARG1}})
exten => s,n,GotoIf($["${EMERGENCYROUTE:1:2}" = “” | “${EMERGENCYCID:1:2}” = “”]?trunkcid)
exten => s,n,Set(CALLERID(all)=${EMERGENCYCID})
exten => s,n,GotoIf($["${CALLERID(name)}" = “”]?cnum)
exten => s,n,Set(CDR(outbound_cnam)=${CALLERID(name)})
exten => s,n(cnum),Set(CDR(outbound_cnum)=${CALLERID(num)})
exten => s,n(exit),MacroExit()
exten => s,n(trunkcid),ExecIf($[${LEN(${TRUNKOUTCID})} != 0]?Set(CALLERID(all)=${TRUNKOUTCID}))
exten => s,n(usercid),ExecIf($[${LEN(${USEROUTCID})} != 0]?Set(CALLERID(all)=${USEROUTCID}))
exten => s,n,ExecIf($[${LEN(${TRUNKCIDOVERRIDE})} != 0 | ${LEN(${FORCEDOUTCID_${ARG1}})} != 0]?Set(CALLERID(all)=${IF($[${LEN$
exten => s,n(hidecid),ExecIf($["${CALLERID(name)}"=“hidden”]?Set(CALLERPRES(name-pres)=prohib_passed_screen))
exten => s,n,ExecIf($["${CALLERID(name)}"=“hidden”]?Set(CALLERPRES(num-pres)=prohib_passed_screen))
exten => s,n,Set(CDR(outbound_cnum)=${CALLERID(num)})
exten => s,n,Set(CDR(outbound_cnam)=${CALLERID(name)})

;–== end of [macro-outbound-callerid] ==–;

All ok but when i reload dialplan it shows WARNINGS:
[2019-10-04 18:04:18] WARNING[26512] pbx_config.c: Context ‘macro-outbound-callerid-custom’ already included in ‘macro-outbound
-callerid’ context on include at line 5457 of /etc/asterisk/extensions_additional.conf
[2019-10-04 18:04:18] WARNING[26512] pbx.c: Unable to register extension ‘s’ priority 1 in ‘macro-outbound-callerid’, already i
n use
[2019-10-04 18:04:18] WARNING[26512] pbx_config.c: Unable to register extension at line 5458 of /etc/asterisk/extensions_additi
onal.conf
[2019-10-04 18:04:18] WARNING[26512] pbx.c: Unable to register extension ‘s’ priority 2 in ‘macro-outbound-callerid’, already i
n use
[2019-10-04 18:04:18] WARNING[26512] pbx_config.c: Unable to register extension at line 5459 of /etc/asterisk/extensions_additi
onal.conf
[2019-10-04 18:04:18] WARNING[26512] pbx.c: Unable to register extension ‘s’ priority 3 in ‘macro-outbound-callerid’, already i
n use
[2019-10-04 18:04:18] WARNING[26512] pbx_config.c: Unable to register extension at line 5460 of /etc/asterisk/extensions_additi
onal.conf
[2019-10-04 18:04:18] WARNING[26512] pbx.c: Unable to register extension ‘s’ priority 4 in ‘macro-outbound-callerid’, already i
n use
[2019-10-04 18:04:18] WARNING[26512] pbx_config.c: Unable to register extension at line 5461 of /etc/asterisk/extensions_additi
onal.conf
[2019-10-04 18:04:18] WARNING[26512] pbx.c: Unable to register extension ‘s’ priority 5 in ‘macro-outbound-callerid’, already i
n use
[2019-10-04 18:04:18] WARNING[26512] pbx_config.c: Unable to register extension at line 5462 of /etc/asterisk/extensions_additi
onal.conf
[2019-10-04 18:04:18] WARNING[26512] pbx.c: Unable to register extension ‘s’ priority 6 in ‘macro-outbound-callerid’, already i
n use
[2019-10-04 18:04:18] WARNING[26512] pbx_config.c: Unable to register extension at line 5463 of /etc/asterisk/extensions_additi
onal.conf
[2019-10-04 18:04:18] WARNING[26512] pbx.c: Unable to register extension ‘s’ priority 7 in ‘macro-outbound-callerid’, already i
n use
[2019-10-04 18:04:18] WARNING[26512] pbx_config.c: Unable to register extension at line 5464 of /etc/asterisk/extensions_additi
onal.conf

How this could be overriden without error in dial plan ?


Viewing all articles
Browse latest Browse all 226645

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>