Call forwarding to misc app non working properly

I have a misc application, say 9996, which goes to Terminate Call: Busy.
I would like to use it in busy and unavailable forwardings in Phone Features in the ARI (I want to to this to override voicemail in busy and/or unavailable conditions, see http://www.freepbx.org/forum/freepbx/users/direct-access-to-voicemail-only for details).

If I call 9996 directly I receive the busy tone as expected.
If I take an extension, go to its ARI - Phone Features - Call Forwarding and put 9996 in Unconditional (just to test), then I dial that extension, the call is immediately hung up without hearing the busy tone.

I extracted some logs. If I call 9996 directly (works as expected):
VERBOSE[16815] logger.c: [Apr 25 15:09:22] – Executing [[email protected]:1] NoOp(“SIP/300-09a36bd0”, “Running miscapp 2: HANGUP”) in new stack
VERBOSE[16815] logger.c: [Apr 25 15:09:22] – Executing [[email protected]:2] Goto(“SIP/300-09a36bd0”, “app-blackhole|busy|1”) in new stack
VERBOSE[16815] logger.c: [Apr 25 15:09:22] – Goto (app-blackhole,busy,1)
VERBOSE[16815] logger.c: [Apr 25 15:09:22] – Executing [[email protected]:1] NoOp(“SIP/300-09a36bd0”, “Blackhole Dest: Busy”) in new stack
VERBOSE[16815] logger.c: [Apr 25 15:09:22] – Executing [[email protected]:2] Answer(“SIP/300-09a36bd0”, “”) in new stack
VERBOSE[16815] logger.c: [Apr 25 15:09:22] – Executing [[email protected]:3] PlayTones(“SIP/300-09a36bd0”, “busy”) in new stack
DEBUG[16815] channel.c: Set channel SIP/300-09a36bd0 to write format slin
VERBOSE[16815] logger.c: [Apr 25 15:09:22] – Executing [[email protected]:4] Busy(“SIP/300-09a36bd0”, “20”) in new stack

If I call the extension forwarded to 9996 (I’m 300, the called extension is 302) I have (note the Changing state for Local/[email protected]… - state 4 (Invalid)):
VERBOSE[16821] logger.c: [Apr 25 15:09:46] – Executing [[email protected]:1] NoOp(“Local/[email protected],2”, “Running miscapp 2: HANGUP”) in new stack
VERBOSE[16821] logger.c: [Apr 25 15:09:46] – Executing [[email protected]:2] Goto(“Local/[email protected],2”, “app-blackhole|busy|1”) in new stack
VERBOSE[16821] logger.c: [Apr 25 15:09:46] – Goto (app-blackhole,busy,1)
VERBOSE[16821] logger.c: [Apr 25 15:09:46] – Executing [[email protected]:1] NoOp(“Local/[email protected],2”, “Blackhole Dest: Busy”) in new stack
VERBOSE[16821] logger.c: [Apr 25 15:09:46] – Executing [[email protected]:2] Answer(“Local/[email protected],2”, “”) in new stack
VERBOSE[16821] logger.c: [Apr 25 15:09:46] – Executing [[email protected]:3] PlayTones(“Local/[email protected],2”, “busy”) in new stack
DEBUG[7165] devicestate.c: Changing state for Local/[email protected],2 - state 4 (Invalid)
DEBUG[16821] channel.c: Set channel Local/[email protected],2 to write format slin
DEBUG[7165] devicestate.c: No provider found, checking channel drivers for Local - [email protected]
DEBUG[16817] devicestate.c: Notification of state change to be queued on device/channel Local/[email protected],1
DEBUG[7169] app_queue.c: Device ‘Local/[email protected],2’ changed to state ‘4’ (Invalid) but we don’t care because they’re not a member of any queue.
VERBOSE[16821] logger.c: [Apr 25 15:09:46] – Executing [[email protected]:4] Busy(“Local/[email protected],2”, “20”) in new stack
DEBUG[16817] channel.c: Bridge stops bridging channels SIP/300-0996b6e0 and Local/[email protected],1
DEBUG[16817] rtp.c: Channel ‘’ has no RTP, not doing anything
DEBUG[16817] app_dial.c: Exiting with DIALSTATUS=ANSWER.
DEBUG[16817] app_macro.c: Spawn extension (macro-dial,s,7) exited non-zero on ‘SIP/300-0996b6e0’ in macro ‘dial’

And the call is immediately terminated without busy tones. How can I correct this?

using versions:
asterisk 1.8.9.1
freepbx 2.8.1

Hi! I am the OP. Unfortunately I can’t remember what I was doing 4 years ago, indeed not even 4 days ago…
But I have some configuration backups taken in those days. It seems that I deleted the two misc apps and added these lines to extensions_custom.conf:
[from-internal-additional-custom]
; This can be used to redirect a call in
; User Portal - Telefony services - call transfer - busy:
; to disable calling the voicemail.
exten => 9995,1,Noop(Running miscapp 2: BUSY2)
exten => 9995,n,Goto(app-blackhole,busy2,1)
; Idem for congestion.
exten => 9996,1,Noop(Running miscapp 2: CONGESTION2)
exten => 9996,n,Goto(app-blackhole,congestion2,1)

Then I forwarded busy calls to 9995 in the ARI.
Maybe you can confirm if this works.

HTH
Luigi

thanks luigi,
i couldn’t resolve it until now - i am quite new to astrisk, thus i didn’t see that only the phenomenon is the same, but the reason seems different from your case:

i am using Misc Apllication “96” going to Terminate Call: Busy:

as in your case, direct calling extension 96 results correctly in busy tone:

-- Executing [[email protected]:3] Goto("SIP/27-0000042e", "app-blackhole,busy,1") in new stack
-- Goto (app-blackhole,busy,1)
-- Executing [[email protected]:1] NoOp("SIP/27-0000042e", "Blackhole Dest: Busy") in new stack
-- Executing [[email protected]:2] Answer("SIP/27-0000042e", "") in new stack
-- Executing [[email protected]:3] PlayTones("SIP/27-0000042e", "busy") in new stack
-- Executing [[email protected]:4] Busy("SIP/27-0000042e", "20") in new stack

== Spawn extension (app-blackhole, busy, 4) exited non-zero on ‘SIP/27-0000042e’

again as in your case, after setting “Call Forward Busy” (*90) to 96 for an extension (here 27), calls to that extension directly hang up without busy tone, if the extension is busy (same result for calls from internal or external)

the reason seems a slightly different (here call from ext. 18 to 27):

-- Executing [[email protected]:3] Goto("Local/[email protected]nal-0679;2", "app-blackhole,busy,1") in new stack
-- Goto (app-blackhole,busy,1)
-- Executing [[email protected]:1] NoOp("Local/[email protected];2", "Blackhole Dest: Busy") in new stack
-- Executing [[email protected]:2] Answer("Local/[email protected];2", "") in new stack
-- Local/[email protected];1 answered SIP/18-0000045e
-- Executing [[email protected]:3] PlayTones("Local/[email protected];2", "busy") in new stack
-- Executing [[email protected]:4] Busy("Local/[email protected];2", "20") in new stack
-- Executing [[email protected]:1] Macro("SIP/18-0000045e", "hangupcall") in new stack
-- Executing [[email protected]:1] GotoIf("SIP/18-0000045e", "1?endmixmoncheck") in new stack
-- Goto (macro-hangupcall,s,9)
-- Executing [[email protected]:9] NoOp("SIP/18-0000045e", "End of MIXMON check") in new stack
-- Executing [[email protected]:10] GotoIf("SIP/18-0000045e", "1?nomeetmemon") in new stack
-- Goto (macro-hangupcall,s,15)
-- Executing [[email protected]:15] NoOp("SIP/18-0000045e", "MEETME_RECORDINGFILE=") in new stack
-- Executing [[email protected]:16] GotoIf("SIP/18-0000045e", "1?noautomon") in new stack
-- Goto (macro-hangupcall,s,18)
-- Executing [[email protected]:18] NoOp("SIP/18-0000045e", "TOUCH_MONITOR_OUTPUT=") in new stack
-- Executing [[email protected]:19] GotoIf("SIP/18-0000045e", "1?noautomon2") in new stack
-- Goto (macro-hangupcall,s,25)
-- Executing [[email protected]:25] NoOp("SIP/18-0000045e", "MONITOR_FILENAME=") in new stack
-- Executing [[email protected]:26] GotoIf("SIP/18-0000045e", "1?skiprg") in new stack
-- Goto (macro-hangupcall,s,29)
-- Executing [[email protected]:29] GotoIf("SIP/18-0000045e", "1?skipblkvm") in new stack
-- Goto (macro-hangupcall,s,32)
-- Executing [[email protected]:32] GotoIf("SIP/18-0000045e", "1?theend") in new stack
-- Goto (macro-hangupcall,s,34)
-- Executing [[email protected]:34] Hangup("SIP/18-0000045e", "") in new stack

== Spawn extension (macro-hangupcall, s, 34) exited non-zero on ‘SIP/18-0000045e’ in macro ‘hangupcall’
== Spawn extension (from-internal, h, 1) exited non-zero on ‘SIP/18-0000045e’
== Spawn extension (macro-exten-vm, docfb, 2) exited non-zero on ‘SIP/18-0000045e’ in macro ‘exten-vm’
== Spawn extension (app-blackhole, busy, 4) exited non-zero on ‘Local/[email protected];2’
== Spawn extension (from-internal, 27, 1) exited non-zero on ‘SIP/18-0000045e’


it just immediately hangs up the call before playing a sngle tone, although in the log it says ‘executing … playtones’
???

Don’t know, but the problem seems the same to me: Playtones seems to be executed asynchronously, and the call immediately hung up.

The only hint I can give you is to define some custom context inserting a wait between:
put these lines in extensions_custom.conf, anche then use 9996:

[from-internal-additional-custom]
exten => 9996,n,Goto(app-blackhole,busy2,1)

[app-blackhole-custom]
exten => busy2,1,Answer
exten => busy2,n,Playtones(busy)
exten => busy2,n,Wait(20)
exten => busy2,n,Hangup

At least, I did this as a workaround when I originally posted the question, and I think it was working.

yes thanks, - the workaround is functioning regarding the busy tones, but this way the call status, returned to the caller is not ‘busy’ but ‘talking’ if
exten => busy,n,Wait(20) in the [app-blackhole-custom] is replacing exten => busy,n,Busy(20) in the [app-blackole] section.

its still a strange behaviour, that exten => busy,n,Busy(20) works fine when the application is called directly, but doesn’t work if the call was forwarded…