<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 => s,1,UserEvent(DidDial,ActionID:${ARG1} & ${UNIQUEID} & ${CHANNEL} & ${ARG2})<BR>
<BR>
[cfmc_cdi_private]<BR>
<BR>
exten => dial_number,1,UserEvent(BeforeDial,ActionID:${CfMC_ActionID} & ${UNIQUEID} & ${CHANNEL} & ${CfMC_DialInfo} & ${CfMC_RingTimeout})<BR>
exten => 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 => dial_number,n,UserEvent(AfterDial,ActionID:${CfMC_ActionID} & ${UNIQUEID} & ${CHANNEL} & ${CfMC_DialInfo} & ${DIALSTATUS})<BR>
exten => 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 <jregal@gmail.com><BR>
Reply-To: Asterisk Users Mailing List - Non-Commercial Discussion <asterisk-users@lists.digium.com><BR>
Date: Wed, 3 Jun 2009 14:38:09 -0400<BR>
To: 'Asterisk Users Mailing List - Non-Commercial Discussion' <asterisk-users@lists.digium.com><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>
<BR>
How can I programmatically place calls and evaluate dialstatus using SIP?<BR>
<BR>
My sip.conf looks like this:<BR>
[general]<BR>
disallow=all<BR>
allow=ulaw<BR>
allow=g729<BR>
register => username:secret@170.17.13.13<BR>
<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>
<BR>
<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>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-users">http://lists.digium.com/mailman/listinfo/asterisk-users</a><BR>
</SPAN></FONT>
</BODY>
</HTML>