Override option

Dear all,

What is the best place / best method to override “LIMIT_PLAYAUDIO_CALLEE=yes” to “LIMIT_PLAYAUDIO_CALLEE=no” on extension file. I have a gotoif conditional statement. If the condition matches, It overrides LIMIT_PLAYAUDIO_CALLEE to “no” But don’t know where should I put this statement.

Previously I thought macro-dialout-trunk-predial-hook is the place because that is the final location on dialplan for trunk outgoing dial. But seems like something else again override predial-hook.

Any clue will be appreciated.

Did you catch this in /etc/asterisk/extensions.conf

.
.; Customizations to this dialplan should be made in extensions_custom.conf
; See extensions_custom.conf.sample for an example.
;
; If you need to use [macro-dialout-trunk-predial-hook], [ext-did-custom], or
; [from-internal-custom] for example, place these in this file or they will get overwritten.
;
; WARNING ABOUT: #include extensions_override_freepbx.conf
;
; This include file is put first to allow the auto-generated dialplan in FreePBX
; to be overwritten if necessary. Overriding auto-generated dialplan should be done
; with extreme caution. In almost all cases any custom dialplan SHOULD be put in
; extensions_custom.conf which will not hurt a FreePBX generated dialplan. In some
; very rare and custom situations users may have a need to override what FreePBX
; automatically generates. If so anything in this file will do that. If you come up
; with situations where you need to modify the existing dialplan or macros, put it
; here.
;
.
.
.

?

Hi
I placed my [macro-dialout-trunk-predial-hook] on extensions_custom.conf. Asterisk debug shows me “LIMIT_PLAYAUDIO_CALLEE=no”. That means it applies the change. But At the last moment from macro macro-dialout-trunk change LIMIT_PLAYAUDIO_CALLEE to “yes” I am confused with this. Are you suggesting me to use extensions_override_freepbx.conf ?

Post a log.

Hi Disko,

Please find the log here with.

See the s@macro-dialout-trunk-predial-hook:4. It set the LIMIT_PLAYAUDIO_CALLEE to “no”. In s@macro-dialout-trunk-predial-hook:5 i echo back the value for LIMIT_PLAYAUDIO_CALLEE and it says value is “no”. Then again in s@macro-dialout-trunk:25 dialplan again set LIMIT_PLAYAUDIO_CALLEE to “yes”

I can’t understand why. :frowning: Any clue will be highly appreciated …

