Trunk as Failover Destination for Queue not working

I have a SIP trunk as a failover destination for a queue (extension 5320). Now in a failover event, Asterisk accesses the trunk, but doesn’t send any digits, and therefore the call fails.
“OUTNUM=” is what I get and it should be “OUTNUM=5320”.
Any ideas?
Asterisk 11.9.0 on PIAF 2.0.6.5

– Executing [5320@from-internal:39] Queue(“SIP/5313-00000032”, “5320,t,”) in new stack
[2015-01-02 20:15:42] WARNING[26091][C-00000031]: app_queue.c:7085 queue_exec: Unable to join queue ‘5320’
– Executing [5320@from-internal:40] Macro(“SIP/5313-00000032”, “blkvm-clr,”) in new stack
– Executing [s@macro-blkvm-clr:1] Set(“SIP/5313-00000032”, “SHARED(BLKVM,SIP/5313-00000032)=”) in new stack
– Executing [s@macro-blkvm-clr:2] Set(“SIP/5313-00000032”, “GOSUB_RETVAL=”) in new stack
– Executing [s@macro-blkvm-clr:3] MacroExit(“SIP/5313-00000032”, “”) in new stack
– Executing [5320@from-internal:41] Gosub(“SIP/5313-00000032”, “sub-record-cancel,s,1()”) in new stack
– Executing [s@sub-record-cancel:1] Set(“SIP/5313-00000032”, “__REC_POLICY_MODE=”) in new stack
– Executing [s@sub-record-cancel:2] ExecIf(“SIP/5313-00000032”, “1?Return()”) in new stack
– Executing [5320@from-internal:42] Set(“SIP/5313-00000032”, “__NODEST=”) in new stack
– Executing [5320@from-internal:43] Set(“SIP/5313-00000032”, “_QUEUE_PRIO=0”) in new stack
– Executing [5320@from-internal:44] Set(“SIP/5313-00000032”, “QDEST=”) in new stack
– Executing [5320@from-internal:45] Set(“SIP/5313-00000032”, “VQ_DEST=”) in new stack
– Executing [5320@from-internal:46] GotoIf(“SIP/5313-00000032”, “1?ext-trunk,21,1:,”) in new stack
– Goto (ext-trunk,21,1)
– Executing [21@ext-trunk:1] Set(“SIP/5313-00000032”, “TDIAL_STRING=SIP/G200AN”) in new stack
– Executing [21@ext-trunk:2] Set(“SIP/5313-00000032”, “DIAL_TRUNK=21”) in new stack
– Executing [21@ext-trunk:3] Goto(“SIP/5313-00000032”, “ext-trunk,tdial,1”) in new stack
– Goto (ext-trunk,tdial,1)
– Executing [tdial@ext-trunk:1] Set(“SIP/5313-00000032”, “OUTBOUND_GROUP=OUT_21”) in new stack
– Executing [tdial@ext-trunk:2] GotoIf(“SIP/5313-00000032”, “0?nomax”) in new stack
– Executing [tdial@ext-trunk:3] GotoIf(“SIP/5313-00000032”, “0?hangit”) in new stack
– Executing [tdial@ext-trunk:4] ExecIf(“SIP/5313-00000032”, “0?Set(CALLERPRES()=)”) in new stack
– Executing [tdial@ext-trunk:5] Set(“SIP/5313-00000032”, “DIAL_NUMBER=”) in new stack
– Executing [tdial@ext-trunk:6] GosubIf(“SIP/5313-00000032”, “0?sub-flp-21,s,1()”) in new stack
[color=#FF0040]-- Executing [tdial@ext-trunk:7] Set(“SIP/5313-00000032”, “OUTNUM=”) in new stack[/color]
– Executing [tdial@ext-trunk:8] Set(“SIP/5313-00000032”, “DIAL_TRUNK_OPTIONS=Tt”) in new stack
– Executing [tdial@ext-trunk:9] Dial(“SIP/5313-00000032”, “SIP/G200AN/,300,Tt”) in new stack
== Using SIP VIDEO TOS bits 136
== Using SIP VIDEO CoS mark 6
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
– Called SIP/G200AN/
== Everyone is busy/congested at this time (1:0/0/1)
– Executing [tdial@ext-trunk:10] Set(“SIP/5313-00000032”, “CALLERID(number)=5313”) in new stack
– Executing [tdial@ext-trunk:11] Set(“SIP/5313-00000032”, “CALLERID(name)=Johann Remote Office”) in new stack
– Executing [tdial@ext-trunk:12] Hangup(“SIP/5313-00000032”, “”) in new stack
== Spawn extension (ext-trunk, tdial, 12) exited non-zero on ‘SIP/5313-00000032’

Contact the person who wrote the dialplan. If this is FreePBX, you want community.freepbx.org/