The dialplan always dials twice

I am developing a small dialer application, but I want to know the dial result to screen bad numbers etc. So I tried doing this: Call to a local channel and the dial to the target I want to call. I do it with:

A. A call file which looks like this:
Channel: Local/1111@Dialer
MaxRetries: 0
RetryTime: 60
WaitTime: 30
Context: Dialer
Extension: 1111
Priority: 1

B. A dialplan that looks like this (In this example I want to call 9397):
[Dialer]
exten => 1111,1,Dial(Zap/1/9397,30,T)
exten => 1111,n,Noop(${DIALSTATUS})
exten => 1111,n,Answer()
exten => 1111,n,Playback(your-msg-has-been-saved)

This works, however the result I get through the CLI is this:
– Attempting call on Local/1111@Dialer for 1111@Dialer:1 (Retry 1)
– Executing Dial(“Local/1111@Dialer-1484,2”, “Zap/1/9397|30|T”) in new stack
– Requested transfer capability: 0x00 - SPEECH
– Called 1/9397
– Zap/1-1 is ringing
– Zap/1-1 answered Local/1111@Dialer-1484,2
> Channel Local/1111@Dialer-1484,1 was answered.
– Executing Dial(“Local/1111@Dialer-1484,1”, “Zap/1/9397|30|T”) in new stack
== Everyone is busy/congested at this time (1:0/0/1)
– Executing NoOp(“Local/1111@Dialer-1484,1”, “CHANUNAVAIL”) in new stack
– Executing Answer(“Local/1111@Dialer-1484,1”, “”) in new stack
– Executing NoOp(“Local/1111@Dialer-1484,1”, “Answered?”) in new stack
– Executing Playback(“Local/1111@Dialer-1484,1”, “your-msg-has-been-saved”) in new stack
– Playing ‘your-msg-has-been-saved’ (language ‘en’)
== Spawn extension (Dialer, 1111, 1) exited non-zero on ‘Local/1111@Dialer-1484,2’
– Channel 0/1, span 1 got hangup request, cause 16
– Hungup ‘Zap/1-1’

For some reason priority 1 of exten 1111 is run twice, so I always get “congestion” as the dial result. How can I solve this?

[quote]Channel: Local/1111@Dialer
MaxRetries: 0
RetryTime: 60
WaitTime: 30
Context: Dialer
Extension: 1111
Priority: 1 [/quote]
You are dialing, Local/1111@Dialer, then when it connects, it sends it to Extension 1111 priority 1 in context Dialer. You are correct, you are dialing it twice.

Try something like this
[Dialer]
_XXXX,1,Dial(Zap/1/${EXTEN},30,T)
_XXXX,n,Noop(${DIALSTATUS})

h,1,Noop(${DIALSTATUS})

1111,1,Answer()
1111,n,Playback(your-msg-has-been-saved)

Then use the following originate command:
Channel: Local/9397@Dialer
MaxRetries: 0
RetryTime: 60
WaitTime: 30
Context: Dialer
Extension: 1111
Priority: 1