Hangup callback handling

Hi everyone,

I am trying to make an api request inside a hangup callback in PERL AGI when the caller hangs up during early media. I have logging in the callback function so I can see that it is being called but when I call the http request method the script just exits returning 4.

Is there a limit to how much processing I can do in a hangup callback or something? I have tried several different ways of making the request using the various perl http functions but all fail and I am out of ideas

$AGI = new Asterisk::AGI;

sub hangup_callback {
$ua = LWP::UserAgent->new;
logInfo("here 1 $ua");
logInfo("here 2");

thanks in advance

I managed to do it in the SIGHUP but would really like to know if this is an ok way of doing things? or if there are any pitfalls I should be aware of with that approach?


I have similar requirement to catch the hangup event and insert the logging information to DB.

Please advice how you have done that with SIGHUP?

Please advice on the steps