[asterisk-users] URgent - capturing 'answered'

Andres andres at telesip.net
Mon Jul 26 11:46:52 CDT 2010


On 7/26/2010 12:27 PM, Zarko Zivanovic wrote:
> I tried this:
>
>
>
> loc = $agi.get_variable('EXTEN')
>
> $my.query("UPDATE call_log SET local = #{loc}, endtime = NOW() WHERE id =
> #{call_log_id}")
>    
When I troubleshoot AGI scripts, I output stuff to text files for 
debugging purposes.  I suggest you output all your variables to a file 
and then you will learn if the variables do have the info you need.

Something like:
$message="/bin/echo my variables are '$loc', '$variable1', '$variable2', 
etc >> /tmp/variables.txt";
system("$message");

Andres
http://www.neuroredes.com
>
>
> No success. Anybody please help!
>
>
> -----Original Message-----
> From: asterisk-users-bounces at lists.digium.com
> [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Leif Madsen
> Sent: Monday, July 26, 2010 3:44 PM
> To: asterisk-users at lists.digium.com
> Subject: Re: [asterisk-users] URgent - capturing 'answered'
>
> On 10-07-26 08:10 AM, Zarko Zivanovic wrote:
>    
>> Hello Steve and thanks for your answer,
>> However I tried:
>>
>> $my.query("UPDATE call_log SET local='#{CDR(dstchannel)}', endtime = NOW()
>> WHERE id = #{call_log_id}")
>>
>> And it does write nothing to the database.
>>
>> I guess there is a error in ruby expression above but I am not sure what
>>      
> is
>    
>> wrong - if you have any idea please help.
>>      
> If that is your literal quote, then I think you need to change the # to a $
> as
> Asterisk dialplan functions and variables start with ${ vs #{
>
> Unless that is some special indication in SQL that I'm unfamiliar with.
>
> Leif Madsen.
>
>    




More information about the asterisk-users mailing list