Hello,
I worked with @PitzKey on this, we found that if you receive a FollowMe call to your cellphone, you answer, don’t press anything and hangup then the entire call gets disconnected without continuing to either voicemail or if you use a queue to the rest of the queue members.
After reviewing a bit the dialplan, we see that the reason is because of the GOSUB_RESULT is not set to ABORT or CONTINUE. Instead, the GOSUB_RESULT remains empty since the callee terminated the call prematurely before there was a chance for that variable to be set.
See log example:
[2021-11-06 22:52:55] VERBOSE[103935][C-000083ae] app_read.c: User disconnected
[2021-11-06 22:52:55] NOTICE[103935][C-000083ae] app_stack.c: Local/1234567890@T107_cos-all-0000c610;1 Abnormal 'Gosub(T107_FW1019-confirm,s,1())' exit. Popping routine return locations.
We tested the following dialplan for a single extension and it seems to be working fine.
[T107_FW1019-confirm]
exten => s,1,NoOp(Confirm Call)
same => n,Set(DIALED_NUMBER=${CUT(DIALEDPEERNUMBER,@,1)})
same => n,Set(RECFILE=${ARG1})
same => n,Set(SOUND=${IF($["${LEN(${RECFILE})}"="0"]?followme/no-recording:followme/call-from&${RECFILE})})
same => n,GotoIf(${DB_EXISTS(${TENANT}/extensions/${DIALED_NUMBER}/name)}?accept)
same => n,Set(GOSUB_RESULT=CONTINUE)
same => n,Read(CONFIRM,${SOUND}&followme/options,1,,1,5)
; same => n,GotoIf($["${CONFIRM}"="1"]?:end)
; same => n(accept),NoOp(Accept Call)
; same => n,Return()
; same => n(end),NoOp(Reject Call)
same => n(accept),Set(_GOSUB_RESULT=${IF($["${CONFIRM}" = "1"]?:${GOSUB_RESULT})})
same => n,Return()
The reason we used CONTINUE instead of ABORT, is because when using a ABORT and you call the extension directly, it never gets to Voicemail.
Note: the correct way of implementing this, would be to apply the U option ONLY on the external FollowMe channel that is leaving through the trunk.