<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:m="http://schemas.microsoft.com/office/2004/12/omml" 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 12 (filtered medium)">
<base href="x-msg://135/">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Monaco;
        panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"\0027Courier New\0027";
        panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Hoefler Text";
        panose-1:0 0 0 0 0 0 0 0 0 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.apple-style-span
        {mso-style-name:apple-style-span;}
span.apple-converted-space
        {mso-style-name:apple-converted-space;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=purple style='word-wrap: break-word;
-webkit-nbsp-mode: space;-webkit-line-break: after-white-space'>

<div class=WordSection1>

<div>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Update on this &#8211; breaktrough! :-)<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Finally, I was able to do it. Yes you were right again as you
said, I saw that you mentioned using macros but for some reason I thought that macros
were not available in asterisk 1.2...<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>So what I managed to do is o start a macro and get info about
the channel that picked up the call. <o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Also, as said in the thread, i was able to start moh beside the
macro and it all works like charm.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>The only thing that I cant do so far, is capturing the </span><span
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:black'>${CHANNEL}
variable in the ruby script that started the macro.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:black'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:black'>Is that variable accessible from the ruby script too or just from
the macro?<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:black'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:black'>Here&#8217;s a snippet from my ruby script:<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:black'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:black'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:black'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
dial_params &lt;&lt; &quot;||M(testing)m(moh-0900-#{@moh_id})&quot; if
moh_available?()<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:black'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:black'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1.times do<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:black'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
r = $agi.exec('DIAL', dial_params)<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:black'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
r = $agi.get_variable('DIALSTATUS')<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:black'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;retry
if r.message.include?('BUSY')<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:black'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
end&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:black'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>and further below:<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>$loc = &quot;testing&quot;<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $my.query(&quot;UPDATE
call_log SET local='#{$loc}', endtime = NOW() WHERE id = #{call_log_id}&quot;)<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Works fine, but as soon as I try:<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>$loc = </span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:black'>${CHANNEL} or something like that &#8211; it breaks. Any idea how
to pass that ${CHANNEL} to my ruby script and use it to update DB in that
query?<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:black'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:black'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:black'>Thanks a bunch !</span><span style='font-size:11.0pt;font-family:
"Calibri","sans-serif";color:#1F497D'><o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

</div>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<div>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>
asterisk-users-bounces@lists.digium.com
[mailto:asterisk-users-bounces@lists.digium.com] <b>On Behalf Of </b>Jim
Dickenson<br>
<b>Sent:</b> Tuesday, July 27, 2010 5:31 PM<br>
<b>To:</b> Asterisk Users Mailing List - Non-Commercial Discussion<br>
<b>Subject:</b> Re: [asterisk-users] Urgent help = RUBY &amp; AGI<o:p></o:p></span></p>

</div>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal><span class=apple-style-span><span style='font-size:10.0pt;
font-family:"'Courier New'","serif"'>I have never used&nbsp;1.2.9.1 or anything
in the 1.2.x range so I can not give you an exact solution but I can tell you
that the script that you are using will not work. In the dial command you need
to add the M option which will call a macro when the call is connected. In that
macro you can then find the channel that answered the call and do what you want
from there. You can call another AGI or set variables or whatever. If agi.exec
works like a dialplan step then the dial step will hang if the call is answered
and the agi.get_variable statement will not execute unless the call was not
answered.</span></span><o:p></o:p></p>

<div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

<div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

<div>

<p class=MsoNormal><span class=apple-style-span><span style='font-size:10.0pt;
font-family:"'Courier New'","serif"'>Try</span></span><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

<div>

<blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'>

<div>

<div style='margin-left:.5in'>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>r
= $agi.exec('DIAL',
SIP/voipuser&amp;Zap/32&amp;Zap/33&amp;Zap/34&amp;Zap/35,,M(testing))<o:p></o:p></span></p>

</div>

</div>

</blockquote>

<div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

<div>

<div>

<div>

<p class=MsoNormal><span style='font-size:7.5pt;font-family:"Monaco","serif";
color:black'>And then have something like this in extensions.conf<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:7.5pt;font-family:"Monaco","serif";
color:black'><o:p>&nbsp;</o:p></span></p>

</div>

<div>

<div>

<p class=MsoNormal><span style='font-size:7.5pt;font-family:"Monaco","serif";
color:black'>[macro-testing]<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:7.5pt;font-family:"Monaco","serif";
color:black'>exten =&gt; s,1,DumpChan()<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:7.5pt;font-family:"Monaco","serif";
color:black'><o:p>&nbsp;</o:p></span></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:7.5pt;font-family:"Monaco","serif";
color:black'>You will see that this macro runs when the call is answered and
you will see on the CLI all the variables that are available to you. ${CHANNEL}
will have&nbsp;</span><span class=apple-style-span><span style='font-size:11.5pt;
font-family:"Calibri","sans-serif";color:black'>SIP/ voipuser-e989&nbsp;</span></span><span
style='font-size:7.5pt;font-family:"Monaco","serif";color:black'>in your
example below.<o:p></o:p></span></p>

</div>

</div>

<div>

<p class=MsoNormal><span style='font-size:7.5pt;font-family:"Monaco","serif";
color:black'>--&nbsp;<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:7.5pt;font-family:"Monaco","serif";
color:black'>Jim Dickenson<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:7.5pt;font-family:"Monaco","serif";
color:black'><a href="mailto:dickenson@cfmc.com">mailto:dickenson@cfmc.com</a><o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:7.5pt;font-family:"Monaco","serif";
color:black'><o:p>&nbsp;</o:p></span></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:7.5pt;font-family:"Monaco","serif";
color:black'>CfMC<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:7.5pt;font-family:"Monaco","serif";
color:black'><a href="http://www.cfmc.com/">http://www.cfmc.com/</a><o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:13.5pt;font-family:"Helvetica","sans-serif";
color:black'><o:p>&nbsp;</o:p></span></p>

</div>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<div>

<div>

<p class=MsoNormal>On Jul 27, 2010, at 7:21 AM, Zarko Zivanovic wrote:<o:p></o:p></p>

</div>

<p class=MsoNormal><br>
<br>
<o:p></o:p></p>

<div>

<div>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>Here&#8217;s
something that should be easy for RUBY pro&#8217;s.<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>Here
is a script:<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p>

</div>

<div style='margin-left:.5in'>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1.times do<o:p></o:p></span></p>

</div>

<div style='margin-left:.5in'>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
r = $agi.exec('DIAL', SIP/voipuser&amp;Zap/32&amp;Zap/33&amp;Zap/34&amp;Zap/35)<o:p></o:p></span></p>

</div>

<div style='margin-left:.5in'>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
r = $agi.get_variable('DIALSTATUS')<o:p></o:p></span></p>

</div>

<div style='margin-left:.5in'>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p>

</div>

<div style='margin-left:.5in'>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
# &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$agi.set_variable(' WHOANSWERED ',...)<o:p></o:p></span></p>

</div>

<div style='margin-left:.5in'>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p>

</div>

<div style='margin-left:.5in'>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
retry if r.message.include?('BUSY')<o:p></o:p></span></p>

</div>

<div style='margin-left:.5in'>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
end&nbsp;<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>when
it&#8217;s executed it shows this in the console:<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p>

</div>

<div style='margin-left:1.0in'>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p>

</div>

<div style='margin-left:1.0in'>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p>

</div>

<div style='margin-left:1.0in'>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>AGI
Rx &lt;&lt; ANSWER<o:p></o:p></span></p>

</div>

<div style='margin-left:1.0in'>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>AGI
Tx &gt;&gt; 200 result=0<o:p></o:p></span></p>

</div>

<div style='margin-left:1.0in'>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>AGI
Rx &lt;&lt; EXEC DIAL SIP/voipuser&amp;Zap/32&amp;Zap/33&amp;Zap/34&amp;Zap/35<o:p></o:p></span></p>

</div>

<div style='margin-left:1.0in'>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;&nbsp;&nbsp;
-- AGI Script Executing Application: (DIAL) Options:
(SIP/voipuser&amp;Zap/32&amp;Zap/33&amp;Zap/34&amp;Zap/35)<o:p></o:p></span></p>

</div>

<div style='margin-left:1.0in'>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;&nbsp;&nbsp;
-- Called voipuser<o:p></o:p></span></p>

</div>

<div style='margin-left:1.0in'>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;&nbsp;&nbsp;
-- Called 32<o:p></o:p></span></p>

</div>

<div style='margin-left:1.0in'>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;&nbsp;&nbsp;
-- Called 33<o:p></o:p></span></p>

</div>

<div style='margin-left:1.0in'>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;&nbsp;&nbsp;
-- Called 34<o:p></o:p></span></p>

</div>

<div style='margin-left:1.0in'>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;&nbsp;&nbsp;
-- Called 35<o:p></o:p></span></p>

</div>

<div style='margin-left:1.0in'>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;&nbsp;&nbsp;
-- Zap/32-1 is ringing<o:p></o:p></span></p>

</div>

<div style='margin-left:1.0in'>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;&nbsp;&nbsp;
-- Zap/33-1 is ringing<o:p></o:p></span></p>

</div>

<div style='margin-left:1.0in'>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;&nbsp;&nbsp;
-- Zap/34-1 is ringing<o:p></o:p></span></p>

</div>

<div style='margin-left:1.0in'>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;&nbsp;&nbsp;
-- Zap/35-1 is ringing<o:p></o:p></span></p>

</div>

<div style='margin-left:1.0in'>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;&nbsp;&nbsp;
-- SIP/voipuser-e989 is ringing<o:p></o:p></span></p>

</div>

<div style='margin-left:1.0in'>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;&nbsp;&nbsp;
-- SIP/ voipuser-e989 answered Zap/1-1&nbsp;&nbsp;&nbsp;<o:p></o:p></span></p>

</div>

<div style='margin-left:1.0in'>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p>

</div>

<div style='margin-left:1.0in'>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>What
we need is to be able to populate the variable WHOANSWERED with info<span
class=apple-converted-space>&nbsp;</span><b>SIP/ voipuser</b><o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>In
this case, or whoever answers next time.<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>Thanks
in advance!<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p>

</div>

<p class=MsoNormal><span style='font-size:13.5pt;font-family:"Hoefler Text","serif"'><br>
<br>
__________ Information from ESET NOD32 Antivirus, version of virus signature
database 5317 (20100727) __________<br>
<br>
The message was checked by ESET NOD32 Antivirus.<br>
<br>
<a href="http://www.eset.com">http://www.eset.com</a><br>
--<span class=apple-converted-space>&nbsp;</span><br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by<span class=apple-converted-space>&nbsp;</span><a
href="http://www.api-digital.com">http://www.api-digital.com</a><span
class=apple-converted-space>&nbsp;</span>--<br>
New to Asterisk? Join us for a live introductory webinar every Thurs:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a
href="http://www.asterisk.org/hello">http://www.asterisk.org/hello</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
&nbsp;&nbsp;<a href="http://lists.digium.com/mailman/listinfo/asterisk-users">http://lists.digium.com/mailman/listinfo/asterisk-users</a><o:p></o:p></span></p>

</div>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

<p class=MsoNormal><br>
<br>
__________ Information from ESET NOD32 Antivirus, version of virus signature
database 5318 (20100727) __________<br>
<br>
The message was checked by ESET NOD32 Antivirus.<br>
<br>
<a href="http://www.eset.com">http://www.eset.com</a><o:p></o:p></p>

</div>

 <BR><BR>__________ Information from ESET NOD32 Antivirus, version of virus signature database 5318 (20100727) __________<BR><BR>The message was checked by ESET NOD32 Antivirus.<BR><BR><A HREF="http://www.eset.com">http://www.eset.com</A><BR> </body>

</html>