Employee A calls a customer and talks for a few minutes. The customer asks to talk to someone in another depart. Employee A does a blind transfer with ## to Employee B. The result is Employee B is connected to the customer. However Employee A receives the all circuits are busy now message. Or if the Employee A called another internal number and transferred they get their voicemail. What should happen is Employee A is disconnected. I was originally using Asterisk 1.6.1.4, but have tested Asterisk 1.6.1.14 and 1.6.1.15-RC2 with the same result.
The CRUX of the issue is a bug in Asterisk that can result in calls continuing with status of NOANSWER because of the following related bugs:
https://issues.asterisk.org/view.php?id=16856
https://issues.asterisk.org/view.php?id=14555
The information below was originally submitted by the author and being left for completeness but is rather confusing as they have non-standard dialplan included. The comments at the end of the ticket clarify the issue.
I had grab an exert from a test system with no outside lines. I called 8688 from 8678 and then hit ##4078532 which initiates a blind transfer to voicemail. Below is the dialplan for the transfer to VM and the override for macro-vm for Exchange UM.
[from-internal-custom]
; Blind transfer call to voicemail with ##407XXXX
exten => _407NXXX,1,Noop(Transfering call to voicemail box ${EXTEN:3:4})
exten => _407NXXX,n,SIPAddHeader(Diversion: <tel:${EXTEN:3:4}>\;reason=no-answer\;screen=no\;privacy=off)
exten => _407NXXX,n,Dial(SIP/exchange-vm)
exten => _407NXXX,n,Hangup
[macro-vm]
; ARG1 - extension
; ARG2 - DIRECTDIAL/BUSY
; ARG3 - RETURN makes macro return, otherwise hangup
exten => s,1,Macro(user-callerid,SKIPTTL)
;
; If BLKVM_OVERRIDE is set, then someone told us to block calls from going to
; voicemail. This variable is reset by the answering channel so subsequent
; transfers will properly function.
;
exten => s,n,GotoIf($["foo${DB(${BLKVM_OVERRIDE})}" != "fooTRUE"]?vmx,1)
;
; we didn't branch so block this from voicemail
;
exten => s,n,Noop(CAME FROM: ${NODEST} - Blocking VM cause of key: ${DB(BLKVM_OVERRIDE)})
exten => vmx,1,GotoIf($["${ARG2}" = "DIRECTDIAL"]?3)
exten => vmx,2,SIPAddHeader(Diversion: <tel:${ARG1}>\;reason=no-answer\;screen=no\;privacy=off)
exten => vmx,3,Dial(SIP/exchange-vm)
exten => vxm,4,Hangup
-- <SIP/8678-0000000f> Playing 'pbx-transfer.ulaw' (language 'en')
-- Stopped music on hold on SIP/8688-00000010
-- Transferring SIP/8688-00000010 to '4078532' (context from-internal-xfer) priority 1
-- Executing [h@macro-dial:1] Macro("SIP/8678-0000000f", "hangupcall") in new stack
-- Executing [s@macro-hangupcall:1] ResetCDR("SIP/8678-0000000f", "w") in new stack
-- Executing [4078532@from-internal-xfer:1] NoOp("SIP/8688-00000010", "Transfering call to voicemail box 8532") in new stack
-- Executing [4078532@from-internal-xfer:2] SIPAddHeader("SIP/8688-00000010", "Diversion: <tel:8532>\;reason=no-answer\;screen=no\;privacy=off") in new stack
-- Executing [4078532@from-internal-xfer:3] Dial("SIP/8688-00000010", "SIP/exchange-vm") in new stack
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
-- Called exchange-vm
-- Got SIP response 302 "Moved Temporarily" back from 10.9.1.13
-- Now forwarding SIP/8688-00000010 to 'SIP/::::TCP@10.9.1.13:5067' (thanks to SIP/exchange-vm-00000011)
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
-- SIP/10.9.1.13:5067-00000012 is ringing
-- Executing [s@macro-hangupcall:2] NoCDR("SIP/8678-0000000f", "") in new stack
-- Executing [s@macro-hangupcall:3] GotoIf("SIP/8678-0000000f", "1?skiprg") in new stack
-- Goto (macro-hangupcall,s,6)
-- Executing [s@macro-hangupcall:6] GotoIf("SIP/8678-0000000f", "0?skipblkvm") in new stack
-- Executing [s@macro-hangupcall:7] NoOp("SIP/8678-0000000f", "Cleaning Up Block VM Flag: BLKVM/8688/SIP/8678-0000000f") in new stack
-- Executing [s@macro-hangupcall:8] DBdel("SIP/8678-0000000f", "BLKVM/8688/SIP/8678-0000000f") in new stack
-- DBdel: family=BLKVM, key=8688/SIP/8678-0000000f
-- DBdel: Error deleting key from database.
-- Executing [s@macro-hangupcall:9] GotoIf("SIP/8678-0000000f", "0?theend") in new stack
-- Executing [s@macro-hangupcall:10] DBdel("SIP/8678-0000000f", "FM/DND/8688/SIP/8678-0000000f") in new stack
-- DBdel: family=FM, key=DND/8688/SIP/8678-0000000f
-- DBdel: Error deleting key from database.
-- Executing [s@macro-hangupcall:11] Hangup("SIP/8678-0000000f", "") in new stack
== Spawn extension (macro-hangupcall, s, 11) exited non-zero on 'SIP/8678-0000000f' in macro 'hangupcall'
== Spawn extension (macro-dial, h, 1) exited non-zero on 'SIP/8678-0000000f'
-- Executing [s@macro-dial:8] Set("SIP/8678-0000000f", "DIALSTATUS=ANSWER") in new stack
-- Executing [s@macro-dial:9] GosubIf("SIP/8678-0000000f", "0?ANSWER,1") in new stack
-- Executing [8688@from-internal:17] Goto("SIP/8678-0000000f", "nextstep") in new stack
-- Goto (from-internal,8688,19)
-- Executing [8688@from-internal:19] Set("SIP/8678-0000000f", "RingGroupMethod=") in new stack
-- Executing [8688@from-internal:20] GotoIf("SIP/8678-0000000f", "0?nodest") in new stack
-- Executing [8688@from-internal:21] Set("SIP/8678-0000000f", "__NODEST=") in new stack
-- Executing [8688@from-internal:22] DBdel("SIP/8678-0000000f", "BLKVM/8688/SIP/8678-0000000f") in new stack
-- DBdel: family=BLKVM, key=8688/SIP/8678-0000000f
-- DBdel: Error deleting key from database.
-- Executing [8688@from-internal:23] Goto("SIP/8678-0000000f", "ext-local,vmu8688,1") in new stack
-- Goto (ext-local,vmu8688,1)
-- Executing [vmu8688@ext-local:1] Macro("SIP/8678-0000000f", "vm,8688,NOANSWER,") in new stack
-- Executing [s@macro-vm:1] Macro("SIP/8678-0000000f", "user-callerid,SKIPTTL") in new stack
-- Executing [s@macro-user-callerid:1] Set("SIP/8678-0000000f", "AMPUSER=8678") in new stack
-- Executing [s@macro-user-callerid:2] GotoIf("SIP/8678-0000000f", "0?report") in new stack
-- Executing [s@macro-user-callerid:3] ExecIf("SIP/8678-0000000f", "0?Set(REALCALLERIDNUM=8678)") in new stack
-- Executing [s@macro-user-callerid:4] Set("SIP/8678-0000000f", "AMPUSER=8678") in new stack
-- Executing [s@macro-user-callerid:5] Set("SIP/8678-0000000f", "AMPUSERCIDNAME=Ryan Wagoner") in new stack
-- Executing [s@macro-user-callerid:6] GotoIf("SIP/8678-0000000f", "0?report") in new stack
-- Executing [s@macro-user-callerid:7] Set("SIP/8678-0000000f", "AMPUSERCID=8678") in new stack
-- Executing [s@macro-user-callerid:8] Set("SIP/8678-0000000f", "CALLERID(all)="Ryan Wagoner" <8678>") in new stack
-- Executing [s@macro-user-callerid:9] Set("SIP/8678-0000000f", "REALCALLERIDNUM=8678") in new stack
-- Executing [s@macro-user-callerid:10] ExecIf("SIP/8678-0000000f", "0?Set(CHANNEL(language)=)") in new stack
-- Executing [s@macro-user-callerid:11] GotoIf("SIP/8678-0000000f", "1?continue") in new stack
-- Goto (macro-user-callerid,s,20)
-- Executing [s@macro-user-callerid:20] NoOp("SIP/8678-0000000f", "Using CallerID "Ryan Wagoner" <8678>") in new stack
-- Executing [s@macro-vm:2] GotoIf("SIP/8678-0000000f", "1?vmx,1") in new stack
-- Goto (macro-vm,vmx,1)
-- Executing [vmx@macro-vm:1] GotoIf("SIP/8678-0000000f", "0?3") in new stack
-- Executing [vmx@macro-vm:2] SIPAddHeader("SIP/8678-0000000f", "Diversion: <tel:8688>\;reason=no-answer\;screen=no\;privacy=off") in new stack
-- Executing [vmx@macro-vm:3] Dial("SIP/8678-0000000f", "SIP/exchange-vm") in new stack
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
-- Called exchange-vm
-- SIP/10.9.1.13:5067-00000012 answered SIP/8688-00000010
-- Got SIP response 302 "Moved Temporarily" back from 10.9.1.13
-- Now forwarding SIP/8678-0000000f to 'SIP/::::TCP@10.9.1.13:5067' (thanks to SIP/exchange-vm-00000013)
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
-- SIP/10.9.1.13:5067-00000014 is ringing
-- SIP/10.9.1.13:5067-00000014 answered SIP/8678-0000000f
-- Started music on hold, class 'default', on SIP/10.9.1.13:5067-00000014
-- Executing [h@from-internal-xfer:1] Macro("SIP/8688-00000010", "hangupcall") in new stack
-- Executing [s@macro-hangupcall:1] ResetCDR("SIP/8688-00000010", "w") in new stack
-- Executing [s@macro-hangupcall:2] NoCDR("SIP/8688-00000010", "") in new stack
-- Executing [s@macro-hangupcall:3] GotoIf("SIP/8688-00000010", "1?skiprg") in new stack
-- Goto (macro-hangupcall,s,6)
-- Executing [s@macro-hangupcall:6] GotoIf("SIP/8688-00000010", "1?skipblkvm") in new stack
-- Goto (macro-hangupcall,s,9)
-- Executing [s@macro-hangupcall:9] GotoIf("SIP/8688-00000010", "1?theend") in new stack
-- Goto (macro-hangupcall,s,11)
-- Executing [s@macro-hangupcall:11] Hangup("SIP/8688-00000010", "") in new stack
== Spawn extension (macro-hangupcall, s, 11) exited non-zero on 'SIP/8688-00000010' in macro 'hangupcall'
== Spawn extension (from-internal-xfer, 4078532, 3) exited non-zero on 'SIP/8688-00000010'
-- Stopped music on hold on SIP/10.9.1.13:5067-00000014
== Spawn extension (macro-vm, vmx, 3) exited non-zero on 'SIP/8678-0000000f' in macro 'vm'
== Spawn extension (ext-local, vmu8688, 1) exited non-zero on 'SIP/8678-0000000f'
The key part is when it starts dialing after initiating a hangup. Not sure why this is happening.
-- Executing [s@macro-hangupcall:11] Hangup("SIP/8678-0000000f", "") in new stack
== Spawn extension (macro-hangupcall, s, 11) exited non-zero on 'SIP/8678-0000000f' in macro 'hangupcall'
== Spawn extension (macro-dial, h, 1) exited non-zero on 'SIP/8678-0000000f'
-- Executing [s@macro-dial:8] Set("SIP/8678-0000000f", "DIALSTATUS=ANSWER") in new stack