[asterisk-users] URgent - capturing 'answered'
Jim Dickenson
dickenson at cfmc.com
Tue Jul 27 06:01:49 CDT 2010
Which version of Asterisk are you running?
--
Jim Dickenson
mailto:dickenson at cfmc.com
CfMC
http://www.cfmc.com/
On Jul 27, 2010, at 2:19 AM, Zarko Zivanovic wrote:
> Great, but how exactly do i find that channel - that is my question - which
> command.
>
> I am using ruby instead of agi - and i am looking for a command to capture
> it in ruby.
>
> I tried 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 Jim Dickenson
> Sent: Monday, July 26, 2010 7:50 PM
> To: Asterisk Users Mailing List - Non-Commercial Discussion
> Subject: Re: [asterisk-users] URgent - capturing 'answered'
>
> If all you need to do is the the channel name of the channel that answered
> the phone why are you doing so much work? Version 1.4 allows for an agi to
> be called when the dial command is answered. Version 1.6+ allows an agi as
> well as a macro to be called. You can find the channel that answered a multi
> channel dial command. Is this not what you wanted to know?
> --
> Jim Dickenson
> mailto:dickenson at cfmc.com
>
> CfMC
> http://www.cfmc.com/
>
>
>
> On Jul 26, 2010, at 10:40 AM, Zarko Zivanovic wrote:
>
>> Hi Andres,
>>
>> I did try what you said, but it didnt create any files:
>>
>> $message="/bin/echo my variables are '$loc', '$variable1', '$variable2' >>
>> /tmp/variables.txt";
>> system("$message");
>>
>>
>> permissions seem to be fine, echo is in place.
>>
>> I posted the whole script that i am using in the main thread - if you can
>> please loook at it.
>>
>> Zarko.
>>
>>
>>
>>
>> -----Original Message-----
>> From: asterisk-users-bounces at lists.digium.com
>> [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Andres
>> Sent: Monday, July 26, 2010 6:47 PM
>> To: Asterisk Users Mailing List - Non-Commercial Discussion
>> Subject: Re: [asterisk-users] URgent - capturing 'answered'
>>
>> 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.
>>>
>>>
>>
>>
>> --
>> _____________________________________________________________________
>> -- 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 5314 (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
>>
>>
>>
>> --
>> _____________________________________________________________________
>> -- 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
>
>
> --
> _____________________________________________________________________
> -- 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
>
>
>
> --
> _____________________________________________________________________
> -- 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
More information about the asterisk-users
mailing list