[asterisk-users] URgent - capturing 'answered'

Steve Davies davies147 at gmail.com
Mon Jul 26 06:37:01 CDT 2010


> 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



More information about the asterisk-users mailing list