Thank you for your quick reply
I tested, but hangup handler just executed on the main leg of the call after the whole of call hanged up and not at the transfer time.
the hangup handler added before entering to queue .
here 's my verbose :
7010 : first queue with sip/4010 agent memebr
8000 : second queue
*****-- Executing [7010@ext-queues:40] Set("SIP/test-trunk-00000006", "CHANNEL(hangup_handler_push)=hdlr3,s,1") in new stack*****
-- Executing [7010@ext-queues:41] Queue("SIP/test-trunk-00000006", "7010,t,,,,,,,,") in new stack
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
-- Called sip/4010
-- SIP/4010-00000007 is ringing
-- SIP/4010-00000007 is ringing
-- SIP/4010-00000007 answered SIP/test-trunk-00000006
-- Stopped music on hold on SIP/test-trunk-00000006
== Begin MixMonitor Recording SIP/test-trunk-00000006
-- Channel SIP/4010-00000007 joined 'simple_bridge' basic-bridge <9783064f-5799-4a29-a0b8-7848cde6f7b2>
-- Channel SIP/test-trunk-00000006 joined 'simple_bridge' basic-bridge <9783064f-5799-4a29-a0b8-7848cde6f7b2>
LNX-PBX-node-C*CLI>
LNX-PBX-node-C*CLI>
LNX-PBX-node-C*CLI>
LNX-PBX-node-C*CLI>
LNX-PBX-node-C*CLI>
**-- Channel SIP/4010-00000007: Started DTMF blind transfer.**
-- Started music on hold, class 'default', on channel 'SIP/test-trunk-00000006'
-- <SIP/4010-00000007> Playing 'pbx-transfer.gsm' (language 'ir')
-- Stopped music on hold on SIP/test-trunk-00000006
**-- Channel SIP/4010-00000007 left 'simple_bridge' basic-bridge <9783064f-5799-4a29-a0b8-7848cde6f7b2>**
**-- Channel SIP/test-trunk-00000006 left 'simple_bridge' basic-bridge <9783064f-5799-4a29-a0b8-7848cde6f7b2>**
**-- Executing [8000@from-internal-xfer-temp:1] Set("SIP/test-trunk-00000006", "__TRANSED=1") in new stack**
**-- Executing [8000@from-internal-xfer-temp:2] Goto("SIP/test-trunk-00000006", "from-internal,8000,1") in new stack**
-- Goto (from-internal,8000,1)
-- Executing [8000@from-internal:1] Macro("SIP/test-trunk-00000006", "user-callerid,") in new stack
-- Executing [s@macro-user-callerid:1] Set("SIP/test-trunk-00000006", "TOUCH_MONITOR=1558867609.8") in new stack
-- Executing [s@macro-user-callerid:2] Set("SIP/test-trunk-00000006", "AMPUSER=8000") in new stack
-- Executing [s@macro-user-callerid:3] GotoIf("SIP/test-trunk-00000006", "0?report") in new stack
-- Executing [s@macro-user-callerid:4] ExecIf("SIP/test-trunk-00000006", "0?Set(REALCALLERIDNUM=8000)") in new stack
-- Executing [s@macro-user-callerid:5] Set("SIP/test-trunk-00000006", "AMPUSER=") in new stack
-- Executing [s@macro-user-callerid:6] GotoIf("SIP/test-trunk-00000006", "0?limit") in new stack
-- Executing [s@macro-user-callerid:7] Set("SIP/test-trunk-00000006", "AMPUSERCIDNAME=") in new stack
-- Executing [s@macro-user-callerid:8] GotoIf("SIP/test-trunk-00000006", "1?report") in new stack
-- Goto (macro-user-callerid,s,15)
-- Executing [s@macro-user-callerid:15] GotoIf("SIP/test-trunk-00000006", "0?continue") in new stack
-- Executing [s@macro-user-callerid:16] ExecIf("SIP/test-trunk-00000006", "1?Set(__CALLEE_ACCOUNCODE=)") in new stack
-- Executing [s@macro-user-callerid:17] Set("SIP/test-trunk-00000006", "__TTL=5") in new stack
-- Executing [s@macro-user-callerid:18] GotoIf("SIP/test-trunk-00000006", "1?continue") in new stack
-- Goto (macro-user-callerid,s,29)
-- Executing [s@macro-user-callerid:29] Set("SIP/test-trunk-00000006", "CALLERID(number)=8000") in new stack
-- Executing [s@macro-user-callerid:30] Set("SIP/test-trunk-00000006", "CALLERID(name)=8000") in new stack
-- Executing [s@macro-user-callerid:31] GotoIf("SIP/test-trunk-00000006", "0?cnum") in new stack
-- Executing [s@macro-user-callerid:32] Set("SIP/test-trunk-00000006", "CDR(cnam)=8000") in new stack
-- Executing [s@macro-user-callerid:33] Set("SIP/test-trunk-00000006", "CDR(cnum)=8000") in new stack
-- Executing [s@macro-user-callerid:34] Set("SIP/test-trunk-00000006", "CHANNEL(language)=ir") in new stack
-- Executing [8000@from-internal:2] Answer("SIP/test-trunk-00000006", "") in new stack
-- Executing [8000@from-internal:3] Macro("SIP/test-trunk-00000006", "blkvm-set,reset") in new stack
-- Executing [s@macro-blkvm-set:1] ExecIf("SIP/test-trunk-00000006", "0?Set(__BLKVM_CHANNEL=SIP/test-trunk-00000006)") in new stack
-- Executing [s@macro-blkvm-set:2] Set("SIP/test-trunk-00000006", "SHARED(BLKVM,SIP/test-trunk-00000006)=TRUE") in new stack
-- Executing [s@macro-blkvm-set:3] Set("SIP/test-trunk-00000006", "GOSUB_RETVAL=TRUE") in new stack
-- Executing [s@macro-blkvm-set:4] MacroExit("SIP/test-trunk-00000006", "") in new stack
-- Executing [8000@from-internal:4] ExecIf("SIP/test-trunk-00000006", "0?Set(_DIAL_OPTIONS=TtrM(auto-blkvm)M(auto-blkvm))") in new stack
-- Executing [8000@from-internal:5] Set("SIP/test-trunk-00000006", "__NODEST=8000") in new stack
-- Executing [8000@from-internal:6] Set("SIP/test-trunk-00000006", "QCIDPP=") in new stack
-- Executing [8000@from-internal:7] Set("SIP/test-trunk-00000006", "VQ_CIDPP=") in new stack
-- Executing [8000@from-internal:8] ExecIf("SIP/test-trunk-00000006", "0?Macro(prepend-cid,)") in new stack
-- Executing [8000@from-internal:9] Set("SIP/test-trunk-00000006", "QAINFO=") in new stack
-- Executing [8000@from-internal:10] Set("SIP/test-trunk-00000006", "VQ_AINFO=") in new stack
-- Executing [8000@from-internal:11] ExecIf("SIP/test-trunk-00000006", "0?Set(__ALERT_INFO=)") in new stack
-- Executing [8000@from-internal:12] Set("SIP/test-trunk-00000006", "QJOINMSG=") in new stack
-- Executing [8000@from-internal:13] Set("SIP/test-trunk-00000006", "VQ_JOINMSG=") in new stack
-- Executing [8000@from-internal:14] Set("SIP/test-trunk-00000006", "QRETRY=") in new stack
-- Executing [8000@from-internal:15] Set("SIP/test-trunk-00000006", "VQ_RETRY=") in new stack
-- Executing [8000@from-internal:16] Set("SIP/test-trunk-00000006", "QOPTIONS=t") in new stack
-- Executing [8000@from-internal:17] Set("SIP/test-trunk-00000006", "VQ_OPTIONS=") in new stack
-- Executing [8000@from-internal:18] Set("SIP/test-trunk-00000006", "QGOSUB=") in new stack
-- Executing [8000@from-internal:19] Set("SIP/test-trunk-00000006", "VQ_GOSUB=") in new stack
-- Executing [8000@from-internal:20] Set("SIP/test-trunk-00000006", "QAGI=") in new stack
-- Executing [8000@from-internal:21] Set("SIP/test-trunk-00000006", "VQ_AGI=") in new stack
-- Executing [8000@from-internal:22] Set("SIP/test-trunk-00000006", "QRULE=") in new stack
-- Executing [8000@from-internal:23] Set("SIP/test-trunk-00000006", "VQ_RULE=") in new stack
-- Executing [8000@from-internal:24] Set("SIP/test-trunk-00000006", "QPOSITION=") in new stack
-- Executing [8000@from-internal:25] Set("SIP/test-trunk-00000006", "VQ_POSITION=") in new stack
-- Executing [8000@from-internal:26] Gosub("SIP/test-trunk-00000006", "sub-record-check,s,1(q,8000,dontcare)") in new stack
-- Executing [s@sub-record-check:1] GotoIf("SIP/test-trunk-00000006", "4?initialized") in new stack
-- Goto (sub-record-check,s,10)
-- Executing [s@sub-record-check:10] NoOp("SIP/test-trunk-00000006", "Recordings initialized") in new stack
-- Executing [s@sub-record-check:11] ExecIf("SIP/test-trunk-00000006", "0?Set(ARG3=dontcare)") in new stack
-- Executing [s@sub-record-check:12] Set("SIP/test-trunk-00000006", "REC_POLICY_MODE_SAVE=FORCE") in new stack
-- Executing [s@sub-record-check:13] ExecIf("SIP/test-trunk-00000006", "1?Set(REC_STATUS=NO)") in new stack
-- Executing [s@sub-record-check:14] GotoIf("SIP/test-trunk-00000006", "1?checkaction") in new stack
-- Goto (sub-record-check,s,17)
-- Executing [s@sub-record-check:17] GotoIf("SIP/test-trunk-00000006", "0?sub-record-check,q,1") in new stack
-- Executing [s@sub-record-check:18] NoOp("SIP/test-trunk-00000006", "Generic q Recording Check - 8000 8000") in new stack
-- Executing [s@sub-record-check:19] Gosub("SIP/test-trunk-00000006", "recordcheck,1(dontcare,q,8000)") in new stack
-- Executing [recordcheck@sub-record-check:1] NoOp("SIP/test-trunk-00000006", "Starting recording check against dontcare") in new stack
-- Executing [recordcheck@sub-record-check:2] Goto("SIP/test-trunk-00000006", "dontcare") in new stack
-- Goto (sub-record-check,recordcheck,3)
-- Executing [recordcheck@sub-record-check:3] Return("SIP/test-trunk-00000006", "") in new stack
-- Executing [s@sub-record-check:20] Return("SIP/test-trunk-00000006", "") in new stack
-- Executing [8000@from-internal:27] Set("SIP/test-trunk-00000006", "__CWIGNORE=TRUE") in new stack
-- Executing [8000@from-internal:28] ExecIf("SIP/test-trunk-00000006", "0?Playback(, )") in new stack
-- Executing [8000@from-internal:29] QueueLog("SIP/test-trunk-00000006", "8000,1558867609.8,NONE,DID,787878") in new stack
-- Executing [8000@from-internal:30] Set("SIP/test-trunk-00000006", "QAANNOUNCE=") in new stack
-- Executing [8000@from-internal:31] Set("SIP/test-trunk-00000006", "VQ_AANNOUNCE=") in new stack
-- Executing [8000@from-internal:32] Set("SIP/test-trunk-00000006", "QMOH=") in new stack
-- Executing [8000@from-internal:33] Set("SIP/test-trunk-00000006", "VQ_MOH=") in new stack
-- Executing [8000@from-internal:34] ExecIf("SIP/test-trunk-00000006", "0?Set(__MOHCLASS=)") in new stack
-- Executing [8000@from-internal:35] ExecIf("SIP/test-trunk-00000006", "0?Set(CHANNEL(musicclass)=)") in new stack
-- Executing [8000@from-internal:36] Set("SIP/test-trunk-00000006", "QMAXWAIT=") in new stack
-- Executing [8000@from-internal:37] Set("SIP/test-trunk-00000006", "VQ_MAXWAIT=") in new stack
-- Executing [8000@from-internal:38] Set("SIP/test-trunk-00000006", "QUEUENUM=8000") in new stack
-- Executing [8000@from-internal:39] Set("SIP/test-trunk-00000006", "QUEUEJOINTIME=1558867632") in new stack
-- Executing [8000@from-internal:40] Set("SIP/test-trunk-00000006", "reza=") in new stack
-- Executing [8000@from-internal:41] Queue("SIP/test-trunk-00000006", "8000,t,,,,,,,,") in new stack
--- **** ENTER_QUEUE 8000--SIP/test-trunk-00000006
[2019-05-26 15:17:12] WARNING[5188][C-00000003]: res_odbc.c:550 ast_odbc_print_errors: SQL Execute returned an error: 42S22: [MySQL][ODBC 5.1 Driver][mysqld-5.5.5-10.1.38-MariaDB]Unknown column 'data' in 'field list'
[2019-05-26 15:17:12] WARNING[5188][C-00000003]: res_odbc.c:445 ast_odbc_prepare_and_execute: SQL Execute error -1!
-- Started music on hold, class 'default', on channel 'SIP/test-trunk-00000006'
-- Stopped music on hold on SIP/test-trunk-00000006 == Spawn extension (from-internal, 8000, 41) exited non-zero on 'SIP/test-trunk-00000006'
-- Executing [h@from-internal:1] Macro("SIP/test-trunk-00000006", "hangupcall") in new stack
-- Executing [s@macro-hangupcall:1] NoOp("SIP/test-trunk-00000006", " ----- 420 ----- 8000 ----- SIP/test-trunk-00000006 ----- SIP ------ macro-hangupcall ----- ----- 25 ----- ANSWERED ") in new stack
-- Executing [s@macro-hangupcall:2] GotoIf("SIP/test-trunk-00000006", "0?redis:start") in new stack
-- Goto (macro-hangupcall,s,6)
-- Executing [s@macro-hangupcall:6] ExecIf("SIP/test-trunk-00000006", "0?UserEvent(outgoing,8000::ANSWERED)") in new stack
-- Executing [s@macro-hangupcall:7] GotoIf("SIP/test-trunk-00000006", "1?theend") in new stack
-- Goto (macro-hangupcall,s,9)
-- Executing [s@macro-hangupcall:9] ExecIf("SIP/test-trunk-00000006", "0?Set(CDR(recordingfile)=)") in new stack
-- Executing [s@macro-hangupcall:10] Hangup("SIP/test-trunk-00000006", "") in new stack
== Spawn extension (macro-hangupcall, s, 10) exited non-zero on 'SIP/test-trunk-00000006' in macro 'hangupcall'
== Spawn extension (from-internal, h, 1) exited non-zero on 'SIP/test-trunk-00000006'
**-- SIP/test-trunk-00000006 Internal Gosub(hdlr3,s,1) start**
-**- Executing [s@hdlr3:1] Verbose("SIP/test-trunk-00000006", "0, Executed First") in new stack**
**Executed First**
**-- Executing [s@hdlr3:2] Return("SIP/test-trunk-00000006", "") in new stack**
**== Spawn extension (from-internal, h, 1) exited non-zero on 'SIP/test-trunk-00000006'**
-- SIP/test-trunk-00000006 Internal Gosub(hdlr3,s,1) complete GOSUB_RETVAL=
== MixMonitor close filestream (mixed)
== End MixMonitor Recording SIP/test-trunk-00000006
== MixMonitor close filestream (mixed)
== End MixMonitor Recording SIP/test-trunk-00000006
LNX-PBX-node-C*CLI>