[asterisk-users] URgent - capturing 'answered'
Jim Dickenson
dickenson at cfmc.com
Mon Jul 26 08:26:49 CDT 2010
Depending on the version of Asterisk you are running you can call a macro or an agi as option to dial. These will be called when the line is answered and you can find the channel name of who answered.
--
Jim Dickenson
mailto:dickenson at cfmc.com
CfMC
http://www.cfmc.com/
On Jul 26, 2010, at 5: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.
>
> Zarko
>
>
>
> -----Original Message-----
> From: asterisk-users-bounces at lists.digium.com
> [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Steve Davies
> Sent: Monday, July 26, 2010 1:37 PM
> To: Asterisk Users Mailing List - Non-Commercial Discussion
> Subject: Re: [asterisk-users] URgent - capturing 'answered'
>
>> On 7/26/2010 3:41 PM, Zarko Zivanovic wrote:
>>
>> Hello everyone.
>>
>> I need a quick help on how to capture who answered the call with agi.
>>
>> Here is an example:
>>
>> -- Zap/32-1 is ringing
>> -- Zap/33-1 is ringing
>> -- Zap/34-1 is ringing
>> -- Zap/35-1 is ringing
>> -- SIP/operator1-e77f answered Zap/23-1
>>
>> So how can I capture this value and write it to mysql?
>
> If you use cdr_mysql, then this data should already be written to the
> "dstchannel" column in the cdr table.
>
>>
>> I already have this:
>>
>> $my.query("UPDATE call_log
>> SET endtime = NOW() WHERE id = #{call_log_id}")
>>
>> And i needed to do something like:
>>
>> $my.query("UPDATE call_log
>> SET endtime = NOW(),answeredby= #{$agi.WHOANSWEREDTHEPHONE} WHERE id =
>> #{call_log_id}")
>>
>
> Alternatively you may be able to access ${CDR(dstchannel)}.
>
> I've not checked any of the above, but I believe it is right.
>
> Regards,
> Steve
>
> --
> _____________________________________________________________________
> -- 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 5313 (20100726) __________
>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
>
>
>
> __________ Information from ESET NOD32 Antivirus, version of virus signature
> database 5313 (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