– Executing [s@macro-user-callerid:1] Set(“SIP/4310-0000652e”, “AMPUSER=4310”) in new stack
– Executing [s@macro-user-callerid:2] GotoIf(“SIP/4310-0000652e”, “0?report”) in new stack
– Executing [s@macro-user-callerid:3] ExecIf(“SIP/4310-0000652e”, “1?Set(REALCALLERIDNUM=4310)”) in new stack
– Executing [s@macro-user-callerid:4] Set(“SIP/4310-0000652e”, “AMPUSER=4310”) in new stack
– Executing [s@macro-user-callerid:5] Set(“SIP/4310-0000652e”, “AMPUSERCIDNAME=4305 Joe L4”) in new stack
– Executing [s@macro-user-callerid:6] GotoIf(“SIP/4310-0000652e”, “0?report”) in new stack
– Executing [s@macro-user-callerid:7] Set(“SIP/4310-0000652e”, “AMPUSERCID=4305”) in new stack
– Executing [s@macro-user-callerid:8] Set(“SIP/4310-0000652e”, “CALLERID(all)=“4305 Joe L4” <4305>”) in new stack
– Executing [s@macro-user-callerid:9] ExecIf(“SIP/4310-0000652e”, “0?Set(CHANNEL(language)=)”) in new stack
– Executing [s@macro-user-callerid:10] GotoIf(“SIP/4310-0000652e”, “1?continue”) in new stack
– Goto (macro-user-callerid,s,19)
– Executing [s@macro-user-callerid:19] Set(“SIP/4310-0000652e”, “CALLERID(number)=4305”) in new stack
– Executing [s@macro-user-callerid:20] Set(“SIP/4310-0000652e”, “CALLERID(name)=4305 Joe L4”) in new stack
– Executing [s@macro-user-callerid:21] NoOp(“SIP/4310-0000652e”, “Using CallerID “4305 Joe L4” <4305>”) in new stack
– Executing [0013108013015@from-internal:2] NoOp(“SIP/4310-0000652e”, “Calling Out Route: Find-Me-Follow”) in new stack
– Executing [0013108013015@from-internal:3] Set(“SIP/4310-0000652e”, “MOHCLASS=default”) in new stack
– Executing [0013108013015@from-internal:4] ExecIf(“SIP/4310-0000652e”, “1?Set(TRUNKCIDOVERRIDE=5625993400)”) in new stack
– Executing [0013108013015@from-internal:5] Set(“SIP/4310-0000652e”, “_NODEST=”) in new stack
– Executing [0013108013015@from-internal:6] Macro(“SIP/4310-0000652e”, “record-enable,4310,OUT,”) in new stack
– Executing [s@macro-record-enable:1] GotoIf(“SIP/4310-0000652e”, “1?check”) in new stack
– Goto (macro-record-enable,s,4)
– Executing [s@macro-record-enable:4] ExecIf(“SIP/4310-0000652e”, “0?MacroExit()”) in new stack
– Executing [s@macro-record-enable:5] GotoIf(“SIP/4310-0000652e”, “0?Group:OUT”) in new stack
– Goto (macro-record-enable,s,15)
– Executing [s@macro-record-enable:15] GotoIf(“SIP/4310-0000652e”, “0?IN”) in new stack
– Executing [s@macro-record-enable:16] ExecIf(“SIP/4310-0000652e”, “0?MacroExit()”) in new stack
– Executing [s@macro-record-enable:17] NoOp(“SIP/4310-0000652e”, “Recording enable for 4310”) in new stack
– Executing [s@macro-record-enable:18] Set(“SIP/4310-0000652e”, “CALLFILENAME=OUT4310-20140517-084013-1400341213.37287”) in new stack
– Executing [s@macro-record-enable:19] Goto(“SIP/4310-0000652e”, “record”) in new stack
– Goto (macro-record-enable,s,23)
– Executing [s@macro-record-enable:23] MixMonitor(“SIP/4310-0000652e”, “OUT4310-20140517-084013-1400341213.37287.wav,”) in new stack
– Executing [s@macro-record-enable:24] Set(“SIP/4310-0000652e”, “CDR(userfield)=audio:OUT4310-20140517-084013-1400341213.37287.wav”) in new stack
– Executing [s@macro-record-enable:25] MacroExit(“SIP/4310-0000652e”, “”) in new stack
– Executing [0013108013015@from-internal:7] Macro(“SIP/4310-0000652e”, “dialout-trunk,4,13108013015,”) in new stack
– Executing [s@macro-dialout-trunk:1] Set(“SIP/4310-0000652e”, “DIAL_TRUNK=4”) in new stack
– Executing [s@macro-dialout-trunk:2] GosubIf(“SIP/4310-0000652e”, “0?sub-pincheck,s,1”) in new stack
– Executing [s@macro-dialout-trunk:3] GotoIf(“SIP/4310-0000652e”, “0?disabletrunk,1”) in new stack
– Executing [s@macro-dialout-trunk:4] Set(“SIP/4310-0000652e”, “DIAL_NUMBER=13108013015”) in new stack
– Executing [s@macro-dialout-trunk:5] Set(“SIP/4310-0000652e”, “DIAL_TRUNK_OPTIONS=tTmkK”) in new stack
– Executing [s@macro-dialout-trunk:6] Set(“SIP/4310-0000652e”, “OUTBOUND_GROUP=OUT_4”) in new stack
– Executing [s@macro-dialout-trunk:7] GotoIf(“SIP/4310-0000652e”, “1?nomax”) in new stack
– Goto (macro-dialout-trunk,s,9)
– Executing [s@macro-dialout-trunk:9] GotoIf(“SIP/4310-0000652e”, “0?skipoutcid”) in new stack
– Executing [s@macro-dialout-trunk:10] Set(“SIP/4310-0000652e”, “DIAL_TRUNK_OPTIONS=tTkKc”) in new stack
– Executing [s@macro-dialout-trunk:11] Macro(“SIP/4310-0000652e”, “outbound-callerid,4”) in new stack
– Executing [s@macro-outbound-callerid:1] ExecIf(“SIP/4310-0000652e”, “0?Set(CALLERPRES()=)”) in new stack
– Executing [s@macro-outbound-callerid:2] ExecIf(“SIP/4310-0000652e”, “0?Set(REALCALLERIDNUM=4305)”) in new stack
– Executing [s@macro-outbound-callerid:3] GotoIf(“SIP/4310-0000652e”, “1?normcid”) in new stack
– Goto (macro-outbound-callerid,s,6)
– Executing [s@macro-outbound-callerid:6] Set(“SIP/4310-0000652e”, “USEROUTCID=”) in new stack
– Executing [s@macro-outbound-callerid:7] Set(“SIP/4310-0000652e”, “EMERGENCYCID=”) in new stack
– Executing [s@macro-outbound-callerid:8] Set(“SIP/4310-0000652e”, “TRUNKOUTCID=2134573500”) in new stack
– Executing [s@macro-outbound-callerid:9] GotoIf(“SIP/4310-0000652e”, “1?trunkcid”) in new stack
– Goto (macro-outbound-callerid,s,12)
– Executing [s@macro-outbound-callerid:12] ExecIf(“SIP/4310-0000652e”, “1?Set(CALLERID(all)=2134573500)”) in new stack
– Executing [s@macro-outbound-callerid:13] ExecIf(“SIP/4310-0000652e”, “0?Set(CALLERID(all)=)”) in new stack
– Executing [s@macro-outbound-callerid:14] ExecIf(“SIP/4310-0000652e”, “1?Set(CALLERID(all)=5625993400)”) in new stack
– Executing [s@macro-outbound-callerid:15] ExecIf(“SIP/4310-0000652e”, “0?Set(CALLERPRES()=prohib_passed_screen)”) in new stack
– Executing [s@macro-dialout-trunk:12] GosubIf(“SIP/4310-0000652e”, “1?sub-flp-4,s,1”) in new stack
– Executing [s@sub-flp-4:1] ExecIf(“SIP/4310-0000652e”, “0?Set(TARGET_FLP_4=01113108013015)”) in new stack
– Executing [s@sub-flp-4:2] GotoIf(“SIP/4310-0000652e”, “0?match”) in new stack
– Executing [s@sub-flp-4:3] Return(“SIP/4310-0000652e”, “”) in new stack
– Executing [s@macro-dialout-trunk:13] Set(“SIP/4310-0000652e”, “OUTNUM=13108013015”) in new stack
– Executing [s@macro-dialout-trunk:14] Set(“SIP/4310-0000652e”, “custom=SIP/Teliax-backup”) in new stack
– Executing [s@macro-dialout-trunk:15] ExecIf(“SIP/4310-0000652e”, “0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^default)tTkKc)”) in new stack
– Executing [s@macro-dialout-trunk:16] Macro(“SIP/4310-0000652e”, “dialout-trunk-predial-hook,”) in new stack
– Executing [s@macro-dialout-trunk-predial-hook:1] NoOp(“SIP/4310-0000652e”, “Trunk SIP/Teliax-backup selected”) in new stack
– Executing [s@macro-dialout-trunk-predial-hook:2] GotoIf(“SIP/4310-0000652e”, “0?skip”) in new stack
– Executing [s@macro-dialout-trunk-predial-hook:3] NoOp(“SIP/4310-0000652e”, “Setting DIAL_TRUNK_OPTIONS to disable alert”) in new stack
– Executing [s@macro-dialout-trunk-predial-hook:4] Set(“SIP/4310-0000652e”, “LIMIT_PLAYAUDIO_CALLEE=“no””) in new stack
– Executing [s@macro-dialout-trunk-predial-hook:5] NoOp(“SIP/4310-0000652e”, ““no””) in new stack
– Executing [s@macro-dialout-trunk-predial-hook:6] MacroExit(“SIP/4310-0000652e”, “”) in new stack
– Executing [s@macro-dialout-trunk:17] GotoIf(“SIP/4310-0000652e”, “0?bypass,1”) in new stack
– Executing [s@macro-dialout-trunk:18] GotoIf(“SIP/4310-0000652e”, “0?customtrunk”) in new stack
– Executing [s@macro-dialout-trunk:19] Set(“SIP/4310-0000652e”, “Count=10”) in new stack
– Executing [s@macro-dialout-trunk:20] Set(“SIP/4310-0000652e”, “BEEP=5”) in new stack
– Executing [s@macro-dialout-trunk:21] GotoIf(“SIP/4310-0000652e”, “0?godial:playbeep”) in new stack
– Goto (macro-dialout-trunk,s,22)
– Executing [s@macro-dialout-trunk:22] Set(“SIP/4310-0000652e”, “_DIAL_TRUNK_OPTIONS=tTkKcL(36000000:36000000:30000)”) in new stack
– Executing [s@macro-dialout-trunk:23] Set(“SIP/4310-0000652e”, “LIMIT_WARNING_FILE=custom/recordingtone2”) in new stack
– Executing [s@macro-dialout-trunk:24] Set(“SIP/4310-0000652e”, “LIMIT_PLAYAUDIO_CALLER=no”) in new stack
– Executing [s@macro-dialout-trunk:25] Set(“SIP/4310-0000652e”, “LIMIT_PLAYAUDIO_CALLEE=yes”) in new stack
– Executing [s@macro-dialout-trunk:26] Dial(“SIP/4310-0000652e”, “SIP/Teliax-backup/13108013015,300,tTkKcL(36000000:36000000:30000)”) in new stack
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
– Called SIP/Teliax-backup/13108013015

