Hi,

 I have developed a custom AGI in C++. Whenever I stream a file or say out digits with STREAM FILE and SAY NUMBER and hangup the call in between the AGI ends abruptly.
I did a bit of surfing through previous posts and found out that asterisk sends a SIGHUP signal as soon as a caller ends a call. The suggesion was to catch the SIGHUP signal in the process and ignore it. I wrote the following piece of code at the star of the agi.

#include <csignal>
 
  struct sigaction my_action;
  my_action.sa_handler = SIG_IGN;
  my_action.sa_flags = SA_RESTART;
  int sigret = sigaction (SIGHUP, &my_action, NULL);

This should solve the problem but unfortunately the agi is still crashing straight after I hangup the call.

May be I need to unblock the signal, I am not sure how. Am I missing something.

Regards,
Danish
_______________________________________________
--Bandwidth and Colocation provided by Easynews.com --

Asterisk-Users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to