I’ve tailed /var/log/asterisk/full with extension 401 trying to spy on 604 and got the following:
[2023-09-13 11:26:44] VERBOSE[3663386][C-00000b06] pbx.c: Executing [s@sub-local-dialing:5] Return("PJSIP/401-00000faf", "") in new stack
[2023-09-13 11:26:44] VERBOSE[3663386][C-00000b06] pbx.c: Executing [s@cos-all:12] GotoIf("PJSIP/401-00000faf", "0?end-call") in new stack
[2023-09-13 11:26:44] VERBOSE[3663386][C-00000b06] pbx.c: Executing [s@cos-all:13] Goto("PJSIP/401-00000faf", "cos-all-post,*55,1") in new stack
[2023-09-13 11:26:44] VERBOSE[3663386][C-00000b06] pbx_builtins.c: Goto (cos-all-post,*55,1)
[2023-09-13 11:26:44] VERBOSE[3663386][C-00000b06] pbx.c: Executing [*55@cos-all-post:1] NoOp("PJSIP/401-00000faf", "Spy on Extension") in new stack
[2023-09-13 11:26:44] VERBOSE[3663386][C-00000b06] pbx.c: Executing [*55@cos-all-post:2] Set("PJSIP/401-00000faf", "CHANNEL(hangup_handler_push)=local-call-hangup,s,1") in new stack
[2023-09-13 11:26:44] VERBOSE[3663386][C-00000b06] pbx.c: Executing [*55@cos-all-post:3] Gosub("PJSIP/401-00000faf", "sub-spy-ext,s,1") in new stack
[2023-09-13 11:26:44] VERBOSE[3663386][C-00000b06] pbx.c: Executing [s@sub-spy-ext:1] NoOp("PJSIP/401-00000faf", "FEATURE: SPY SPECIFIED EXTENSION") in new stack
[2023-09-13 11:26:44] VERBOSE[3663386][C-00000b06] pbx.c: Executing [s@sub-spy-ext:2] Gosub("PJSIP/401-00000faf", "sub-extension-spy,s,1") in new stack
[2023-09-13 11:26:44] VERBOSE[3663386][C-00000b06] pbx.c: Executing [s@sub-extension-spy:1] Set("PJSIP/401-00000faf", "SPY_OPTIONS=qS") in new stack
[2023-09-13 11:26:44] VERBOSE[3663386][C-00000b06] pbx.c: Executing [s@sub-extension-spy:2] Read("PJSIP/401-00000faf", "EXTENSION_NUMBER,vpbx/vital-spy-extension-number") in new stack
[2023-09-13 11:26:45] VERBOSE[3663386][C-00000b06] file.c: <PJSIP/401-00000faf> Playing 'vpbx/vital-spy-extension-number.ulaw' (language 'en')
[2023-09-13 11:26:52] VERBOSE[3663386][C-00000b06] app_read.c: User entered '604'
[2023-09-13 11:26:52] VERBOSE[3663386][C-00000b06] pbx.c: Executing [s@sub-extension-spy:3] GotoIf("PJSIP/401-00000faf", "0?read_ext") in new stack
[2023-09-13 11:26:52] VERBOSE[3663386][C-00000b06] pbx.c: Executing [s@sub-extension-spy:4] Set("PJSIP/401-00000faf", "EXTENSION_DIAL=PJSIP/604&PJSIP/604vitxi&PJSIP/604_app") in new stack
[2023-09-13 11:26:52] VERBOSE[3663386][C-00000b06] pbx.c: Executing [s@sub-extension-spy:5] GotoIf("PJSIP/401-00000faf", "0?read_ext") in new stack
[2023-09-13 11:26:52] VERBOSE[3663386][C-00000b06] pbx.c: Executing [s@sub-extension-spy:6] GotoIf("PJSIP/401-00000faf", "0?:skip_pwd") in new stack
[2023-09-13 11:26:52] VERBOSE[3663386][C-00000b06] pbx_builtins.c: Goto (sub-extension-spy,s,10)
[2023-09-13 11:26:52] VERBOSE[3663386][C-00000b06] pbx.c: Executing [s@sub-extension-spy:10] NoOp("PJSIP/401-00000faf", "") in new stack
[2023-09-13 11:26:52] VERBOSE[3663386][C-00000b06] pbx.c: Executing [s@sub-extension-spy:11] Set("PJSIP/401-00000faf", "DEVICE_TO_SPY=") in new stack
[2023-09-13 11:26:52] VERBOSE[3663386][C-00000b06] pbx.c: Executing [s@sub-extension-spy:12] Set("PJSIP/401-00000faf", "COUNTER=1") in new stack
[2023-09-13 11:26:52] VERBOSE[3663386][C-00000b06] pbx.c: Executing [s@sub-extension-spy:13] Set("PJSIP/401-00000faf", "CURRENT_DEVICE=PJSIP/604") in new stack
[2023-09-13 11:26:52] VERBOSE[3663386][C-00000b06] pbx.c: Executing [s@sub-extension-spy:14] While("PJSIP/401-00000faf", "1") in new stack
[2023-09-13 11:26:52] VERBOSE[3663386][C-00000b06] pbx.c: Executing [s@sub-extension-spy:15] Set("PJSIP/401-00000faf", "DEVICE_STATUS=BUSY") in new stack
[2023-09-13 11:26:52] VERBOSE[3663386][C-00000b06] pbx.c: Executing [s@sub-extension-spy:16] GotoIf("PJSIP/401-00000faf", "0?:next") in new stack
[2023-09-13 11:26:52] VERBOSE[3663386][C-00000b06] pbx_builtins.c: Goto (sub-extension-spy,s,20)
[2023-09-13 11:26:52] VERBOSE[3663386][C-00000b06] pbx.c: Executing [s@sub-extension-spy:20] Set("PJSIP/401-00000faf", "COUNTER=2") in new stack
[2023-09-13 11:26:52] VERBOSE[3663386][C-00000b06] pbx.c: Executing [s@sub-extension-spy:21] Set("PJSIP/401-00000faf", "CURRENT_DEVICE=PJSIP/604vitxi") in new stack
[2023-09-13 11:26:52] VERBOSE[3663386][C-00000b06] pbx.c: Executing [s@sub-extension-spy:22] EndWhile("PJSIP/401-00000faf", "") in new stack
[2023-09-13 11:26:52] VERBOSE[3663386][C-00000b06] pbx.c: Executing [s@sub-extension-spy:14] While("PJSIP/401-00000faf", "1") in new stack
[2023-09-13 11:26:52] VERBOSE[3663386][C-00000b06] pbx.c: Executing [s@sub-extension-spy:15] Set("PJSIP/401-00000faf", "DEVICE_STATUS=UNAVAILABLE") in new stack
[2023-09-13 11:26:52] VERBOSE[3663386][C-00000b06] pbx.c: Executing [s@sub-extension-spy:16] GotoIf("PJSIP/401-00000faf", "0?:next") in new stack
[2023-09-13 11:26:52] VERBOSE[3663386][C-00000b06] pbx_builtins.c: Goto (sub-extension-spy,s,20)
[2023-09-13 11:26:52] VERBOSE[3663386][C-00000b06] pbx.c: Executing [s@sub-extension-spy:20] Set("PJSIP/401-00000faf", "COUNTER=3") in new stack
[2023-09-13 11:26:52] VERBOSE[3663386][C-00000b06] pbx.c: Executing [s@sub-extension-spy:21] Set("PJSIP/401-00000faf", "CURRENT_DEVICE=PJSIP/604_app") in new stack
[2023-09-13 11:26:52] VERBOSE[3663386][C-00000b06] pbx.c: Executing [s@sub-extension-spy:22] EndWhile("PJSIP/401-00000faf", "") in new stack
[2023-09-13 11:26:52] VERBOSE[3663386][C-00000b06] pbx.c: Executing [s@sub-extension-spy:14] While("PJSIP/401-00000faf", "1") in new stack
[2023-09-13 11:26:52] VERBOSE[3663386][C-00000b06] pbx.c: Executing [s@sub-extension-spy:15] Set("PJSIP/401-00000faf", "DEVICE_STATUS=UNAVAILABLE") in new stack
[2023-09-13 11:26:52] VERBOSE[3663386][C-00000b06] pbx.c: Executing [s@sub-extension-spy:16] GotoIf("PJSIP/401-00000faf", "0?:next") in new stack
[2023-09-13 11:26:52] VERBOSE[3663386][C-00000b06] pbx_builtins.c: Goto (sub-extension-spy,s,20)
[2023-09-13 11:26:52] VERBOSE[3663386][C-00000b06] pbx.c: Executing [s@sub-extension-spy:20] Set("PJSIP/401-00000faf", "COUNTER=4") in new stack
[2023-09-13 11:26:52] VERBOSE[3663386][C-00000b06] pbx.c: Executing [s@sub-extension-spy:21] Set("PJSIP/401-00000faf", "CURRENT_DEVICE=") in new stack
[2023-09-13 11:26:52] VERBOSE[3663386][C-00000b06] pbx.c: Executing [s@sub-extension-spy:22] EndWhile("PJSIP/401-00000faf", "") in new stack
[2023-09-13 11:26:52] VERBOSE[3663386][C-00000b06] pbx.c: Executing [s@sub-extension-spy:14] While("PJSIP/401-00000faf", "0") in new stack
[2023-09-13 11:26:52] VERBOSE[3663386][C-00000b06] pbx.c: Executing [s@sub-extension-spy:23] GotoIf("PJSIP/401-00000faf", "1?h-call") in new stack
[2023-09-13 11:26:52] VERBOSE[3663386][C-00000b06] pbx_builtins.c: Goto (sub-extension-spy,s,25)
[2023-09-13 11:26:52] VERBOSE[3663386][C-00000b06] pbx.c: Executing [s@sub-extension-spy:25] Hangup("PJSIP/401-00000faf", "") in new stack
[2023-09-13 11:26:52] VERBOSE[3663386][C-00000b06] pbx.c: Spawn extension (sub-extension-spy, s, 25) exited non-zero on 'PJSIP/401-00000faf'
[2023-09-13 11:26:52] VERBOSE[3663386][C-00000b06] app_stack.c: PJSIP/401-00000faf Internal Gosub(local-call-hangup,s,1) start
[2023-09-13 11:26:52] VERBOSE[3663386][C-00000b06] pbx.c: Executing [s@local-call-hangup:1] Verbose("PJSIP/401-00000faf", "0, Hangup Local Call") in new stack
[2023-09-13 11:26:52] VERBOSE[3663386][C-00000b06] app_verbose.c: Hangup Local Call
[2023-09-13 11:26:52] VERBOSE[3663386][C-00000b06] pbx.c: Executing [s@local-call-hangup:2] UserEvent("PJSIP/401-00000faf", ""EXTENSIONS_SUMMARY","Data: EXT_TO_FC,PJSIP/401,LOCAL"") in new stack
[2023-09-13 11:26:52] VERBOSE[3663386][C-00000b06] pbx.c: Executing [s@local-call-hangup:3] Return("PJSIP/401-00000faf", "") in new stack
[2023-09-13 11:26:52] VERBOSE[3663386][C-00000b06] app_stack.c: Spawn extension (sub-extension-spy, s, 25) exited non-zero on 'PJSIP/401-00000faf'
[2023-09-13 11:26:52] VERBOSE[3663386][C-00000b06] app_stack.c: PJSIP/401-00000faf Internal Gosub(local-call-hangup,s,1) complete GOSUB_RETVAL=
The prompt after dialing *55 asked for an extension, I dialed 604 and then the call ended with no further response. 604 was on a call while I tried this, which I assume is the intended scenario?