[asterisk-users] URgent - capturing 'answered'

Zarko Zivanovic outlaw011 at gmail.com
Tue Jul 27 04:16:28 CDT 2010


Thats great,

However I need to find a solution to this very problem, not able to code
something from scratch.

Even this:

# Create a new file and write to it
File.open('log.txt', 'w') do |f2|
# use "\n" for two lines of text
   f2.puts "Created by Satish\nThank God!\n my variables are '$loc',
'$agi.get_variable(EXTEN)', '$variable1', '$variable2' "
end


                        $my.query("UPDATE call_log SET endtime = NOW() WHERE
id = #{call_log_id}")


- query gets executed, but log.txt wasnt created.

Not to mention that I still didnt manage to catch who answered the call.






-----Original Message-----
From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Steve Edwards
Sent: Monday, July 26, 2010 8:10 PM
To: andres at telesip.net; Asterisk Users Mailing List - Non-Commercial
Discussion
Subject: Re: [asterisk-users] URgent - capturing 'answered'

On Mon, 26 Jul 2010, Andres wrote:

> 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");

I prefer syslog().

) You don't litter your system with little files.

) You get nicely timestamped messages you can centralize across servers.

) You can control how much "verbosity" you want by setting the logging 
priority.

) You can vary the logging priority at run time.

) You can leave the logging code in place in production.

I code all of my AGIs to recognize (via getopt_long()) --debug and 
--verbose command line options. When something weird starts to happen, I 
can enable debugging in the dialplan and debug the code that is running in 
production.

-- 
Thanks in advance,
-------------------------------------------------------------------------
Steve Edwards       sedwards at sedwards.com      Voice: +1-760-468-3867 PST
Newline                                              Fax: +1-760-731-3000

-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users
 

__________ Information from ESET NOD32 Antivirus, version of virus signature
database 5315 (20100726) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 
 

__________ Information from ESET NOD32 Antivirus, version of virus signature
database 5315 (20100726) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 




More information about the asterisk-users mailing list