[asterisk-users] Urgent help = RUBY & AGI

Zarko Zivanovic outlaw011 at gmail.com
Thu Jul 29 07:41:27 CDT 2010


Unfortunately, even after two more days of testing, I was not able to get
that channel info from macro into my ruby script.

As it is now - I do not see the way to do it, and this is unsolved.

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.







On Wed, Jul 28, 2010 at 2:02 PM, Zarko Zivanovic <outlaw011 at gmail.com>wrote:

>  Works like charm Danny,
>
>
>
> Tested and works fine.
>
>
>
> I sent this to Jim, but this is something you could know:
>
>
>
> I managed to start a macro and get info about the channel that picked up
> the call.
>
> Also, as said in the thread, i was able to start moh beside the macro and
> it all works like charm.
>
>
>
> The only thing that I cant do so far, is capturing the ${CHANNEL} variable
> in the ruby script that started the macro.
>
>
>
> Is that variable accessible from the ruby script too or just from the
> macro?
>
>
>
> Here’s a snippet from my ruby script:
>
>
>
>
>
>                         dial_params << "||M(testing)m(moh-0900-#{@moh_id})"
> if moh_available?()
>
>
>
>                         1.times do
>
>                                 r = $agi.exec('DIAL', dial_params)
>
>                                 r = $agi.get_variable('DIALSTATUS')
>
>                                 retry if r.message.include?('BUSY')
>
>
> end
>
>
>
>
> and further below:
>
>
>
> $loc = "testing"
>
>
>
>                                 $my.query("UPDATE call_log SET
> local='#{$loc}', endtime = NOW() WHERE id = #{call_log_id}")
>
>
>
> Works fine, but as soon as I try:
>
>
>
> $loc = ${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?
>
>
>
>
>
> Thanks a bunch !
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *From:* asterisk-users-bounces at lists.digium.com [mailto:
> asterisk-users-bounces at lists.digium.com] *On Behalf Of *Danny Nicholas
> *Sent:* Tuesday, July 27, 2010 6:32 PM
> *To:* 'Asterisk Users Mailing List - Non-Commercial Discussion'
>
> *Subject:* Re: [asterisk-users] Urgent help = RUBY & AGI
>
>
>
> *From:* asterisk-users-bounces at lists.digium.com [mailto:
> asterisk-users-bounces at lists.digium.com] *On Behalf Of *Zarko Zivanovic
> *Subject:* Re: [asterisk-users] Urgent help = RUBY & AGI
>
>
>
> <snip>
> 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?
>
> or is the right thing to do to place moh command in macro?
>
> This should work:
>
>   r = $agi.exec('DIAL', SIP/voipuser&Zap/32&Zap/33&Zap/34&Zap/35,,m
> M(testing))
>
>
>
>
>
> __________ Information from ESET NOD32 Antivirus, version of virus
> signature database 5318 (20100727) __________
>
>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
>
>
>
> __________ Information from ESET NOD32 Antivirus, version of virus
> signature database 5319 (20100728) __________
>
>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20100729/c9a14ccc/attachment.htm 


More information about the asterisk-users mailing list