[Asterisk-Users] agi, STREAM FILE and SIGHUP

Danish Samad danishsamad at gmail.com
Sun Jun 18 11:46:57 MST 2006


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20060618/7af36559/attachment.htm


More information about the asterisk-users mailing list