Dial(Local/.. not working as expected

I have :

[from-internal]
exten => 9994,1,Dial(Local/9995/n,10,r)

exten => 9995,1,Answer
exten => 9995,n,Playtones(busy)
exten => 9995,n,Busy(3)
exten => 9995,n,Hangup

If I dial 9995, I get the busy tone. If I dial 9994, the call is immediately hung up, without hearing any busy tone. Why? How can I Dial() a local extension having the same results as dialing that extension directly?

Thanks

[quote=“lux”] [from-internal] exten => 9994,1,Dial(Local/9995/n,10,r) [/quote]
Where did you get the Local protocol from and shouldn’t it be a SIP protocol, instead?

Hi Could you post the CLI output of the call as there is nothing to go on here at themoment.

It should work but without seeing the cli out put its hard to say.

Ian

[quote=“mazilo”][quote=“lux”] [from-internal] exten => 9994,1,Dial(Local/9995/n,10,r) [/quote]
Where did you get the Local protocol from and shouldn’t it be a SIP protocol, instead?[/quote]
chan_local is standard in the Asterisk distribution.
From docs/localchannel.txt:

I can’t use SIP/9995 because I don’t actually have a 9995 sip user: 9995 for me is only an extension (a number) I can dial just to hear a busy tone. Obviously this is only a simplified scenario of what I need to do, just to focus on the problem.

[quote=“ianplain”]Hi Could you post the CLI output of the call as there is nothing to go on here at themoment.

It should work but without seeing the cli out put its hard to say.

Ian[/quote]
In the CLI I get:
[Apr 28 09:57:19] – Executing [9994@from-internal:1] Dial(“SIP/300-b7c64cd0”, “Local/9995/n|10|r”) in new stack
[Apr 28 09:57:19] – Called 9995/n
[Apr 28 09:57:19] – Executing [9995@default:1] Answer(“Local/9995@default-65a3,2”, “”) in new stack
[Apr 28 09:57:19] – Executing [9995@default:2] PlayTones(“Local/9995@default-65a3,2”, “busy”) in new stack
[Apr 28 09:57:19] – Executing [9995@default:3] Busy(“Local/9995@default-65a3,2”, “3”) in new stack
[Apr 28 09:57:19] – Local/9995@default-65a3,1 answered SIP/300-b7c64cd0
[Apr 28 09:57:19] == Spawn extension (from-internal, 9994, 1) exited non-zero on ‘SIP/300-b7c64cd0’
[Apr 28 09:57:19] – Executing [h@from-internal:1] Macro(“SIP/300-b7c64cd0”, “hangupcall”) in new stack
[Apr 28 09:57:19] – Executing [s@macro-hangupcall:1] ResetCDR(“SIP/300-b7c64cd0”, “w”) in new stack
[Apr 28 09:57:19] == Spawn extension (default, 9995, 3) exited non-zero on ‘Local/9995@default-65a3,2’
[Apr 28 09:57:19] – Executing [s@macro-hangupcall:2] NoCDR(“SIP/300-b7c64cd0”, “”) in new stack
[Apr 28 09:57:19] – Executing [s@macro-hangupcall:3] GotoIf(“SIP/300-b7c64cd0”, “1?skiprg”) in new stack
[Apr 28 09:57:19] – Goto (macro-hangupcall,s,6)
[Apr 28 09:57:19] – Executing [s@macro-hangupcall:6] GotoIf(“SIP/300-b7c64cd0”, “1?skipblkvm”) in new stack
[Apr 28 09:57:19] – Goto (macro-hangupcall,s,9)
[Apr 28 09:57:19] – Executing [s@macro-hangupcall:9] GotoIf(“SIP/300-b7c64cd0”, “1?theend”) in new stack
[Apr 28 09:57:19] – Goto (macro-hangupcall,s,11)
[Apr 28 09:57:19] – Executing [s@macro-hangupcall:11] Hangup(“SIP/300-b7c64cd0”, “”) in new stack
[Apr 28 09:57:19] == Spawn extension (macro-hangupcall, s, 11) exited non-zero on ‘SIP/300-b7c64cd0’
[Apr 28 09:57:21] Really destroying SIP dialog ‘MmMyMjcxNGJkNjY2NjgxMzI2YmRmNzFlMDQwY2JiNjY.’ Method: ACK

In the log I find:
[Apr 28 09:57:19] VERBOSE[32582] logger.c: [Apr 28 09:57:19] – Executing [9995@default:1] Answer(“Local/9995@default-65a3,2”, “”) in new stack
[Apr 28 09:57:19] DEBUG[32582] devicestate.c: Notification of state change to be queued on device/channel Local/9995@default-65a3,2
[Apr 28 09:57:19] DEBUG[32582] devicestate.c: Notification of state change to be queued on device/channel Local/9995@default
[Apr 28 09:57:19] DEBUG[32582] pbx.c: Launching ‘PlayTones’
[Apr 28 09:57:19] VERBOSE[32582] logger.c: [Apr 28 09:57:19] – Executing [9995@default:2] PlayTones(“Local/9995@default-65a3,2”, “busy”) in new stack
[Apr 28 09:57:19] DEBUG[32582] channel.c: Set channel Local/9995@default-65a3,2 to write format slin
[Apr 28 09:57:19] DEBUG[32582] channel.c: Scheduling timer at 160 sample intervals
[Apr 28 09:57:19] DEBUG[32582] pbx.c: Launching ‘Busy’
[Apr 28 09:57:19] VERBOSE[32582] logger.c: [Apr 28 09:57:19] – Executing [9995@default:3] Busy(“Local/9995@default-65a3,2”, “3”) in new stack
[Apr 28 09:57:19] DEBUG[7165] devicestate.c: Changing state for SIP/300-b7c64cd0 - state 4 (Invalid)
[Apr 28 09:57:19] DEBUG[7165] devicestate.c: No provider found, checking channel drivers for SIP - 300
[Apr 28 09:57:19] DEBUG[7169] app_queue.c: Device ‘SIP/300-b7c64cd0’ changed to state ‘4’ (Invalid) but we don’t care because they’re not a member of any queue.
[Apr 28 09:57:19] DEBUG[32581] devicestate.c: Notification of state change to be queued on device/channel Local/9995@default-65a3,1
[Apr 28 09:57:19] DEBUG[32581] devicestate.c: Notification of state change to be queued on device/channel Local/9995@default
[Apr 28 09:57:19] VERBOSE[32581] logger.c: [Apr 28 09:57:19] – Local/9995@default-65a3,1 answered SIP/300-b7c64cd0
[Apr 28 09:57:19] DEBUG[32581] rtp.c: Channel ‘Local/9995@default-65a3,1’ has no RTP, not doing anything
[Apr 28 09:57:19] DEBUG[32581] devicestate.c: Notification of state change to be queued on device/channel SIP/300-b7c64cd0
[Apr 28 09:57:19] DEBUG[32581] devicestate.c: Notification of state change to be queued on device/channel SIP/300
[Apr 28 09:57:19] DEBUG[32581] chan_sip.c: SIP answering channel: SIP/300-b7c64cd0
[Apr 28 09:57:19] DEBUG[32581] chan_sip.c: Setting framing from config on incoming call
[Apr 28 09:57:19] DEBUG[32581] chan_sip.c: ** Our capability: 0xc (ulaw|alaw) Video flag: True
[Apr 28 09:57:19] DEBUG[32581] chan_sip.c: ** Our prefcodec: 0x0 (nothing)
[Apr 28 09:57:19] DEBUG[32581] chan_sip.c: – Done with adding codecs to SDP
[Apr 28 09:57:19] DEBUG[32581] channel.c: Internal timing is disabled (option_internal_timing=0 chan->timingfd=33)
[Apr 28 09:57:19] DEBUG[32581] chan_sip.c: Done building SDP. Settling with this capability: 0xc (ulaw|alaw)
[Apr 28 09:57:19] DEBUG[32581] channel.c: Got a FRAME_CONTROL (5) frame on channel Local/9995@default-65a3,1
[Apr 28 09:57:19] DEBUG[32581] channel.c: Bridge stops bridging channels SIP/300-b7c64cd0 and Local/9995@default-65a3,1
[Apr 28 09:57:19] DEBUG[32581] channel.c: Hanging up channel ‘Local/9995@default-65a3,1’
[Apr 28 09:57:19] DEBUG[32581] devicestate.c: Notification of state change to be queued on device/channel Local/9995@default-65a3,1
[Apr 28 09:57:19] DEBUG[32581] devicestate.c: Notification of state change to be queued on device/channel Local/9995@default
[Apr 28 09:57:19] DEBUG[32581] rtp.c: Channel ‘’ has no RTP, not doing anything
[Apr 28 09:57:19] DEBUG[32581] app_dial.c: Exiting with DIALSTATUS=ANSWER.
[Apr 28 09:57:19] DEBUG[32581] pbx.c: Spawn extension (from-internal,9994,1) exited non-zero on ‘SIP/300-b7c64cd0’
[Apr 28 09:57:19] VERBOSE[32581] logger.c: [Apr 28 09:57:19] == Spawn extension (from-internal, 9994, 1) exited non-zero on ‘SIP/300-b7c64cd0’

Thanks

Hi
Ok so its going through the dialplan corerctly.
The problem is that to simplify things the dialplan is not realistic, you need it to play a LONG message then hangup. for example a weasels message.

Ian

Good catch Ian,

I substited the PlayTones() with a Background(some wav file) and it seems it did the trick.
I’m going to record the busy signal…

Thank you.
Lux

BUSY means BUSY. IE dont connect the call. By answering a call and playing busy then caller will get an answer and be charged. This is not correct as a call to a busy number incurs no charge.

Ian

Let me understand: now I have

[from-internal]
exten => 9994,1,Dial(Local/9995/n,10,r)

exten => 9995,1,Answer
exten => 9995,n,Background(some wav file)
exten => 9995,n,Busy(3)
exten => 9995,n,Hangup 

Isn’t the Busy() call that means BUSY as you say?

No

exten => 9995,1,Answer

Answers the call

exten => 9995,n,Background(some wav file)

Plays a file

exten => 9995,n,Busy(3)

reports Busy

exten => 9995,n,Hangup

Hangs up the call

So you are still answering the call and the callers incurs the charge then you signal a Busy condition…

What are you trying to acheive ?

Ian

The question did arise this way: I was using FreePBX to configure my * PBX.
I wanted voicemail, but I wanted it only to be available by directly dialing it (* + extension number). I don’t want voicemail to be invoked when my phone is busy (they have to retry, otherwise I’m goig to have to answer three voicemail messages left when I answered only one phone call :smile: .
Freepbx has no direct way to do so (if you have voicemail, then it’s active for all the busy, unreachable, direct dial conditions). What I ca do is redirect calls when my extension is busy or unreachable.
That’s where our story comes in: Freepbx makes a Dial(Local/nnn) where nnn is the number of the busy redirection extension.
Since I want the caller just to receive busy when my phone is busy, at the end I need some extension that reports busy, and that can be called with Dial(Local/nnn).