# Dial(Local/.. not working as expected

**URL:** <https://community.asterisk.org/t/dial-local-not-working-as-expected/20603>\
**Category:** Asterisk Support\
**Created:** [April 27, 2008, 6:52pm UTC](https://community.asterisk.org/t/dial-local-not-working-as-expected/20603 "2008-04-27T18:52:36Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![lux](https://avatars.discourse-cdn.com/v4/letter/l/8c91f0/32.png) [@lux](https://community.asterisk.org/u/lux)\
**Post date:** [April 27, 2008, 6:52pm UTC](https://community.asterisk.org/t/dial-local-not-working-as-expected/20603/1 "2008-04-27T18:52:36Z")

</div>

I have :

```auto
[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

---

<div class="post-metadata">

**Author:** ![mazilo](https://avatars.discourse-cdn.com/v4/letter/m/3ec8ea/32.png) [@mazilo](https://community.asterisk.org/u/mazilo)\
**Post date:** [April 27, 2008, 7:47pm UTC](https://community.asterisk.org/t/dial-local-not-working-as-expected/20603/2 "2008-04-27T19:47:09Z")

</div>

[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?

---

<div class="post-metadata">

**Author:** ![ianplain](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/ianplain/32/1776_2.png) [@ianplain](https://community.asterisk.org/u/ianplain)\
**Post date:** [April 27, 2008, 8:45pm UTC](https://community.asterisk.org/t/dial-local-not-working-as-expected/20603/3 "2008-04-27T20:45:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![lux](https://avatars.discourse-cdn.com/v4/letter/l/8c91f0/32.png) [@lux](https://community.asterisk.org/u/lux)\
**Post date:** [April 28, 2008, 7:54am UTC](https://community.asterisk.org/t/dial-local-not-working-as-expected/20603/4 "2008-04-28T07:54:33Z")

</div>

[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:

> [@](#):
>
> chan\_local is a pseudo-channel. Use of this channel simply loops calls back into the dialplan in a different context. Useful for recursive routing.

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.

---

<div class="post-metadata">

**Author:** ![lux](https://avatars.discourse-cdn.com/v4/letter/l/8c91f0/32.png) [@lux](https://community.asterisk.org/u/lux)\
**Post date:** [April 28, 2008, 8:03am UTC](https://community.asterisk.org/t/dial-local-not-working-as-expected/20603/5 "2008-04-28T08:03:53Z")

</div>

[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

---

<div class="post-metadata">

**Author:** ![ianplain](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/ianplain/32/1776_2.png) [@ianplain](https://community.asterisk.org/u/ianplain)\
**Post date:** [April 28, 2008, 8:39am UTC](https://community.asterisk.org/t/dial-local-not-working-as-expected/20603/6 "2008-04-28T08:39:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![lux](https://avatars.discourse-cdn.com/v4/letter/l/8c91f0/32.png) [@lux](https://community.asterisk.org/u/lux)\
**Post date:** [April 28, 2008, 10:28am UTC](https://community.asterisk.org/t/dial-local-not-working-as-expected/20603/7 "2008-04-28T10:28:03Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ianplain](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/ianplain/32/1776_2.png) [@ianplain](https://community.asterisk.org/u/ianplain)\
**Post date:** [April 28, 2008, 12:26pm UTC](https://community.asterisk.org/t/dial-local-not-working-as-expected/20603/8 "2008-04-28T12:26:03Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![lux](https://avatars.discourse-cdn.com/v4/letter/l/8c91f0/32.png) [@lux](https://community.asterisk.org/u/lux)\
**Post date:** [April 28, 2008, 1:21pm UTC](https://community.asterisk.org/t/dial-local-not-working-as-expected/20603/9 "2008-04-28T13:21:33Z")

</div>

Let me understand: now I have

```auto
[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?

---

<div class="post-metadata">

**Author:** ![ianplain](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/ianplain/32/1776_2.png) [@ianplain](https://community.asterisk.org/u/ianplain)\
**Post date:** [April 28, 2008, 6:14pm UTC](https://community.asterisk.org/t/dial-local-not-working-as-expected/20603/10 "2008-04-28T18:14:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![lux](https://avatars.discourse-cdn.com/v4/letter/l/8c91f0/32.png) [@lux](https://community.asterisk.org/u/lux)\
**Post date:** [April 28, 2008, 7:31pm UTC](https://community.asterisk.org/t/dial-local-not-working-as-expected/20603/11 "2008-04-28T19:31:24Z")

</div>

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 😄 .  
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).
