Hangup-handler On Failed Calls

Home » Asterisk Users » Hangup-handler On Failed Calls
Asterisk Users 1 Comment

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.

One thought on - Hangup-handler On Failed Calls

  • 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