Unfortunately, even after two more days of testing, I was not able to get that channel info from macro into my ruby script.<br><br>As it is now - I do not see the way to do it, and this is unsolved.<br><br>If any of you good folks have any idea how to pull the dumpchan data from macro to ruby/agi script please let me know.<br>
<br><br><br><br><br><br><br><div class="gmail_quote">On Wed, Jul 28, 2010 at 2:02 PM, Zarko Zivanovic <span dir="ltr"><<a href="mailto:outlaw011@gmail.com">outlaw011@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div link="blue" vlink="blue" lang="EN-US">
<div>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">Works like charm Danny,</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">Tested and works fine.</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">I sent this to Jim, but this is something you could know:</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">I managed to start a macro and get info about the channel that
picked up the call. </span></p><div class="im">
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">Also, as said in the thread, i was able to start moh beside the
macro and it all works like charm.</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">The only thing that I cant do so far, is capturing the </span><span style="font-size: 11pt; color: black;">${CHANNEL}
variable in the ruby script that started the macro.</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: black;"> </span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: black;">Is that variable accessible from the ruby script too or just from
the macro?</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: black;"> </span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: black;">Here’s a snippet from my ruby script:</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: black;"> </span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: black;"> </span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: black;">
dial_params << "||M(testing)m(moh-0900-#{@moh_id})" if
moh_available?()</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: black;"> </span></p>
</div><p class="MsoNormal"><span style="font-size: 11pt; color: black;">
1.times do</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: black;">
r = $agi.exec('DIAL', dial_params)</span></p><div class="im">
<p class="MsoNormal"><span style="font-size: 11pt; color: black;">
r = $agi.get_variable('DIALSTATUS')</span></p>
</div><p class="MsoNormal"><span style="font-size: 11pt; color: black;">
retry
if r.message.include?('BUSY')</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: black;">
end
</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: black;"> </span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">and further below:</span></p><div class="im">
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">$loc = "testing"</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">
</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">
$my.query("UPDATE call_log SET local='#{$loc}', endtime = NOW() WHERE id =
#{call_log_id}")</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">Works fine, but as soon as I try:</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">$loc = </span><span style="font-size: 11pt; color: black;">${CHANNEL} or something like that – it breaks. Any idea how to
pass that ${CHANNEL} to my ruby script and use it to update DB in that query?</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: black;"> </span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: black;"> </span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: black;">Thanks a bunch !</span><span style="font-size: 11pt; color: rgb(31, 73, 125);"></span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
</div><div>
<div style="border-style: solid none none; border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; border-width: 1pt medium medium; padding: 3pt 0in 0in;">
<p class="MsoNormal"><b><span style="font-size: 10pt;">From:</span></b><span style="font-size: 10pt;">
<a href="mailto:asterisk-users-bounces@lists.digium.com" target="_blank">asterisk-users-bounces@lists.digium.com</a>
[mailto:<a href="mailto:asterisk-users-bounces@lists.digium.com" target="_blank">asterisk-users-bounces@lists.digium.com</a>] <b>On Behalf Of </b>Danny
Nicholas<br>
<b>Sent:</b> Tuesday, July 27, 2010 6:32 PM<br>
<b>To:</b> 'Asterisk Users Mailing List - Non-Commercial Discussion'<div class="im"><br>
<b>Subject:</b> Re: [asterisk-users] Urgent help = RUBY & AGI</div></span></p>
</div>
</div><div class="im">
<p class="MsoNormal"> </p>
<div>
<p class="MsoNormal"><b><span style="font-size: 10pt;">From:</span></b><span style="font-size: 10pt;">
<a href="mailto:asterisk-users-bounces@lists.digium.com" target="_blank">asterisk-users-bounces@lists.digium.com</a>
[mailto:<a href="mailto:asterisk-users-bounces@lists.digium.com" target="_blank">asterisk-users-bounces@lists.digium.com</a>] <b>On Behalf Of </b>Zarko
Zivanovic<br>
<b>Subject:</b> Re: [asterisk-users] Urgent help = RUBY & AGI</span></p>
</div>
<p class="MsoNormal"> </p>
<div>
<div>
<div>
<p class="MsoNormal"><span style="color: navy;"><snip></span><br>
In the meantime , do you happen to know if there is a way to call both macro
(M) and music on hold (m) in that $agi.exec line?<br>
<br>
or is the right thing to do to place moh command in macro?<br>
<br>
<span style="color: navy;">This should work:</span></p>
</div>
<div>
<blockquote style="margin-top: 5pt; margin-bottom: 5pt;">
<div>
<div>
<div style="margin-left: 0.5in;">
<p class="MsoNormal"><span style="font-size: 11pt;">r
= $agi.exec('DIAL', SIP/voipuser&Zap/32&Zap/33&Zap/34&Zap/35,,<span style="color: navy;">m</span>M(testing))</span></p>
</div>
</div>
</div>
</blockquote>
<div>
<p class="MsoNormal"> </p>
</div>
</div>
</div>
</div>
</div><p class="MsoNormal"><br>
<br>
__________ Information from ESET NOD32 Antivirus, version of virus signature
database 5318 (20100727) __________</p><div class="im"><br>
<br>
The message was checked by ESET NOD32 Antivirus.<br>
<br>
<a href="http://www.eset.com" target="_blank">http://www.eset.com</a><br>
<br>
</div>
</div>
<br><br>__________ Information from ESET NOD32 Antivirus, version of virus signature database 5319 (20100728) __________<div class="im"><br><br>The message was checked by ESET NOD32 Antivirus.<br><br><a href="http://www.eset.com" target="_blank">http://www.eset.com</a><br>
</div></div>
</blockquote></div><br>