<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<title>Re: [asterisk-users] Using DIALSTATUS question</title>
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=blue>

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Thanks so much for this method. I am going
to give it a shot. I am not familiar with that &#8220;ghM&#8221; part. I tried
looking for information on it - Is that some undocumented macro call feature or
something?<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Thanks again.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>John<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
asterisk-users-bounces@lists.digium.com
[mailto:asterisk-users-bounces@lists.digium.com] <b><span style='font-weight:
bold'>On Behalf Of </span></b>Jim Dickenson<br>
<b><span style='font-weight:bold'>Sent:</span></b> Wednesday, June 03, 2009
11:19 PM<br>
<b><span style='font-weight:bold'>To:</span></b> Asterisk User MailList<br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [asterisk-users]
Using DIALSTATUS question</span></font><o:p></o:p></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Verdana><span style='font-size:9.0pt;
font-family:Verdana'>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></span></font><o:p></o:p></p>

</div>

</body>

</html>