**Solved** No Busy signalling for busy extension from inbound route

Hello everybody.
I have an Elastix 1.6.2 installation with FreePbx uptated to 2.7.2, Asterisk 1.4.30, and an E1 connection to telco configured with dahdi.
At inbound routes, I put a DID direct to a Sip extension. When the extension is busy and i have an incoming call i don´t receive a busy cause. Looking at pri intense debug span 1, i can see the disconnect cause is 16, normal call clearing, instead a busy cause 17. But if the phone is ringing, and the call is rejected, the disconnect cause is busy 17.
This behaviour is from dialparties.agi, that check if the extension is busy before to the Dial command, and if it’s busy, directly goes to s-BUSY with Playtones and Busy (macro-exten-vm).
I need a busy cause 17 instead normal call clearing 16 when the extension is busy.
How can i do it?
Thanks.

what happens if you put a Progress() statement right before the Playtones(busy)?

Thank Philippe for your answer, but it doesn´t work.

I have an extension, 797, that is busy when i do an incoming call. Have a look:

 -- Accepting call from 'CALLING_NUMBER' to 'CALLED_DID' on channel 0/29, span 2
-- Executing [[email protected]:1] Goto("DAHDI/60-1", "from-trunk|CALLED_DID|1") in new stack
-- Goto (from-trunk,CALLED_DID,1)
-- Executing [[email protected]:1] Set("DAHDI/60-1", "__FROM_DID=CALLED_DID") in new stack
-- Executing [[email protected]:2] Gosub("DAHDI/60-1", "app-blacklist-check|s|1") in new stack
-- Executing [[email protected]:1] LookupBlacklist("DAHDI/60-1", "") in new stack
-- Executing [[email protected]:2] GotoIf("DAHDI/60-1", "0?blacklisted") in new stack
-- Executing [[email protected]:3] Set("DAHDI/60-1", "CALLED_BLACKLIST=1") in new stack
-- Executing [[email protected]:4] Return("DAHDI/60-1", "") in new stack
-- Executing [[email protected]:3] ExecIf("DAHDI/60-1", "1 |Set|CALLERID(name)=CALLING_NUMBER") in new stack
-- Executing [[email protected]:4] Set("DAHDI/60-1", "__CALLINGPRES_SV=allowed") in new stack
-- Executing [[email protected]:5] SetCallerPres("DAHDI/60-1", "allowed_not_screened") in new stack
-- Executing [[email protected]:6] Goto("DAHDI/60-1", "from-did-direct|797|1") in new stack
-- Goto (from-did-direct,797,1)
-- Executing [[email protected]:1] Macro("DAHDI/60-1", "exten-vm|novm|797") in new stack
-- Executing [[email protected]:1] Macro("DAHDI/60-1", "user-callerid|") in new stack
-- Executing [[email protected]:1] Set("DAHDI/60-1", "AMPUSER=CALLING_NUMBER") in new stack
-- Executing [[email protected]:2] GotoIf("DAHDI/60-1", "0?report") in new stack
-- Executing [[email protected]:3] ExecIf("DAHDI/60-1", "1|Set|REALCALLERIDNUM=CALLING_NUMBER") in new stack
-- Executing [[email protected]:4] Set("DAHDI/60-1", "AMPUSER=") in new stack
-- Executing [[email protected]:5] Set("DAHDI/60-1", "AMPUSERCIDNAME=") in new stack
-- Executing [[email protected]:6] GotoIf("DAHDI/60-1", "1?report") in new stack
-- Goto (macro-user-callerid,s,10)
-- Executing [[email protected]:10] GotoIf("DAHDI/60-1", "0?continue") in new stack
-- Executing [[email protected]:11] Set("DAHDI/60-1", "__TTL=64") in new stack
-- Executing [[email protected]:12] GotoIf("DAHDI/60-1", "1?continue") in new stack
-- Goto (macro-user-callerid,s,19)
-- Executing [[email protected]:19] NoOp("DAHDI/60-1", "Using CallerID "CALLING_NUMBER" <CALLING_NUMBER>") in new stack
-- Executing [[email protected]:2] Set("DAHDI/60-1", "RingGroupMethod=none") in new stack
-- Executing [[email protected]:3] Set("DAHDI/60-1", "VMBOX=novm") in new stack
-- Executing [[email protected]:4] Set("DAHDI/60-1", "EXTTOCALL=797") in new stack
-- Executing [[email protected]:5] Set("DAHDI/60-1", "CFUEXT=") in new stack
-- Executing [[email protected]:6] Set("DAHDI/60-1", "CFBEXT=") in new stack
-- Executing [[email protected]:7] Set("DAHDI/60-1", "RT=""") in new stack
-- Executing [[email protected]:8] Macro("DAHDI/60-1", "record-enable|797|IN") in new stack
-- Executing [[email protected]:1] GotoIf("DAHDI/60-1", "1?check") in new stack
-- Goto (macro-record-enable,s,4)
-- Executing [[email protected]:4] ExecIf("DAHDI/60-1", "0|MacroExit|") in new stack
-- Executing [[email protected]:5] GotoIf("DAHDI/60-1", "0?Group:OUT") in new stack
-- Goto (macro-record-enable,s,15)
-- Executing [[email protected]:15] GotoIf("DAHDI/60-1", "1?IN") in new stack
-- Goto (macro-record-enable,s,20)
-- Executing [[email protected]:20] ExecIf("DAHDI/60-1", "1|MacroExit|") in new stack
-- Executing [[email protected]:9] Macro("DAHDI/60-1", "dial||Ttr|797") in new stack
-- Executing [[email protected]:1] GotoIf("DAHDI/60-1", "1?dial") in new stack
-- Goto (macro-dial,s,3)
-- Executing [[email protected]:3] AGI("DAHDI/60-1", "dialparties.agi") in new stack
-- Launched AGI Script /var/lib/asterisk/agi-bin/dialparties.agi