Thank you.

Your predial macro would need to prempt the dial before returning , I must admit I’m a little surprised.

Hi Dicko,

I didn’t understand what you said. Kindly could you please explain.

Regards,
Sam

This is my predial-hook code.

[macro-dialout-trunk-predial-hook]
exten => s,1,NoOp(Trunk ${OUT_${DIAL_TRUNK}} selected)
exten => s,n,Gotoif($["${OUT_${DIAL_TRUNK}}" != “SIP/Teliax”]?skip)
exten => s,n,NoOp(Setting LIMIT_PLAYAUDIO_CALLEE to no)
exten => s,n,Set(LIMIT_PLAYAUDIO_CALLEE=“no”)
exten => s,n,NoOp(${LIMIT_PLAYAUDIO_CALLEE })
exten => s,n(skip),MacroExit()

My thinking is you need to reset the whole of your ${DIAL_TRUNK_OPTIONS} to suit before exiting the macro.

but here

– Executing [s@macroEmail links icon-dialout-trunk:17] GotoIf(“SIP/4310-0000652e”, “0?bypass,1”) in new stack
– Executing [s@macroEmail links icon-dialout-trunk:18] GotoIf(“SIP/4310-0000652e”, “0?customtrunk”) in new stack

Is where the logic fails, do you have a custom trunk that looks a little like:-

– Executing [s@macroEmail links icon-dialout-trunk:19] Set(“SIP/4310-0000652e”, “Count=10”) in new stack
– Executing [s@macroEmail links icon-dialout-trunk:20] Set(“SIP/4310-0000652e”, “BEEP=5”) in new stack
– Executing [s@macroEmail links icon-dialout-trunk:21] GotoIf(“SIP/4310-0000652e”, “0?godial:playbeep”) in new stack

that apparently calls

– Goto (macro-dialout-trunk,s,22)

again?