[asterisk-users] Hangup-handler on failed calls

Joel Serrano joel at gogii.net
Wed Feb 26 16:59:06 CST 2020


Found a workaround... In case anyone else runs into something similar:

Setting congestion=yes in cdr.conf changes the writing behavior, and
instead of having one CDR with disposition=FAILED, I have all the CDRs with
disposition=CONGESTION, and as I can link them together with the
linkedid or the uniqueid plus the sequence, I can grab the fields from the
row that has them.





On Tue, Feb 25, 2020 at 4:01 PM Joel Serrano <joel at gogii.net> wrote:

> Hello,
>
> I have a setup with asterisk 16.8.0, I'm facing a problem where calls that
> fail (CONGESTION) don't have filled in some extra fields we add to the CDRs
> in the database.
>
> We use cdr_adaptive_odbc with MySQL as backend.
>
> To simplify the scenario:
>
> [sub-hanguphandler]
> exten => s,1,Set(CDR(foo)=${bar})
> same => n,Return()
>
> [default]
> exten => _X.,1,NoOp(New test call)
> same => n,Set(CHANNEL(hangup_handler_push)=sub-hanguphandler,s,1)
> same => n,Dial(...)
> same => n,Hangup()
>
>
> With the above config:
>
> 1- An answered call: foo is filled in db
> 2- A cancelled call: foo is filled in db
> 3- A failed call: foo is NOT filled in db
>
> In all 3 cases, with verbose logs enabled I can see
> the sub-hanguphandler subroutine is being executed, so it's confusing.
>
> I would understand if the hangup handler is NOT executed for failed calls,
> but seeing it in the logs and then seeing the field empty in the db doesn't
> make sense to me.
>
> Any tips on where/how I can troubleshoot this?
>
>
> Thanks,
> Joel.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20200226/3ad3008c/attachment.html>


More information about the asterisk-users mailing list