Dial with option 'F'

Hi!

I need an example of use of the F option for the Dial command. In the documentation I see this:

F(context^exten^priority) - When the caller hangs up, transfer the called party to the specified destination and start execution at that location.
NOTE: Any channel variables you want the called channel to inherit from the caller channel must be prefixed with one or two underbars (‘_’).

And I don’t know how to use it. I have tried this:

[foo]
exten => s,1,Answer()
 same => n,Set(CALLFILENAME=${CUT(CONTEXT,-,1)}-${CALLERID(num)}-${STRFTIME(${EPOCH},,%Y%m%d%H%M%S)}-${UNIQUEID})
 same => n,Set(MONITOR_EXEC=/root/bin/soxWrapper)
 same => n,Set(CDR(userfield)=${CALLFILENAME})
 same => n,Playback(custom)
 same => n,Monitor(wav,${CALLFILENAME},mb)
 same => n,Dial(SIP/100,,tF(novo,1))

exten => novo,1,NoOp(============ ${__CALLFILENAME})

But at the log I only see:

NoOp("SIP/100", "============ ") in new stack

without any value for CALLFILENAME.

Thank you in advance.

The _s must be prefixed when setting, not when reading, the variable. They should be on priority 2 of s.

1 Like

Thank you so much!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.