[asterisk-users] API Originate Action - distinguishing between NoAnswer and Invalid phone number

Michael Collins mcollins at fcnetwork.com
Thu Feb 1 21:18:14 MST 2007


________________________________________
From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Roi Stork
Sent: Thursday, February 01, 2007 6:31 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] API Originate Action - distinguishing between NoAnswer and Invalid phone number

On 2/1/07, Michael Collins <mcollins at fcnetwork.com> wrote:
Is there a way to distinguish between a no answer and an invalid?  For
me, a 'failed' attempt is dialing an invalid number, and I'd like the
CDRs to reflect that.  I'd like a no answer to be as 'successful' as a 
busy.

The ${DIALSTATUS} channel variable stores the result of the dial attempt:
http://www.voip-info.org/wiki-Asterisk+variable+DIALSTATUS 

You can store it on the CDR's userfield column using the cdr function: 
Set(CDR(userfield)=${DIALSTATUS})

Actually, I can't.  The dialplan execution goes straight to the 'failed' extension.  When it does so, the DIALSTATUS variable gets cleared out.  I have this in my dialplan:

exten => failed,n,Noop(Dial status is '${DIALSTATUS}')

The log yields this:
-- Executing NoOp("OutgoingSpoolFailed", "Dial status is ") in new stack

Is there perhaps a way to make DIALSTATUS persist or get populated when the dialplan hits the failed extension?

-MC


More information about the asterisk-users mailing list