[asterisk-users] Asterisk Manager Problem

Danny Nicholas
Thu, 15 Jul 2010 19:33:21 -0000

_____

From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Deric Page
Sent: Thursday, July 15, 2010 2:24 PM
To: asterisk-users at lists.digium.com
Subject: [asterisk-users] Asterisk Manager Problem



I am originating a call to a Local channel using an Originate Action:

Action: Originate

Channel: Local/dial at outdial

Context: outdial

Exten: answer

Priority: 1

Timeout: 45000

ActionID: some_id

In my dialplan, I have this:

[outdial]

exten => dial,1,Dial(${DIAL_STRING}, ${DIAL_TIMEOUT})

exten => dial,n,NoOp(Dial Status = ${DIALSTATUS})

exten => dial,n,Agi(agi://localhost/Outdial.agi, ${DIAL_STRING})

exten => dial,n,Hangup()

exten => answer,1,NoOp(Dial Status = ${DIALSTATUS})

exten => answer,n,Playback(${GREETING_NAME})

exten => answer,n,WaitForSilence(2000)

exten => answer,n,Agi(agi://localhost/Outdial.agi)

exten => answer,n,Hangup()

Everything seems to work fine so long as the Dial command executes
successfully.  For example, if someone picks up the other end after the Dial
command completes, processing jumps to the "answer" extension as
expected.
If no one ever answers and the Dial command times out, processing continues
on with the next priority of the "dial" extension, again as expected.

However, if someone sets a bad DIAL_STRING (such as using a channel that
doesn't exist), things start to behave oddly.  It continues on in the next
priority of the "dial" extension (as I would expect).  However, as
soon as
it executes the call to the AGI script, it also starts processing the
"answer" extension at the same time.  As a result, I end up with two
calls
into my AGI script.  Unfortunately, I don't know what I'm doing wrong
here.

Thanks,

Deric Page

--

-- probably not the answer, but you could add these lines to the bottom of
[outdial]

Exten => *,1,hangup

Exten => t,1,hangup

Exten => i,1,hangup

This would hang-up any call that had an invalid number or did not dial
correctly.

deric.page at nisc.coop

-------------- next part --------------
An HTML attachment was scrubbed...