<HTML>
<HEAD>
<TITLE>Re: [asterisk-users] Using DIALSTATUS question</TITLE>
</HEAD>
<BODY>
<FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'>They way I do dialing is with this AMI packet:<BR>
<BR>
Action: Originate<BR>
Channel: Local/dial_number@cfmc_cdi_private<BR>
Exten: 1322<BR>
Context: default<BR>
Priority: 1<BR>
Variable: CfMC_ActionID=callE1321<BR>
Variable: CfMC_DialInfo=Dahdi/G1/8881231234<BR>
Variable: CfMC_RingTimeout=30<BR>
ActionID: callE1321<BR>
Async: true<BR>
<BR>
<BR>
And these extensions:<BR>
<BR>
[macro-cfmc_dial_private]<BR>
exten =&gt; s,1,UserEvent(DidDial,ActionID:${ARG1} &amp; ${UNIQUEID} &amp; ${CHANNEL} &amp; ${ARG2})<BR>
<BR>
[cfmc_cdi_private]<BR>
<BR>
exten =&gt; dial_number,1,UserEvent(BeforeDial,ActionID:${CfMC_ActionID} &amp; ${UNIQUEID} &amp; ${CHANNEL} &amp; ${CfMC_DialInfo} &amp; ${CfMC_RingTimeout})<BR>
exten =&gt; dial_number,n,Dial(${CfMC_DialInfo},${CfMC_RingTimeout},ghM(cfmc_dial_private^${CfMC_ActionID}^${CfMC_DialInfo}))<BR>
; DIALSTATUS - CHANUNAVAIL CONGESTION NOANSWER BUSY ANSWER CANCEL DONTCALL TORTURE INVALIDARGS<BR>
exten =&gt; dial_number,n,UserEvent(AfterDial,ActionID:${CfMC_ActionID} &amp; ${UNIQUEID} &amp; ${CHANNEL} &amp; ${CfMC_DialInfo} &amp; ${DIALSTATUS})<BR>
exten =&gt; dial_number,n,Hangup()<BR>
<BR>
-- <BR>
Jim Dickenson<BR>
<a href="mailto:dickenson@cfmc.com">mailto:dickenson@cfmc.com</a><BR>
<BR>
CfMC<BR>
<a href="http://www.cfmc.com/">http://www.cfmc.com/</a><BR>
<BR>
<BR>
<BR>
<BR>
From: John Regal &lt;jregal@gmail.com&gt;<BR>
Reply-To: Asterisk Users Mailing List - Non-Commercial Discussion &lt;asterisk-users@lists.digium.com&gt;<BR>
Date: Wed, 3 Jun 2009 14:38:09 -0400<BR>
To: 'Asterisk Users Mailing List - Non-Commercial Discussion' &lt;asterisk-users@lists.digium.com&gt;<BR>
Subject: [asterisk-users] Using DIALSTATUS question<BR>
<BR>
Hi all,<BR>
I am trying to make decisions in my dialplan based on {DIALSTATUS}. I am creating calls using AMI (rawman with parameters via URL) with action:Originate. I am using SIP and an outside voip provider for the calls. If I define the number to call in the Channel parameter (e.g. SIP/15555555555@myvoipprovider, the call gets placed before entering the context that I defined. I understand that the call only gets put into the context if the call was answered. If the voip provider returns a busy code, I cannot test for it in the dialplan since it never entered the context I defined in the Originate command. Calls that are answered and therefore make it into the dialplan show {DIALSTATUS} as null (when I echo it from the context).<BR>
&nbsp;<BR>
How can I programmatically place calls and evaluate dialstatus using SIP?<BR>
&nbsp;<BR>
My sip.conf looks like this:<BR>
[general]<BR>
disallow=all<BR>
allow=ulaw<BR>
allow=g729<BR>
register =&gt; username:secret@170.17.13.13<BR>
&nbsp;<BR>
[myvoipprovider]<BR>
type=friend<BR>
secret=secret<BR>
username=username<BR>
host=sip.myvoipprovider.com<BR>
dtmfmode=rfc2833<BR>
context=outbound<BR>
qualify=yes<BR>
canreinvite=no<BR>
allow=ulaw<BR>
allow=g729<BR>
insecure=port,invite<BR>
&nbsp;<BR>
&nbsp;<BR>
Thanks.<BR>
<BR>
<BR>
_______________________________________________<BR>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com">http://www.api-digital.com</a> --<BR>
<BR>
asterisk-users mailing list<BR>
To UNSUBSCRIBE or update options visit:<BR>
&nbsp;&nbsp;&nbsp;<a href="http://lists.digium.com/mailman/listinfo/asterisk-users">http://lists.digium.com/mailman/listinfo/asterisk-users</a><BR>
</SPAN></FONT>
</BODY>
</HTML>