dialparties.agi: Starting New Dialparties.agi
== Parsing ‘/etc/asterisk/manager.conf’: Found
== Parsing ‘/etc/asterisk/manager_additional.conf’: Found
== Parsing ‘/etc/asterisk/manager_custom.conf’: Found
== Manager ‘admin’ logged on from 127.0.0.1
dialparties.agi: Caller ID name is ‘CALLING_NUMBER’ number is 'CALLING_NUMBER’
dialparties.agi: Methodology of ring is ‘none’
– dialparties.agi: Added extension 797 to extension map
– dialparties.agi: Extension 797 cf is disabled
– dialparties.agi: Extension 797 do not disturb is disabled
dialparties.agi: ExtensionState: 1
dialparties.agi: Extension 797 has ExtensionState: 1
– dialparties.agi: Checking CW and CFB status for extension 797
dialparties.agi: Extension 797 is not available to be called
dialparties.agi: Extension 797 has call waiting disabled
– dialparties.agi: Filtered ARG3:
== Manager ‘admin’ logged off from 127.0.0.1
– AGI Script dialparties.agi completed, returning 0
– Executing [[email protected]:4] NoOp(“DAHDI/60-1”, “Returned from dialparties with no extensions to call and DIALSTATUS: BUSY”) in new stack
– Executing [[email protected]:10] GotoIf(“DAHDI/60-1”, “0?exit|return”) in new stack
– Executing [[email protected]:11] Set(“DAHDI/60-1”, “SV_DIALSTATUS=BUSY”) in new stack
– Executing [[email protected]:12] GosubIf(“DAHDI/60-1”, “0?docfu|1”) in new stack
– Executing [[email protected]:13] GosubIf(“DAHDI/60-1”, “0?docfb|1”) in new stack
– Executing [[email protected]:14] Set(“DAHDI/60-1”, “DIALSTATUS=BUSY”) in new stack
– Executing [[email protected]:15] NoOp(“DAHDI/60-1”, “Voicemail is novm”) in new stack
– Executing [[email protected]:16] GotoIf(“DAHDI/60-1”, “1?s-BUSY|1”) in new stack
– Goto (macro-exten-vm,s-BUSY,1)
– Executing [[email protected]:1] NoOp(“DAHDI/60-1”, “Extension is reporting BUSY and not passing to Voicemail”) in new stack
– Executing [[email protected]:2] GotoIf(“DAHDI/60-1”, “0?exit|1”) in new stack
– Executing [[email protected]:3] Progress(“DAHDI/60-1”, “”) in new stack
– Executing [[email protected]:4] PlayTones(“DAHDI/60-1”, “busy”) in new stack
– Executing [[email protected]:5] Busy(“DAHDI/60-1”, “20”) in new stack

I have to wait 20 seconds to get an answer for the call. I need an inmediate busy signalling as i give when de extension reject the call.
Thanks.

Change the following in macro-exten-vm context:

exten => s-BUSY,1,Noop(Extension is reporting BUSY and not passing to Voicemail)
exten => s-BUSY,n,GotoIf($["${IVR_RETVM}"=“RETURN” & “${IVR_CONTEXT}”!=""]?exit,1)
;exten => s-BUSY,n,Playtones(busy)
;exten => s-BUSY,n,Busy(20)
exten => s-BUSY,n,Hangup(17)